summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2015-05-31 19:09:14 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-05-31 19:16:31 +0200
commit86352459ab6a75866376bac5a3baa94f1a736909 (patch)
treedbfc2eb3f44b387f6495b4296c65e88e999a9bb6
parent8c4428de5d05faea000dc3894996d61a065c8660 (diff)
downloadaurweb-86352459ab6a75866376bac5a3baa94f1a736909.tar.xz
Allow for resetting the SSH public key
Use NULL instead of an empty string if the SSH public key field is left empty. Additionally, do not check for duplicate keys in that case. Fixes FS#45109. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
-rw-r--r--web/lib/acctfuncs.inc.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index 20ac081..993cd34 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -203,7 +203,7 @@ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$P="",$C="",
"<strong>", htmlspecialchars($E,ENT_QUOTES), "</strong>");
}
}
- if (!$error) {
+ if (!$error && !empty($PK)) {
/*
* Check whether the SSH public key is available.
* TODO: Fix race condition.
@@ -247,7 +247,7 @@ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$P="",$C="",
$L = $dbh->quote($L);
$I = $dbh->quote($I);
$K = $dbh->quote(str_replace(" ", "", $K));
- $PK = $dbh->quote($PK);
+ $PK = empty($PK) ? "NULL" : $dbh->quote($PK);
$q = "INSERT INTO Users (AccountTypeID, Suspended, ";
$q.= "InactivityTS, Username, Email, Passwd, Salt, ";
$q.= "RealName, LangPreference, IRCNick, PGPKey, ";