[cpif] r183 - in trunk: backend frontend-web frontend-web/skins/default

svn at argo.es svn at argo.es
Fri Jun 22 18:44:47 CEST 2007


Author: jcea
Date: Fri Jun 22 18:44:46 2007
New Revision: 183

Log:
Podemos dar OpenID a los usuarios nuevos

Modified:
   trunk/backend/database.py
   trunk/frontend-web/skins/default/body_new_user.html
   trunk/frontend-web/url_nuevo_usuario_POST.py

Modified: trunk/backend/database.py
==============================================================================
--- trunk/backend/database.py	(original)
+++ trunk/backend/database.py	Fri Jun 22 18:44:46 2007
@@ -88,7 +88,7 @@
 
   return None
 
-def usuario_add(conn,nick,datos,clave=None) :
+def usuario_add(conn,nick,datos,clave=None,OpenIDs=None) :
   from durus.btree import BTree
   from durus.persistent_dict import PersistentDict
   from durus.persistent_set import PersistentSet
@@ -119,7 +119,7 @@
                         "mensajes":BTree(),
                         "datos":datos,
                         "clave":clave,
-                        "OpenID":PersistentSet(),
+                        "OpenID":PersistentSet(OpenIDs),
                         "cookie":None,
                         "nick":nick})
 

Modified: trunk/frontend-web/skins/default/body_new_user.html
==============================================================================
--- trunk/frontend-web/skins/default/body_new_user.html	(original)
+++ trunk/frontend-web/skins/default/body_new_user.html	Fri Jun 22 18:44:46 2007
@@ -3,10 +3,12 @@
     <tr><td>Usuario:</td><td><input type="text" name="usuario" size="25" value="" /></td></tr>
     <tr><td>Clave:</td><td><input type="password" name="clave1" size="25" value="" /></td></tr>
     <tr><td>Confirma la clave:</td><td><input type="password" name="clave2" size="25" value="" /></td></tr>
+    <tr><td>Servidores OpenID:</td><td><input type="text" name="OpenID1" size=55 value="" /></td></tr>
+    <tr><td align=right>(opcionales)</td><td><input type="text" name="OpenID2" size=55 value="" /></td></tr>
+    <tr><td>&nbsp;</td><td><input type="text" name="OpenID3" size=55 value="" /></td></tr>
+    <tr><td>&nbsp;</td><td><input type="text" name="OpenID4" size=55 value="" /></td></tr>
+    <tr><td>&nbsp;</td><td><input type="text" name="OpenID5" size=55 value="" /></td></tr> 
     <tr><td colspan=2 align=right><input class="form-element" type="submit" name="submit" value="Crea usuario"/></td></tr>
   </table>
 </form>
-<div id="menu">
-  <h3>Men&uacute;</h3>
-  <ul>
 

Modified: trunk/frontend-web/url_nuevo_usuario_POST.py
==============================================================================
--- trunk/frontend-web/url_nuevo_usuario_POST.py	(original)
+++ trunk/frontend-web/url_nuevo_usuario_POST.py	Fri Jun 22 18:44:46 2007
@@ -25,10 +25,14 @@
   nick=cuerpo.getfirst("usuario").strip()
   clave1=cuerpo.getfirst("clave1").strip()
   clave2=cuerpo.getfirst("clave2").strip()
+  OpenIDs=set()
+  for i in xrange(1,6) :
+    OpenID=cuerpo.getfirst("OpenID%d" %i).strip()
+    if OpenID : OpenIDs.add(OpenID)
 
   if not (nick and clave1 and clave2) :
     pagina.load_url(["error"])
-    pagina.load_dict({"generic_message": "<h1>No puedes dejar ningun campo en blanco</h1>"})
+    pagina.load_dict({"generic_message": "<h1>No puedes dejar ningun campo no opcional en blanco</h1>"})
     return (pagina.web())
 
   if clave1!=clave2 :
@@ -42,7 +46,7 @@
     pagina.load_dict({"generic_message": "<h1>El usuario ya existe</h1>"})
     return (pagina.web())
 
-  database.usuario_add(conn,nick,None,clave=clave1)
+  database.usuario_add(conn,nick,None,clave=clave1,OpenIDs=OpenIDs)
 
   pagina.load_dict({"generic_message": "<h1>Alta exitosa</h1>"})
   return (pagina.web())



More information about the cpif mailing list