changeset 487:e588335b6aa8

browser and server side: force lower case for the profile name at new account creation + fixes CSS for textarea
author souliane <souliane@mailoo.org>
date Thu, 19 Jun 2014 19:28:17 +0200
parents 600a71743072
children 747eaa662353
files src/browser/public/libervia.css src/browser/sat_browser/register.py src/server/blog.py src/server/server.py
diffstat 4 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/browser/public/libervia.css	Wed Jun 18 14:56:51 2014 +0200
+++ b/src/browser/public/libervia.css	Thu Jun 19 19:28:17 2014 +0200
@@ -331,6 +331,7 @@
     margin: 0px 5px 10px 5px;
     color: #444;
     border: none;
+    vertical-align: text-top;
 }
 
 .gwt-DialogBox .gwt-ListBox {
--- a/src/browser/sat_browser/register.py	Wed Jun 18 14:56:51 2014 +0200
+++ b/src/browser/sat_browser/register.py	Thu Jun 19 19:28:17 2014 +0200
@@ -189,6 +189,8 @@
             self.submit()
 
     def onRegister(self, button):
+        # XXX: for now libervia forces the creation to lower case
+        self.register_login_box.setText(self.register_login_box.getText().lower())
         if not re.match(r'^[a-z0-9_-]+$', self.register_login_box.getText(), re.IGNORECASE):
             self.register_warning_msg.setHTML(_('Invalid login, valid characters<br>are a-z A-Z 0-9 _ -'))
             self.register_warning_msg.setVisible(True)
--- a/src/server/blog.py	Wed Jun 18 14:56:51 2014 +0200
+++ b/src/server/blog.py	Thu Jun 19 19:28:17 2014 +0200
@@ -69,6 +69,7 @@
         """
         if key != 'avatar':
             return
+        entity_jid_s = entity_jid_s.lower()
         log.debug(_("Received a new avatar for entity %s") % entity_jid_s)
         avatar = C.AVATARS_DIR + value
         self.avatars_cache[entity_jid_s] = avatar
@@ -105,7 +106,7 @@
         @param profile (str):
         @return: deferred avatar path, relative to the server's root
         """
-        jid_s = profile + '@' + self.host.bridge.getNewAccountDomain()
+        jid_s = (profile + '@' + self.host.bridge.getNewAccountDomain()).lower()
         if jid_s in self.avatars_cache:
             return defer.succeed(self.avatars_cache[jid_s])
         # FIXME: request_id is no more need when actionResult is removed
--- a/src/server/server.py	Wed Jun 18 14:56:51 2014 +0200
+++ b/src/server/server.py	Thu Jun 19 19:28:17 2014 +0200
@@ -674,7 +674,8 @@
                 value will be given later (one of those previously described)
         """
         try:
-            profile = login = request.args['register_login'][0]
+            # XXX: for now libervia forces the creation to lower case
+            profile = login = request.args['register_login'][0].lower()
             password = request.args['register_password'][0]
             email = request.args['email'][0]
         except KeyError: