Sfoglia il codice sorgente

Added functionality whe ssh key is missing the last part:

ssh-rsa your_private_key

wasn't accepted as ssk key With the changes it generate an "unique" id for deleting later...
Jaap Marcus 5 anni fa
parent
commit
2fed8d6dc2
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      web/add/key/index.php

+ 2 - 1
web/add/key/index.php

@@ -32,7 +32,8 @@ if (!empty($_POST['ok'])) {
             $v_key_parts = explode(' ',$_POST['v_key']);
             $v_key_parts = explode(' ',$_POST['v_key']);
             $key_id = trim($v_key_parts[2]);
             $key_id = trim($v_key_parts[2]);
             if($v_key_parts[2] == ''){
             if($v_key_parts[2] == ''){
-                $_SESSION['error_msg']  = _('SSH KEY is invalid');
+                $v_key_parts[2] = md5(time());
+                $_POST['v_key'] .= ' '.$v_key_parts[2];
             }
             }
     
     
             //for deleting / revoking key the last part user@domain is used therefore needs to be unique
             //for deleting / revoking key the last part user@domain is used therefore needs to be unique