mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-20 23:19:38 +00:00
Standardised delete aesthetics regarding roles and users
Also added user delete success message. Fixes #114
This commit is contained in:
parent
49621e7b15
commit
23ab1f0c81
3 changed files with 23 additions and 18 deletions
app/Http/Controllers
|
@ -200,11 +200,14 @@ class UserController extends Controller
|
|||
});
|
||||
|
||||
$user = $this->userRepo->getById($id);
|
||||
|
||||
if ($this->userRepo->isOnlyAdmin($user)) {
|
||||
session()->flash('error', 'You cannot delete the only admin');
|
||||
return redirect($user->getEditUrl());
|
||||
}
|
||||
|
||||
$this->userRepo->destroy($user);
|
||||
session()->flash('success', 'User successfully removed');
|
||||
|
||||
return redirect('/settings/users');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue