mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Add support for backup email addresses
Support secondary email addresses that can be used to recover an account in case access to the primary email address is lost. Reset keys for an account are always sent to both the primary and the backup email address. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
e5a839bf0b
commit
ee2aa9755f
9 changed files with 47 additions and 14 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue