]> mop.ddnsfree.com - git repositories - brisk.git/commitdiff
move lowercase transformation outside SQL
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Thu, 12 Nov 2015 07:10:23 +0000 (08:10 +0100)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Thu, 12 Nov 2015 07:10:23 +0000 (08:10 +0100)
web/Obj/brisk.phh
web/Obj/dbase_pgsql.phh

index 7d82d56b0ed96d75a0431d5a93c02801275bfb6f..efb360ef12244c407ba864d18ffc202e254bc5db 100644 (file)
@@ -2065,7 +2065,7 @@ class Brisk
             if (($bdb = BriskDB::create()) != FALSE) {
                 $bdb->users_load();
                 /* MLANG: "Il nickname <b>\'%s\'</b> &egrave; gi&agrave; registrato, <b>se il suo proprietario si autentificher&agrave; verrai rinominato d\'ufficio come ghost<i>N</i>.</b>" */
-                if ($bdb->login_exists($name_new)) {
+                if ($bdb->login_exists(strtolower($name_new))) {
                     $prestr = sprintf($mlang_brisk['nickjust'][$G_lang], xcape($name_new));
                     $to_user .= nickserv_msg($dt, $prestr);
                 }
@@ -2364,7 +2364,7 @@ class Brisk
         $bdb->users_load();
         if ($pass != FALSE) { // TODO: here add a method to $bdb to check if the db is available.
             log_auth("XXX", "auth2");
-            $authenticate = $bdb->login_verify($name_new, $pass, $code);
+            $authenticate = $bdb->login_verify(strtolower($name_new), $pass, $code);
             log_auth("XXX", "authenticate: ".($authenticate != FALSE ? "TRUE" : "FALSE"));
 
             if ($authenticate != FALSE) {
@@ -2376,7 +2376,7 @@ class Brisk
             }
         }
         else {
-            $login_exists =  $bdb->login_exists($name_new);
+            $login_exists =  $bdb->login_exists(strtolower($name_new));
         }
     }
     else {
index 5c187aa56f3ab25f0276f3cb3c5b28109807c015..4790e8b9946ecc4ad537fc9471cb6355b12f3c73 100644 (file)
@@ -138,7 +138,7 @@ class BriskDB
         /* check the existence of the nick in the BriskDB */
         log_main("login_exists: ".$login);
 
-        $user_sql = sprintf("SELECT * FROM %susers WHERE login = lower('%s')",
+        $user_sql = sprintf("SELECT * FROM %susers WHERE login = '%s'",
                             $G_dbpfx, escsql($login));
         if (($user_pg = $this->query($user_sql)) != FALSE)
             if (pg_numrows($user_pg) == 1)