mirror of
https://github.com/getformwork/formwork.git
synced 2025-02-24 09:42:43 +01:00
Fix field validation attempt on non existing user
This commit is contained in:
parent
91eb4a8ea5
commit
e7d649ea03
@ -100,16 +100,16 @@ class Users extends AbstractController
|
||||
|
||||
$user = Admin::instance()->users()->get($params->get('user'));
|
||||
|
||||
$fields->validate($user);
|
||||
|
||||
$fields->find('password')->set('disabled', !$this->user()->canChangePasswordOf($user));
|
||||
$fields->find('role')->set('disabled', !$this->user()->canChangeRoleOf($user));
|
||||
|
||||
if (is_null($user)) {
|
||||
$this->notify($this->label('users.user.not-found'), 'error');
|
||||
$this->redirect('/users/', 302, true);
|
||||
}
|
||||
|
||||
$fields->validate($user);
|
||||
|
||||
$fields->find('password')->set('disabled', !$this->user()->canChangePasswordOf($user));
|
||||
$fields->find('role')->set('disabled', !$this->user()->canChangeRoleOf($user));
|
||||
|
||||
if (HTTPRequest::method() === 'POST') {
|
||||
if ($this->user()->canChangeOptionsOf($user)) {
|
||||
$this->updateUser($user);
|
||||
|
Loading…
x
Reference in New Issue
Block a user