mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 20:40:13 +01:00
Added salt to crypt()
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
eae385616f
commit
6eaa70d991
@ -576,7 +576,8 @@ class ModelUserAuth extends Model {
|
|||||||
public function change_password($username = '', $password = '') {
|
public function change_password($username = '', $password = '') {
|
||||||
if($username == "" || $password == ""){ return 0; }
|
if($username == "" || $password == ""){ return 0; }
|
||||||
|
|
||||||
$query = $this->db->query("UPDATE " . TABLE_USER . " SET password=? WHERE uid=(SELECT uid FROM " . TABLE_EMAIL . " WHERE email=?)", 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, '$6$' . generate_random_string()), $username));
|
||||||
|
|
||||||
$rc = $this->db->countAffected();
|
$rc = $this->db->countAffected();
|
||||||
|
|
||||||
|
@ -350,7 +350,7 @@ class ModelUserUser extends Model {
|
|||||||
return $user['username'];
|
return $user['username'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$encrypted_password = crypt($user['password']);
|
$encrypted_password = crypt($user['password'], '$6$' . generate_random_string());
|
||||||
|
|
||||||
$samaccountname = '';
|
$samaccountname = '';
|
||||||
if(isset($user['samaccountname'])) { $samaccountname = $user['samaccountname']; }
|
if(isset($user['samaccountname'])) { $samaccountname = $user['samaccountname']; }
|
||||||
|
Loading…
Reference in New Issue
Block a user