summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
authorMarcel Korpel <marcel.korpel@gmail.com>2015-09-20 20:12:25 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-09-20 22:01:23 +0200
commitd5d08b8f926e8882864afbfd7446440acc1005d0 (patch)
tree345631fb4b165d00a4e09304f2cfa9ebd0b5977f /web/lib
parentf3ec4d1ef553259b0a617b9d11da4ece2ecc9dfd (diff)
downloadaur-d5d08b8f926e8882864afbfd7446440acc1005d0.tar.gz
aur-d5d08b8f926e8882864afbfd7446440acc1005d0.tar.xz
Add option to hide one's email address
Implements FS#42343. Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/acctfuncs.inc.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index 756c8477..a2009988 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -47,6 +47,7 @@ function html_format_pgp_fingerprint($fingerprint) {
* @param string $T The account type of the displayed user
* @param string $S Whether the displayed user has a suspended account
* @param string $E The e-mail address of the displayed user
+ * @param string $H Whether the e-mail address of the displayed user is hidden
* @param string $P The password value of the displayed user
* @param string $C The confirmed password value of the displayed user
* @param string $R The real name of the displayed user
@@ -60,7 +61,7 @@ function html_format_pgp_fingerprint($fingerprint) {
*
* @return void
*/
-function display_account_form($A,$U="",$T="",$S="",$E="",$P="",$C="",$R="",
+function display_account_form($A,$U="",$T="",$S="",$E="",$H="",$P="",$C="",$R="",
$L="",$I="",$K="",$PK="",$J="",$UID=0,$N="") {
global $SUPPORTED_LANGS;
@@ -78,6 +79,7 @@ function display_account_form($A,$U="",$T="",$S="",$E="",$P="",$C="",$R="",
* @param string $T The account type for the user
* @param string $S Whether or not the account is suspended
* @param string $E The e-mail address for the user
+ * @param string $H Whether or not the e-mail address should be hidden
* @param string $P The password for the user
* @param string $C The confirmed password for the user
* @param string $R The real name of the user
@@ -91,7 +93,7 @@ function display_account_form($A,$U="",$T="",$S="",$E="",$P="",$C="",$R="",
*
* @return array Boolean indicating success and message to be printed
*/
-function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$P="",$C="",
+function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$H="",$P="",$C="",
$R="",$L="",$I="",$K="",$PK="",$J="",$UID=0,$N="") {
global $SUPPORTED_LANGS;
@@ -324,6 +326,11 @@ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$P="",$C="",
$q.= ", Suspended = 0";
}
$q.= ", Email = " . $dbh->quote($E);
+ if ($H) {
+ $q.= ", HideEmail = 1";
+ } else {
+ $q.= ", HideEmail = 0";
+ }
if ($P) {
$salt = generate_salt();
$hash = salted_hash($P, $salt);