Merge branch '138-toggle-free-look-with-hotkey' into 'main/atys-live'
[ryzomcore.git] / web / public_php / admin / functions_tool_preferences.php
blob06ed2a4216cc158f5132b2d29efd53190a319d92
1 <?php
3 /*
4 * checks whether a password matches a users password
5 */
6 function tool_pref_check_old_password($userinfo, $password)
8 if (!is_array($userinfo) && !isset($userinfo['user_id'])) return false;
10 $encoded_password = md5($password);
11 if ($encoded_password == $userinfo['user_password']) return true;
13 return false;
17 * update a user's password
19 function tool_pref_update_user_password($userinfo, $password)
21 global $db;
23 if (!is_array($userinfo) && !isset($userinfo['user_id'])) return false;
24 if ($password == '') return false;
26 $encoded_password = md5(trim($password));
28 $sql = "UPDATE ". NELDB_USER_TABLE ." SET user_password='". $encoded_password ."' WHERE user_id=". $userinfo['user_id'];
29 $db->sql_query($sql);
31 return true;
34 function tool_pref_update_menu_style($userinfo, $menu)
36 global $db;
38 $sql = "UPDATE ". NELDB_USER_TABLE ." SET user_menu_style=". $menu ." WHERE user_id=". $userinfo['user_id'];
39 $db->sql_query($sql);
42 function tool_pref_update_default_application($userinfo, $application_id)
44 global $db;
46 $sql = "UPDATE ". NELDB_USER_TABLE ." SET user_default_application_id=". $application_id ." WHERE user_id=". $userinfo['user_id'];
47 $db->sql_query($sql);