diff --git a/admin.php b/admin.php index 0734a451..5e279bbd 100644 --- a/admin.php +++ b/admin.php @@ -73,11 +73,9 @@ class AdminPlugin extends Plugin 'onShutdown' => ['onShutdown', 1000], 'onFormProcessed' => ['onFormProcessed', 0] ]; - } else { - return [ - 'onFormProcessed' => ['onFormProcessed', 0] - ]; } + + return []; } /** @@ -105,6 +103,7 @@ class AdminPlugin extends Plugin // If no users found, go to register if (!count($user_check) > 0) { if (!$this->isAdminPath()) { + $this->grav->redirect($this->base); } @@ -115,8 +114,6 @@ class AdminPlugin extends Plugin } } - - // Only activate admin if we're inside the admin path. if ($this->isAdminPath()) { $this->active = true;