merge tls-sprint
authorsylvain.thenault@logilab.fr
Mon, 16 Feb 2009 20:55:00 +0100
branchtls-sprint
changeset 646 8a9551089912
parent 644 5e5b296a657e (current diff)
parent 645 4dd6226d48c9 (diff)
child 647 49bb57a9606b
merge
common/selectors.py
vregistry.py
web/views/basetemplates.py
--- a/doc/book/en/makefile	Mon Feb 16 20:51:41 2009 +0100
+++ b/doc/book/en/makefile	Mon Feb 16 20:55:00 2009 +0100
@@ -43,7 +43,7 @@
 #apydoc: 
 #	epydoc --html -o epydoc/ -n ../server/*.py ../core/*.py ../common/*.py ../server/*/*.py ../modpython/*/*.py ../common/*/*.py
 apidoc:
-	epydoc --html -o apidoc -n "cubicweb" --exclude=setup --exclude=__pkginfo__ ../
+	epydoc --html -o apidoc -n "cubicweb" --exclude=setup --exclude=__pkginfo__ ../../../
 
 # run sphinx ###
 html:
--- a/doc/book/fr/makefile	Mon Feb 16 20:51:41 2009 +0100
+++ b/doc/book/fr/makefile	Mon Feb 16 20:55:00 2009 +0100
@@ -43,7 +43,7 @@
 #apydoc: 
 #	epydoc --html -o epydoc/ -n ../server/*.py ../core/*.py ../common/*.py ../server/*/*.py ../modpython/*/*.py ../common/*/*.py
 apidoc:
-	epydoc --html -o apidoc -n "cubicweb" --exclude=setup --exclude=__pkginfo__ ../
+	epydoc --html -o apidoc -n "cubicweb" --exclude=setup --exclude=__pkginfo__ ../../../
 
 # run sphinx ###
 html:
--- a/i18n/en.po	Mon Feb 16 20:51:41 2009 +0100
+++ b/i18n/en.po	Mon Feb 16 20:55:00 2009 +0100
@@ -1816,6 +1816,9 @@
 msgid "i18n_login_popup"
 msgstr "login"
 
+msgid "i18n_register_user"
+msgstr "register"
+
 msgid "i18nprevnext_next"
 msgstr "next"
 
@@ -2021,6 +2024,9 @@
 msgid "login"
 msgstr ""
 
+msgid "login or email" 
+msgstr ""
+
 msgid "login_action"
 msgstr "log in"
 
--- a/i18n/es.po	Mon Feb 16 20:51:41 2009 +0100
+++ b/i18n/es.po	Mon Feb 16 20:55:00 2009 +0100
@@ -1899,6 +1899,9 @@
 msgid "i18n_login_popup"
 msgstr "identificarse"
 
+msgid "i18n_register_user"
+msgstr "registrarse"
+
 msgid "i18nprevnext_next"
 msgstr "siguiente"
 
--- a/i18n/fr.po	Mon Feb 16 20:51:41 2009 +0100
+++ b/i18n/fr.po	Mon Feb 16 20:55:00 2009 +0100
@@ -1899,6 +1899,9 @@
 msgid "i18n_login_popup"
 msgstr "s'authentifier"
 
+msgid "i18n_register_user"
+msgstr "s'enregister"
+
 msgid "i18nprevnext_next"
 msgstr "suivant"
 
@@ -2115,6 +2118,9 @@
 msgid "login"
 msgstr "identifiant"
 
+msgid "login or email"
+msgstr "identifiant ou email"
+
 msgid "login_action"
 msgstr "identifiez vous"
 
--- a/interfaces.py	Mon Feb 16 20:51:41 2009 +0100
+++ b/interfaces.py	Mon Feb 16 20:55:00 2009 +0100
@@ -238,3 +238,7 @@
     def rss_feed_url(self):
         """return an url which layout sub-entities item
         """
+class ISIOC(Interface):
+    """interface for entities with sioc views"""
+    
+   
--- a/server/repository.py	Mon Feb 16 20:51:41 2009 +0100
+++ b/server/repository.py	Mon Feb 16 20:55:00 2009 +0100
@@ -491,6 +491,9 @@
         try:
             if session.execute('EUser X WHERE X login %(login)s', {'login': login}):
                 return False
+            if session.execute('EUser X WHERE X use_email C, C address %(login)s',
+                               {'login': login}):
+                return False
             # we have to create the user
             user = self.vreg.etype_class('EUser')(session, None)
             if isinstance(password, unicode):
@@ -502,6 +505,11 @@
             self.glob_add_entity(session, user)
             session.execute('SET X in_group G WHERE X eid %(x)s, G name "users"',
                             {'x': user.eid})
+            # FIXME this does not work yet
+            if '@' in login:
+                session.execute('INSERT EmailAddress X: X address "%(login)s", '
+                                'U primary_email X, U use_email X WHERE U login "%(login)s"',
+                                {'login':login})
             session.commit()
         finally:
             session.close()
--- a/web/views/basecomponents.py	Mon Feb 16 20:51:41 2009 +0100
+++ b/web/views/basecomponents.py	Mon Feb 16 20:55:00 2009 +0100
@@ -104,6 +104,10 @@
             self.w(self.req._('anonymous'))
             self.w(u'''&nbsp;[<a class="logout" href="javascript: popupLoginBox();">%s</a>]'''
                    % (self.req._('i18n_login_popup')))
+            # FIXME maybe have an other option to explicitely authorise registration
+            if self.config['anonymous-user']:
+                self.w(u'''&nbsp;[<a class="logout" href="?vid=register">%s</a>]'''
+                       % (self.req._('i18n_register_user')))
         else:
             self.w(self.req._('anonymous'))
             self.w(u'&nbsp;[<a class="logout" href="%s">%s</a>]'
--- a/web/views/basetemplates.py	Mon Feb 16 20:51:41 2009 +0100
+++ b/web/views/basetemplates.py	Mon Feb 16 20:55:00 2009 +0100
@@ -512,7 +512,7 @@
                % html_escape(login_form_url(self.config, self.req)))
         self.w(u'<table>\n')
         self.w(u'<tr>\n')
-        self.w(u'<td><label for="__login">%s</label></td>' % _('login'))
+        self.w(u'<td><label for="__login">%s</label></td>' % _('login or email'))
         self.w(u'<td><input name="__login" id="__login" class="data" type="text" /></td>')
         self.w(u'</tr><tr>\n')
         self.w(u'<td><label for="__password" >%s</label></td>' % _('password'))