summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2017-02-27 18:04:38 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2017-02-27 18:20:00 +0100
commit1bedf736e89fc4cd82f4522ea0747851ff901510 (patch)
treeb2d5a7c507d1ed18a769e41dea40adb86b8826ee /web
parentf1d95c09a87c726a0fa294fe373dc3c80334c58f (diff)
downloadaur-1bedf736e89fc4cd82f4522ea0747851ff901510.tar.gz
aur-1bedf736e89fc4cd82f4522ea0747851ff901510.tar.xz
Fix more warnings occurring with unset SSH keys
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web')
-rw-r--r--web/lib/acctfuncs.inc.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index a6eab274..3c8f9edb 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -301,7 +301,9 @@ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$H="",$P="",$C=""
}
$uid = $dbh->lastInsertId();
- account_set_ssh_keys($uid, $ssh_keys, $ssh_fingerprints);
+ if (isset($ssh_keys) && count($ssh_keys) > 0) {
+ account_set_ssh_keys($uid, $ssh_keys, $ssh_fingerprints);
+ }
$message = __("The account, %s%s%s, has been successfully created.",
"<strong>", htmlspecialchars($U,ENT_QUOTES), "</strong>");
@@ -364,7 +366,11 @@ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$H="",$P="",$C=""
$q.= " WHERE ID = ".intval($UID);
$result = $dbh->exec($q);
- $ssh_key_result = account_set_ssh_keys($UID, $ssh_keys, $ssh_fingerprints);
+ if (isset($ssh_keys) && count($ssh_keys) > 0) {
+ $ssh_key_result = account_set_ssh_keys($UID, $ssh_keys, $ssh_fingerprints);
+ } else {
+ $ssh_key_result = true;
+ }
if (isset($_COOKIE["AURTZ"]) && ($_COOKIE["AURTZ"] != $TZ)) {
/* set new cookie for timezone */