Index: acct_mgr/web_ui.py
===================================================================
--- acct_mgr/web_ui.py Fri May 29 09:11:52 2009
+++ acct_mgr/web_ui.py.new Fri May 29 09:13:48 2009
@@ -527,7 +527,7 @@
'token': token,
},
'verify': {
- 'link': self.env.abs_href.verify_email(token=token),
+ 'link': self.env.abs_href.verify_email(token=token,verify=1),
}
})
@@ -581,22 +581,24 @@
def process_request(self, req):
if 'email_verification_token' not in req.session:
chrome.add_notice(req, 'Your email is already verified')
- elif req.method != 'POST':
- pass
- elif 'resend' in req.args:
+ elif req.method == 'POST' and 'resend' in req.args:
self._send_email(req)
chrome.add_notice(req,
'A notification email has been resent to %s.',
req.session.get('email'))
- elif 'verify' in req.args:
+ elif 'verify' in req.args: # allow via POST or GET (the latter for email links)
if req.args['token'] == req.session['email_verification_token']:
del req.session['email_verification_token']
chrome.add_notice(req, 'Thank you for verifying your email address')
else:
chrome.add_warning(req, 'Invalid verification token')
+
data = {}
if 'token' in req.args:
data['token'] = req.args['token']
+ if 'email_verification_token' not in req.session:
+ data['button_state'] = { 'disabled': 'disabled' }
+
return 'verify_email.html', data, None
def _gen_token(self):
Index: acct_mgr/templates/verify_email.html
===================================================================
--- acct_mgr/templates/verify_email.html Fri May 29 09:12:03 2009
+++ acct_mgr/templates/verify_email.html.new Fri May 29 09:12:37 2009
@@ -31,8 +31,8 @@
-
-
+
+