Admins can now change passwords

This commit is contained in:
Ismo Vuorinen
2013-07-17 14:39:33 +03:00
parent f0f1d71c48
commit 59ee192e1d
4 changed files with 67 additions and 0 deletions

View File

@@ -27,6 +27,16 @@ class User_model extends MY_Model
return $this->update($uid, $data);
}
public function savePassword($uid = null, $password = null)
{
if (empty($uid) || empty($password)) {
return false;
}
$password = $this->passwordhash($password);
return $this->update($uid, array('password' => $password));
}
public function passwordhash($password = null)
{
return hash(