mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
fixed auth_sql to allow updating passwords of in-active accounts and return true for all successfull password changes as documented (returned false if password was unchanged and hash password on success)
This commit is contained in:
parent
eadc4edf2e
commit
76abb48fa4
@ -61,7 +61,7 @@ class auth_fallback implements auth_backend
|
||||
$GLOBALS['egw_info']['flags']['currentapp'] = 'admin'; // otherwise
|
||||
$ret = $this->fallback_backend->change_password('', $passwd, $account_id);
|
||||
$GLOBALS['egw_info']['flags']['currentapp'] = $backup_currentapp;
|
||||
error_log(__METHOD__."('$username', \$passwd) updated password for #$account_id on fallback ".($ret ? 'successfull' : 'failed!'));
|
||||
//error_log(__METHOD__."('$username', \$passwd) updated password for #$account_id on fallback ".($ret ? 'successfull' : 'failed!'));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -214,7 +214,6 @@ class auth_sql implements auth_backend
|
||||
if (($pw = $this->db->select($this->table,'account_pwd',array(
|
||||
'account_id' => $account_id,
|
||||
'account_type' => 'u',
|
||||
'account_status' => 'A',
|
||||
),__LINE__,__FILE__)->fetchColumn()) === false)
|
||||
{
|
||||
return false; // account not found
|
||||
@ -244,16 +243,17 @@ class auth_sql implements auth_backend
|
||||
$update = array('account_pwd' => $encrypted_passwd);
|
||||
if ($update_lastpw_change) $update['account_lastpwd_change'] = time();
|
||||
|
||||
$this->db->update($this->table,$update,array(
|
||||
if (!$this->db->update($this->table,$update,array(
|
||||
'account_id' => $account_id,
|
||||
),__LINE__,__FILE__);
|
||||
|
||||
if(!$this->db->affected_rows()) return false;
|
||||
),__LINE__,__FILE__))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!$admin)
|
||||
{
|
||||
egw_cache::setSession('phpgwapi','auth_alpwchange_val',$update['account_lastpwd_change']);
|
||||
}
|
||||
return $encrypted_passwd;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user