Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1.         function changePassword($newPassword) {
  2.             $db = Loader::db();
  3.             if ($this->uID) {
  4.                 $v = array(User::encryptPassword($newPassword), $this->uID);
  5.                 $q = "update Users set uPassword = ? where uID = ?";
  6.                 $r = $db->prepare($q);
  7.                 $res = $db->execute($r, $v);
  8.                 Events::fire('on_user_change_password', $this, $newPassword);
  9.                 return $res;
  10.             }
  11.         }
  12.         public function encryptPassword($uPassword, $salt = PASSWORD_SALT) {
  13.             return md5($uPassword . ':' . $salt);
  14.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement