diff --git a/aurweb/scripts/notify.py b/aurweb/scripts/notify.py index f2767fd8..b0f218b5 100755 --- a/aurweb/scripts/notify.py +++ b/aurweb/scripts/notify.py @@ -90,13 +90,17 @@ class Notification: class ResetKeyNotification(Notification): def __init__(self, conn, uid): - cur = conn.execute('SELECT UserName, Email, LangPreference, ' + - 'ResetKey FROM Users WHERE ID = ?', [uid]) - self._username, self._to, self._lang, self._resetkey = cur.fetchone() + cur = conn.execute('SELECT UserName, Email, BackupEmail, ' + + 'LangPreference, ResetKey ' + + 'FROM Users WHERE ID = ?', [uid]) + self._username, self._to, self._backup, self._lang, self._resetkey = cur.fetchone() super().__init__() def get_recipients(self): - return [(self._to, self._lang)] + if self._backup: + return [(self._to, self._lang), (self._backup, self._lang)] + else: + return [(self._to, self._lang)] def get_subject(self, lang): return self._l10n.translate('AUR Password Reset', lang) diff --git a/schema/aur-schema.sql b/schema/aur-schema.sql index fa991ba6..1f86df20 100644 --- a/schema/aur-schema.sql +++ b/schema/aur-schema.sql @@ -23,6 +23,7 @@ CREATE TABLE Users ( Suspended TINYINT UNSIGNED NOT NULL DEFAULT 0, Username VARCHAR(32) NOT NULL, Email VARCHAR(254) NOT NULL, + BackupEmail VARCHAR(254) NULL DEFAULT NULL, HideEmail TINYINT UNSIGNED NOT NULL DEFAULT 0, Passwd VARCHAR(255) NOT NULL, Salt CHAR(32) NOT NULL DEFAULT '', diff --git a/upgrading/4.9.0.txt b/upgrading/4.9.0.txt index 4c79283e..241f24af 100644 --- a/upgrading/4.9.0.txt +++ b/upgrading/4.9.0.txt @@ -4,3 +4,9 @@ ALTER TABLE PackageRequests ADD COLUMN ClosedTS BIGINT UNSIGNED NULL DEFAULT NULL; ALTER TABLE PackageRequests ADD COLUMN ClosedUID INTEGER UNSIGNED NULL DEFAULT NULL; ---- + +2. Add a new column to store backup email addresses: + +---- +ALTER TABLE Users ADD COLUMN BackupEmail VARCHAR(254) NULL DEFAULT NULL; +---- diff --git a/web/html/account.php b/web/html/account.php index ff9aba5b..c05d136d 100644 --- a/web/html/account.php +++ b/web/html/account.php @@ -33,6 +33,7 @@ if ($action == "UpdateAccount") { in_request("T"), in_request("S"), in_request("E"), + in_request("BE"), in_request("H"), in_request("P"), in_request("C"), @@ -97,6 +98,7 @@ if (isset($_COOKIE["AURSID"])) { $row["AccountTypeID"], $row["Suspended"], $row["Email"], + $row["BackupEmail"], $row["HideEmail"], "", "", @@ -159,6 +161,7 @@ if (isset($_COOKIE["AURSID"])) { in_request("T"), in_request("S"), in_request("E"), + in_request("BE"), in_request("H"), in_request("P"), in_request("C"), diff --git a/web/html/login.php b/web/html/login.php index df517055..01454414 100644 --- a/web/html/login.php +++ b/web/html/login.php @@ -26,7 +26,7 @@ html_header('AUR ' . __("Login"));
- +
diff --git a/web/html/passreset.php b/web/html/passreset.php index b3c8bd29..26b9bbbb 100644 --- a/web/html/passreset.php +++ b/web/html/passreset.php @@ -65,7 +65,7 @@ html_header(__("Password Reset"));