Fix a bug preventing password change for local users

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2018-05-10 09:26:38 +02:00
parent fb6675eb73
commit d975966a7a

View File

@ -557,7 +557,7 @@ class ModelUserAuth extends Model {
public function change_password($username = '', $password = '') {
if($username == "" || $password == ""){ return 0; }
$query = $this->db->query("UPDATE " . TABLE_USER . " SET password=? WHERE username=?", array(crypt($password), $username));
$query = $this->db->query("UPDATE " . TABLE_USER . " SET password=? WHERE uid=(SELECT uid FROM " . TABLE_EMAIL . " WHERE email=?)", array(crypt($password), $username));
$rc = $this->db->countAffected();