3 function set_password() {
4 global $db,$error,$error_messages;
5 $old_password=$_POST['old_password'];
6 $new_password1=$_POST['new_password1'];
7 $new_password2=$_POST['new_password2'];
9 if ($new_password1!=$new_password2) {
10 $error=$error_messages['NEW_PASSWORD_MISMATCH'];
13 $user_id=$_SESSION['user_id'];
14 $login=$_SESSION['user_name'];
21 $q="select * from users where login='$login'";
24 if ($set->getString('password')!=md5($old_password)) {
25 $error="bad password";
31 $password=md5($new_password1);
32 $db->query("update users set password='$password' where user_id='$user_id'");