Fixed error on block action.
Trying to block a mod or admin would redirect to action with no specific id, generating an error.
This commit is contained in:
parent
30f9b207fd
commit
afad5bc175
@ -337,12 +337,13 @@ class UserController extends ApplicationController
|
||||
if ($this->request()->isPost()) {
|
||||
if ($this->user->is_mod_or_higher()) {
|
||||
$this->notice("You can not ban other moderators or administrators");
|
||||
$this->redirectTo('#block');
|
||||
$this->redirectTo(['#block', 'id' => $this->params()->id]);
|
||||
return;
|
||||
}
|
||||
!is_array($this->params()->ban) && $this->params()->ban = [];
|
||||
|
||||
$attrs = array_merge($this->params()->ban, ['banned_by' => current_user()->id, 'user_id' => $this->params()->id]);
|
||||
|
||||
Ban::create($attrs);
|
||||
$this->redirectTo('#show_blocked_users');
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user