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:
Parziphal 2014-01-25 00:17:21 -05:00
parent 30f9b207fd
commit afad5bc175

View File

@ -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 {