From bfb0cacd541cc20129a3c0ac77130370741dca18 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Wed, 18 Sep 2013 01:38:36 +0200 Subject: mysql to mysqli and a lot of cleanup and mvc --- includes/sys_auth.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'includes/sys_auth.php') diff --git a/includes/sys_auth.php b/includes/sys_auth.php index 4ca56632..a2fd98d8 100644 --- a/includes/sys_auth.php +++ b/includes/sys_auth.php @@ -31,8 +31,7 @@ function generate_salt($length = 16) { // set the password of a user function set_password($uid, $password) { - $res = sql_query("UPDATE `User` SET `Passwort` = '" . sql_escape(crypt($password, CRYPT_ALG . '$' . generate_salt(16) . '$')) . "' WHERE `UID` = " . intval($uid) . " LIMIT 1"); - return $res && (mysql_affected_rows() > 0); + return sql_query("UPDATE `User` SET `Passwort` = '" . sql_escape(crypt($password, CRYPT_ALG . '$' . generate_salt(16) . '$')) . "' WHERE `UID` = " . intval($uid) . " LIMIT 1"); } // verify a password given a precomputed salt. @@ -72,8 +71,6 @@ function json_auth_service() { if (count($Erg) == 1) { $Erg = $Erg[0]; if (verify_password($Pass, $Erg["Passwort"], $Erg["UID"])) { - $UID = mysql_result($Erg, 0, "UID"); - $user_privs = sql_select("SELECT `Privileges`.`name` FROM `User` JOIN `UserGroups` ON (`User`.`UID` = `UserGroups`.`uid`) JOIN `GroupPrivileges` ON (`UserGroups`.`group_id` = `GroupPrivileges`.`group_id`) JOIN `Privileges` ON (`GroupPrivileges`.`privilege_id` = `Privileges`.`id`) WHERE `User`.`UID`=" . sql_escape($UID) . ";"); foreach ($user_privs as $user_priv) $privileges[] = $user_priv['name']; -- cgit v1.2.3-70-g09d2