Checks for user availability before accessing the registration key
This commit is contained in:
+2
-2
@@ -3171,12 +3171,12 @@ class Auth(AuthAPI):
|
|||||||
formname='retrieve_password', dbio=False,
|
formname='retrieve_password', dbio=False,
|
||||||
onvalidation=onvalidation, hideerror=self.settings.hideerror):
|
onvalidation=onvalidation, hideerror=self.settings.hideerror):
|
||||||
user = table_user(email=form.vars.email)
|
user = table_user(email=form.vars.email)
|
||||||
key = user.registration_key
|
|
||||||
if not user:
|
if not user:
|
||||||
current.session.flash = \
|
current.session.flash = \
|
||||||
self.messages.invalid_email
|
self.messages.invalid_email
|
||||||
redirect(self.url(args=request.args))
|
redirect(self.url(args=request.args))
|
||||||
elif key in ('pending', 'disabled', 'blocked') or (key or '').startswith('pending'):
|
key = user.registration_key
|
||||||
|
if key in ('pending', 'disabled', 'blocked') or (key or '').startswith('pending'):
|
||||||
current.session.flash = \
|
current.session.flash = \
|
||||||
self.messages.registration_pending
|
self.messages.registration_pending
|
||||||
redirect(self.url(args=request.args))
|
redirect(self.url(args=request.args))
|
||||||
|
|||||||
Reference in New Issue
Block a user