mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-18 11:58:24 +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
ee41d4a09d
commit
5eea435035
@ -61,7 +61,7 @@ class auth_fallback implements auth_backend
|
|||||||
$GLOBALS['egw_info']['flags']['currentapp'] = 'admin'; // otherwise
|
$GLOBALS['egw_info']['flags']['currentapp'] = 'admin'; // otherwise
|
||||||
$ret = $this->fallback_backend->change_password('', $passwd, $account_id);
|
$ret = $this->fallback_backend->change_password('', $passwd, $account_id);
|
||||||
$GLOBALS['egw_info']['flags']['currentapp'] = $backup_currentapp;
|
$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;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -214,7 +214,6 @@ class auth_sql implements auth_backend
|
|||||||
if (($pw = $this->db->select($this->table,'account_pwd',array(
|
if (($pw = $this->db->select($this->table,'account_pwd',array(
|
||||||
'account_id' => $account_id,
|
'account_id' => $account_id,
|
||||||
'account_type' => 'u',
|
'account_type' => 'u',
|
||||||
'account_status' => 'A',
|
|
||||||
),__LINE__,__FILE__)->fetchColumn()) === false)
|
),__LINE__,__FILE__)->fetchColumn()) === false)
|
||||||
{
|
{
|
||||||
return false; // account not found
|
return false; // account not found
|
||||||
@ -244,16 +243,17 @@ class auth_sql implements auth_backend
|
|||||||
$update = array('account_pwd' => $encrypted_passwd);
|
$update = array('account_pwd' => $encrypted_passwd);
|
||||||
if ($update_lastpw_change) $update['account_lastpwd_change'] = time();
|
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,
|
'account_id' => $account_id,
|
||||||
),__LINE__,__FILE__);
|
),__LINE__,__FILE__))
|
||||||
|
{
|
||||||
if(!$this->db->affected_rows()) return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(!$admin)
|
if(!$admin)
|
||||||
{
|
{
|
||||||
egw_cache::setSession('phpgwapi','auth_alpwchange_val',$update['account_lastpwd_change']);
|
egw_cache::setSession('phpgwapi','auth_alpwchange_val',$update['account_lastpwd_change']);
|
||||||
}
|
}
|
||||||
return $encrypted_passwd;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user