Fix more warnings occurring with unset SSH keys

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Lukas Fleischer 2017-02-27 18:04:38 +01:00
parent f1d95c09a8
commit 1bedf736e8

View file

@ -301,7 +301,9 @@ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$H="",$P="",$C=""
} }
$uid = $dbh->lastInsertId(); $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.", $message = __("The account, %s%s%s, has been successfully created.",
"<strong>", htmlspecialchars($U,ENT_QUOTES), "</strong>"); "<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); $q.= " WHERE ID = ".intval($UID);
$result = $dbh->exec($q); $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)) { if (isset($_COOKIE["AURTZ"]) && ($_COOKIE["AURTZ"] != $TZ)) {
/* set new cookie for timezone */ /* set new cookie for timezone */