diff --git a/Controller/Component/PermissionComponent.php b/Controller/Component/PermissionComponent.php index cf11576e..27be9459 100644 --- a/Controller/Component/PermissionComponent.php +++ b/Controller/Component/PermissionComponent.php @@ -164,10 +164,6 @@ public function initialize(Controller $controller) { * @throws ForbiddenException */ public function startup(Controller $controller) { - if (! Configure::read('NetCommons.installed')) { - return; - } - switch ($this->type) { case self::CHECK_TYEP_SYSTEM_PLUGIN: if (Current::allowSystemPlugin($controller->params['plugin'])) { @@ -189,7 +185,11 @@ public function startup(Controller $controller) { return; } - throw new ForbiddenException(__d('net_commons', 'Permission denied')); + if ($controller->Auth->user('id')) { + throw new ForbiddenException(__d('net_commons', 'Permission denied')); + } else { + return $controller->redirect($controller->Auth->redirect()); + } } /**