Login event cleanup
authorHarvie <tomas@mudrunka.cz>
Sat, 8 Jan 2011 21:41:21 +0000 (22:41 +0100)
committerHarvie <tomas@mudrunka.cz>
Sat, 8 Jan 2011 21:41:21 +0000 (22:41 +0100)
wwwroot/inc/eventz/login.inc

index 1fb4a041cf21776cf7d3b933046f0c996f735946..60aa40051e4cd213116e07afc227743a4d39afe4 100644 (file)
@@ -20,27 +20,22 @@ function login() {
         return false;
     }
 
-    switch ($login_type) {
-        case "name":
-            $q = "select * from users where login='$login' and $hash_query";
-            $set = $db->query($q);
-            $set->next();
-            $user_id = $set->getString('user_id');
-            $user_name = $set->getString('login');
-        break;
-        case "base36id":
-                                       $login = base_convert($login, 36, 10);
-        case "id":
-            // HA! if it is number, escape_string is not enough
-           $login=intval($login);
-
-            $q="select * from users where user_id='$login' and $hash_query";
-            $set=$db->query($q);
-            $set->next();
-            $user_id=$set->getString('user_id');
-            $user_name=$set->getString('login');
-        break;
-    }
+       switch ($login_type) {
+               case "name":
+                       $q = "select * from users where login='$login' and $hash_query";
+                       break;
+               case "base36id":
+                       $login = base_convert($login, 36, 10);
+               case "id":
+                       $login=intval($login); //HA! if it is number, escape_string is not enough
+                       $q="select * from users where user_id='$login' and $hash_query";
+                       break;
+       }
+
+       $set = $db->query($q);
+       $set->next();
+       $user_id = $set->getString('user_id');
+       $user_name = $set->getString('login');
 
     if (!$set) { //XXX test
         $error="Zadal si nespravne uzivatelske meno [alebo id] alebo heslo. Rob so sebou nieco";
This page took 0.13378 seconds and 4 git commands to generate.