Store proper account ID if called with account_lid, prevents displaying as "Change password for 0 (Current user)"

This commit is contained in:
nathangray 2019-03-20 15:36:20 -06:00
parent 0aedde6b64
commit de54fdb084

View File

@ -46,7 +46,7 @@ class admin_cmd_change_pw extends admin_cmd
*/
protected function exec($check_only=false)
{
$account_id = admin_cmd::parse_account($this->account,true); // true = user, no group
$this->account = admin_cmd::parse_account($this->account,true); // true = user, no group
// check creator is still admin and not explicitly forbidden to edit Api\Accounts
if ($this->creator) $this->_check_admin('account_access',16);
@ -54,7 +54,7 @@ class admin_cmd_change_pw extends admin_cmd
$auth = new Api\Auth;
if (!$auth->change_password(null, $this->password, $account_id))
if (!$auth->change_password(null, $this->password, $this->account))
{
// as long as the Api\Auth class is not throwing itself ...
throw new Exception(lang('Error changing the password for %1 !!!',$this->account),99);