Properly orders login by length.
authorStéphane Jacob <sj@m4x.org>
Mon, 21 Mar 2011 21:51:11 +0000 (22:51 +0100)
committerStéphane Jacob <sj@m4x.org>
Mon, 21 Mar 2011 21:51:11 +0000 (22:51 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
plugins/insert.getUserName.php

index ce34a96..7caa9a2 100644 (file)
@@ -43,7 +43,7 @@ function smarty_insert_getUsername()
         return XDB::fetchOneCell('SELECT  email
                                     FROM  email_source_account
                                    WHERE  uid = {?} AND type != \'alias_aux\'
-                                ORDER BY  NOT FIND_IN_SET(\'bestalias\', flags), MIN(email)',
+                                ORDER BY  NOT FIND_IN_SET(\'bestalias\', flags), CHAR_LENGTH(email)',
                                  $id);
     }