mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Remove "New Package Notify" option from user account settings.
Do this in preparation for the upcoming notification script removal. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
31cda618ca
commit
eef5353bde
2 changed files with 10 additions and 31 deletions
|
@ -64,7 +64,7 @@ if (isset($_COOKIE["AURSID"])) {
|
||||||
display_account_form($atype, "UpdateAccount", $row["Username"],
|
display_account_form($atype, "UpdateAccount", $row["Username"],
|
||||||
$row["AccountType"], $row["Suspended"], $row["Email"],
|
$row["AccountType"], $row["Suspended"], $row["Email"],
|
||||||
"", "", $row["RealName"], $row["LangPreference"],
|
"", "", $row["RealName"], $row["LangPreference"],
|
||||||
$row["IRCNick"], $row["NewPkgNotify"], $row["ID"]);
|
$row["IRCNick"], $row["ID"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ if (isset($_COOKIE["AURSID"])) {
|
||||||
in_request("U"), in_request("T"), in_request("S"),
|
in_request("U"), in_request("T"), in_request("S"),
|
||||||
in_request("E"), in_request("P"), in_request("C"),
|
in_request("E"), in_request("P"), in_request("C"),
|
||||||
in_request("R"), in_request("L"), in_request("I"),
|
in_request("R"), in_request("L"), in_request("I"),
|
||||||
in_request("N"), in_request("ID"));
|
in_request("ID"));
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -127,7 +127,7 @@ if (isset($_COOKIE["AURSID"])) {
|
||||||
display_account_form($atype, "UpdateAccount", $row["Username"],
|
display_account_form($atype, "UpdateAccount", $row["Username"],
|
||||||
$row["AccountType"], $row["Suspended"], $row["Email"],
|
$row["AccountType"], $row["Suspended"], $row["Email"],
|
||||||
"", "", $row["RealName"], $row["LangPreference"],
|
"", "", $row["RealName"], $row["LangPreference"],
|
||||||
$row["IRCNick"], $row["NewPkgNotify"], $row["ID"]);
|
$row["IRCNick"], $row["ID"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ if (isset($_COOKIE["AURSID"])) {
|
||||||
process_account_form("","new", "NewAccount",
|
process_account_form("","new", "NewAccount",
|
||||||
in_request("U"), 1, 0, in_request("E"),
|
in_request("U"), 1, 0, in_request("E"),
|
||||||
in_request("P"), in_request("C"), in_request("R"),
|
in_request("P"), in_request("C"), in_request("R"),
|
||||||
in_request("L"), in_request("I"), in_request("N"));
|
in_request("L"), in_request("I"));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
# display the account request form
|
# display the account request form
|
||||||
|
|
|
@ -11,7 +11,7 @@ function in_request($name) {
|
||||||
# Display the standard Account form, pass in default values if any
|
# Display the standard Account form, pass in default values if any
|
||||||
|
|
||||||
function display_account_form($UTYPE,$A,$U="",$T="",$S="",
|
function display_account_form($UTYPE,$A,$U="",$T="",$S="",
|
||||||
$E="",$P="",$C="",$R="",$L="",$I="",$N="",$UID=0) {
|
$E="",$P="",$C="",$R="",$L="",$I="",$UID=0) {
|
||||||
# UTYPE: what user type the form is being displayed for
|
# UTYPE: what user type the form is being displayed for
|
||||||
# A: what "form" name to use
|
# A: what "form" name to use
|
||||||
# U: value to display for username
|
# U: value to display for username
|
||||||
|
@ -127,16 +127,6 @@ function display_account_form($UTYPE,$A,$U="",$T="",$S="",
|
||||||
print "</select></td>";
|
print "</select></td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print "<tr>";
|
|
||||||
print "<td align='left'>".__("New Package Notify").":</td>";
|
|
||||||
print "<td align='left'><input type='checkbox' name='N'";
|
|
||||||
if ($N) {
|
|
||||||
print " checked=\"checked\" />";
|
|
||||||
} else {
|
|
||||||
print " />";
|
|
||||||
}
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
print "<tr><td colspan='2'> </td></tr>\n";
|
print "<tr><td colspan='2'> </td></tr>\n";
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print "<td> </td>";
|
print "<td> </td>";
|
||||||
|
@ -162,7 +152,7 @@ function display_account_form($UTYPE,$A,$U="",$T="",$S="",
|
||||||
# process form input from a new/edit account form
|
# process form input from a new/edit account form
|
||||||
#
|
#
|
||||||
function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="",
|
function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="",
|
||||||
$P="",$C="",$R="",$L="",$I="",$N="",$UID=0) {
|
$P="",$C="",$R="",$L="",$I="",$UID=0) {
|
||||||
# UTYPE: The user's account type
|
# UTYPE: The user's account type
|
||||||
# TYPE: either "edit" or "new"
|
# TYPE: either "edit" or "new"
|
||||||
# A: what parent "form" name to use
|
# A: what parent "form" name to use
|
||||||
|
@ -269,7 +259,7 @@ function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="",
|
||||||
if ($error) {
|
if ($error) {
|
||||||
print "<span class='error'>".$error."</span><br/>\n";
|
print "<span class='error'>".$error."</span><br/>\n";
|
||||||
display_account_form($UTYPE, $A, $U, $T, $S, $E, "", "",
|
display_account_form($UTYPE, $A, $U, $T, $S, $E, "", "",
|
||||||
$R, $L, $I, $N, $UID);
|
$R, $L, $I, $UID);
|
||||||
} else {
|
} else {
|
||||||
if ($TYPE == "new") {
|
if ($TYPE == "new") {
|
||||||
# no errors, go ahead and create the unprivileged user
|
# no errors, go ahead and create the unprivileged user
|
||||||
|
@ -279,13 +269,8 @@ function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="",
|
||||||
array($U, $E, $P, $salt, $R, $L, $I));
|
array($U, $E, $P, $salt, $R, $L, $I));
|
||||||
$q = "INSERT INTO Users (" .
|
$q = "INSERT INTO Users (" .
|
||||||
"AccountTypeID, Suspended, Username, Email, Passwd, Salt" .
|
"AccountTypeID, Suspended, Username, Email, Passwd, Salt" .
|
||||||
", RealName, LangPreference, IRCNick, NewPkgNotify) " .
|
", RealName, LangPreference, IRCNick) " .
|
||||||
"VALUES (1, 0, '" . implode("', '", $escaped) . "'";
|
"VALUES (1, 0, '" . implode("', '", $escaped) . "')";
|
||||||
if ($N) {
|
|
||||||
$q.= ", 1)";
|
|
||||||
} else {
|
|
||||||
$q.= ", 0)";
|
|
||||||
}
|
|
||||||
$result = db_query($q, $dbh);
|
$result = db_query($q, $dbh);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
print __("Error trying to create account, %h%s%h: %s.",
|
print __("Error trying to create account, %h%s%h: %s.",
|
||||||
|
@ -322,12 +307,6 @@ function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="",
|
||||||
$q.= ", RealName = '".mysql_real_escape_string($R)."'";
|
$q.= ", RealName = '".mysql_real_escape_string($R)."'";
|
||||||
$q.= ", LangPreference = '".mysql_real_escape_string($L)."'";
|
$q.= ", LangPreference = '".mysql_real_escape_string($L)."'";
|
||||||
$q.= ", IRCNick = '".mysql_real_escape_string($I)."'";
|
$q.= ", IRCNick = '".mysql_real_escape_string($I)."'";
|
||||||
$q.= ", NewPkgNotify = ";
|
|
||||||
if ($N) {
|
|
||||||
$q.= "1 ";
|
|
||||||
} else {
|
|
||||||
$q.= "0 ";
|
|
||||||
}
|
|
||||||
$q.= " WHERE ID = ".intval($UID);
|
$q.= " WHERE ID = ".intval($UID);
|
||||||
$result = db_query($q, $dbh);
|
$result = db_query($q, $dbh);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue