From: Harvie Date: Sat, 8 Jan 2011 21:41:21 +0000 (+0100) Subject: Login event cleanup X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=95712c2e3aa412fed8223b8010ae73441636148e;p=mirrors%2FKyberia-bloodline.git Login event cleanup --- diff --git a/wwwroot/inc/eventz/login.inc b/wwwroot/inc/eventz/login.inc index 1fb4a04..60aa400 100644 --- a/wwwroot/inc/eventz/login.inc +++ b/wwwroot/inc/eventz/login.inc @@ -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";