fix to allow setting "anonymous" flag for other accounts and try to fix Chrome autocomplete

This commit is contained in:
Ralf Becker
2020-03-21 14:38:32 +01:00
parent e9c3533c93
commit f0f4fd2ee3
2 changed files with 5 additions and 5 deletions

View File

@@ -104,9 +104,9 @@ class admin_cmd_edit_user extends admin_cmd_change_pw
}
$data['changepassword'] = admin_cmd::parse_boolean($data['changepassword'],$this->account ? null : true);
$data['anonymous'] = admin_cmd::parse_boolean($data['anonymous'],$this->account ? null : false) ||
// automatic set anonymous flag for username "anonymous", to not allow to create anonymous user without it
($data['account_lid'] ?: admin_cmd::$accounts->id2name($this->account)) === 'anonymous';
// automatic set anonymous flag for username "anonymous", to not allow to create anonymous user without it
$data['anonymous'] = ($data['account_lid'] ?: admin_cmd::$accounts->id2name($this->account)) === 'anonymous' ?
true : admin_cmd::parse_boolean($data['anonymous'],$this->account ? null : false);
if ($data['mustchangepassword'] && $data['changepassword'])
{