[aur-dev] [PATCH 3/5] Fix more warnings occurring with unset SSH keys
Lukas Fleischer
lfleischer at archlinux.org
Mon Feb 27 18:49:53 UTC 2017
Signed-off-by: Lukas Fleischer <lfleischer at archlinux.org>
---
web/lib/acctfuncs.inc.php | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index a6eab27..3c8f9ed 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 */
--
2.12.0
More information about the aur-dev
mailing list