diff libervia.tac @ 66:9d8e79ac4c9c

Login/Register box: integration of Adrien Vigneron's design
author Goffi <goffi@goffi.org>
date Wed, 15 Jun 2011 00:52:02 +0200
parents 80c490e6a1a7
children b096facaa5b3
line wrap: on
line diff
--- a/libervia.tac	Wed Jun 15 00:49:34 2011 +0200
+++ b/libervia.tac	Wed Jun 15 00:52:02 2011 +0200
@@ -3,7 +3,7 @@
 
 """
 Libervia: a Salut à Toi frontend
-Copyright (C) 2011  Jérôme Poisson (goffi@goffi.org)
+Copyright (C) 2011  Jérôme Poisson <goffi@goffi.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU Affero General Public License as published by
@@ -313,14 +313,18 @@
             - ALREADY WAITING: a request has already be made for this profile
             - server.NOT_DONE_YET: the profile is being processed, the return value will be given by self._logged or self._logginError
         """ 
-        if 'new_account' in request.args:
-            return self._registerNewAccount(request.args)
-
         try:
-            _login = request.args['login'][0]
-            if _login.startswith('@'):
-                raise Exception('No profile_key allowed')
-            _pass = request.args['password'][0]
+            if request.args['submit_type'][0] == 'login':
+                _login = request.args['login'][0]
+                if _login.startswith('@'):
+                    raise Exception('No profile_key allowed')
+                _pass = request.args['login_password'][0]
+            
+            elif request.args['submit_type'][0] == 'register':
+                return self._registerNewAccount(request.args)
+            
+            else:
+                raise Exception('Unknown submit type')
         except KeyError:
             return "BAD REQUEST"
 
@@ -359,7 +363,8 @@
         #TODO: must be moved in SàT core
 
         try:
-            profile = login = args['login'][0]
+            profile = login = args['register_login'][0]
+            password = request.args['register_password'][0] #FIXME: password is ignored so far
             email = args['email'][0]
         except KeyError:
             return "BAD REQUEST"