Fix broken correctUserName.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 24 Jan 2011 20:10:09 +0000 (21:10 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 24 Jan 2011 20:10:09 +0000 (21:10 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
htdocs/javascript/xorg.js

index f025d67..b48e166 100644 (file)
@@ -603,12 +603,12 @@ function correctUserName() {
     var mots;
 
     // login with no space
-    if (u.value.contains(' ')) {
+    if (!u.value.contains(' ')) {
         return true;
     }
     mots = u.value.split(' ');
     // jean paul.du pont -> jean-paul.du-pont
-    if (u.value.indexOf('.') > 0) {
+    if (u.value.contains('.')) {
         u.value = mots.join('-');
         return true;
     }