From afad5bc17502b2a5cf59821d0cd5b4b14e48511e Mon Sep 17 00:00:00 2001 From: Parziphal Date: Sat, 25 Jan 2014 00:17:21 -0500 Subject: [PATCH] Fixed error on block action. Trying to block a mod or admin would redirect to action with no specific id, generating an error. --- app/controllers/UserController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/UserController.php b/app/controllers/UserController.php index b3a7f29..41fdc66 100755 --- a/app/controllers/UserController.php +++ b/app/controllers/UserController.php @@ -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 {