Skip to content

Commit 3eaaec0

Browse files
committed
fix bugs
1 parent 2e52486 commit 3eaaec0

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

webroot/js/ajax/ssh_validate.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?php
22

3-
require_once __DIR__ . "/../../../vendor/autoload.php";
4-
require_once __DIR__ . "/../../../resources/lib/utils.php";
5-
require_once __DIR__ . "/../../../resources/lib/UnityHTTPD.php";
3+
require "../../../resources/autoload.php";
64

75
use UnityWebPortal\lib\UnityHTTPD;
86

9-
header('Content-Type: application/json; charset=utf-8');
107
[$is_valid, $explanation] = testValidSSHKey(UnityHTTPD::getPostData("key"));
8+
header('Content-Type: application/json; charset=utf-8');
119
echo jsonEncode(["is_valid" => $is_valid, "explanation" => $explanation]);

webroot/panel/account.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
foreach ($keys as $key) {
4949
$keyShort = shortenString($key, 10, 30);
5050
[$is_valid, $explanation] = testValidSSHKey($key);
51-
if ($is_valid) {
51+
if (!$is_valid) {
5252
UnityHTTPD::messageError("SSH Key Not Added: $explanation", $keyShort);
5353
}
5454
$keyWasAdded = $USER->addSSHKey($key, $OPERATOR);

webroot/panel/modal/new_key.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function generateKey(type) {
109109
$("textarea[name=key]").css("box-shadow", "0 0 0 0.3rem rgba(220,53,69,0.25)");
110110
console.log(result.explanation);
111111
}
112-
}
112+
},
113113
error: function(result) {
114114
$("input[id=add-key]").prop("disabled", true);
115115
$("textarea[name=key]").css("box-shadow", "0 0 0 0.3rem rgba(220,53,69,0.25)");

0 commit comments

Comments
 (0)