0
0
Fork 0
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 
This commit is contained in:
Dan Brown 2016-05-22 09:23:41 +01:00
parent 49621e7b15
commit 23ab1f0c81
3 changed files with 23 additions and 18 deletions
app/Http/Controllers

View file

@ -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');
}