comparison libervia.tac @ 67:b096facaa5b3

registration fix
author Goffi <goffi@goffi.org>
date Wed, 15 Jun 2011 20:22:27 +0200
parents 9d8e79ac4c9c
children 975e6be24e11
comparison
equal deleted inserted replaced
66:9d8e79ac4c9c 67:b096facaa5b3
359 def _registerNewAccount(self, args): 359 def _registerNewAccount(self, args):
360 """Create a new account, or return error 360 """Create a new account, or return error
361 @param args: dict of args as given by the form 361 @param args: dict of args as given by the form
362 @return: "REGISTRATION" in case of success""" 362 @return: "REGISTRATION" in case of success"""
363 #TODO: must be moved in SàT core 363 #TODO: must be moved in SàT core
364
365 try: 364 try:
366 profile = login = args['register_login'][0] 365 profile = login = args['register_login'][0]
367 password = request.args['register_password'][0] #FIXME: password is ignored so far 366 password = args['register_password'][0] #FIXME: password is ignored so far
368 email = args['email'][0] 367 email = args['email'][0]
369 except KeyError: 368 except KeyError:
370 return "BAD REQUEST" 369 return "BAD REQUEST"
371 if not re.match(r'^[a-z0-9_-]+$', login, re.IGNORECASE) or \ 370 if not re.match(r'^[a-z0-9_-]+$', login, re.IGNORECASE) or \
372 not re.match(r'^.+@.+\..+', email, re.IGNORECASE): 371 not re.match(r'^.+@.+\..+', email, re.IGNORECASE):