mirror of
https://github.com/getformwork/formwork.git
synced 2025-02-24 01:32:25 +01:00
Fix missing error notification when editing users is forbidden
This commit is contained in:
parent
180b16f86d
commit
22de37dfb1
@ -197,6 +197,7 @@ users.user.cannot-change-role: Cannot change the role of %s. The action is not a
|
||||
users.user.cannot-create.already-exists: Cannot create user, a user with the same name already exists
|
||||
users.user.cannot-create.var-missing: Cannot create user, missing %s variable
|
||||
users.user.cannot-delete: Cannot delete user. You must be an administrator and the user must not be logged in.
|
||||
users.user.cannot-edit: Cannot edit user %s. The action is not allowed.
|
||||
users.user.created: User created
|
||||
users.user.deleted: User deleted
|
||||
users.user.edited: User data updated
|
||||
|
@ -198,6 +198,7 @@ users.user.cannot-change-role: Impossible cambare il ruolo di %s. L’azione non
|
||||
users.user.cannot-create.already-exists: Impossibile creare l’utente, un utente con lo stesso nome esiste già
|
||||
users.user.cannot-create.var-missing: Impossibile creare l’utente, manca la variabile %s
|
||||
users.user.cannot-delete: Impossibile eliminare l’utente. Devi essere un amministratore e l’utente non deve essere connesso.
|
||||
users.user.cannot-edit: Impossibile modificare l’utente %s. L’azione non è consentita.
|
||||
users.user.created: Utente creato
|
||||
users.user.deleted: Utente eliminato
|
||||
users.user.edited: Dati utente aggiornati
|
||||
|
@ -112,13 +112,12 @@ class Users extends AbstractController
|
||||
}
|
||||
|
||||
if (HTTPRequest::method() === 'POST') {
|
||||
if (!$this->user()->canChangeOptionsOf($user)) {
|
||||
$this->redirect('/users/' . $user->username() . '/profile/', 302, true);
|
||||
if ($this->user()->canChangeOptionsOf($user)) {
|
||||
$this->updateUser($user);
|
||||
$this->notify($this->label('users.user.edited'), 'success');
|
||||
} else {
|
||||
$this->notify($this->label('users.user.cannot-edit', $user->username()), 'error');
|
||||
}
|
||||
|
||||
$this->updateUser($user);
|
||||
|
||||
$this->notify($this->label('users.user.edited'), 'success');
|
||||
$this->redirect('/users/' . $user->username() . '/profile/', 302, true);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user