From 08fe86dc99f49c2e57737ce080234b7c2644c439 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 26 Jun 2016 18:03:25 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E3=83=91=E3=83=BC=E3=83=9F=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AE?= =?UTF-8?q?=E6=99=82=E3=81=A7=E3=80=81=E3=82=BB=E3=83=83=E3=82=B7=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=81=8C=E5=88=87=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B?= =?UTF-8?q?=E3=81=A8=E3=81=8D=E3=80=81=E3=83=AD=E3=82=B0=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E7=94=BB=E9=9D=A2=E3=81=AB=E9=81=B7=E7=A7=BB=E3=81=95=E3=81=9B?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/Component/PermissionComponent.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Controller/Component/PermissionComponent.php b/Controller/Component/PermissionComponent.php index cf11576e..6048503a 100644 --- a/Controller/Component/PermissionComponent.php +++ b/Controller/Component/PermissionComponent.php @@ -189,7 +189,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()); + } } /** From 732392d661f6ef284741384f729fc873720e6b6b Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 26 Jun 2016 18:54:36 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Install=E3=83=97=E3=83=A9=E3=82=B0=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=81=A7Permission=E3=82=B3=E3=83=B3=E3=83=9D?= =?UTF-8?q?=E3=83=BC=E3=83=8D=E3=83=B3=E3=83=88=E3=82=92=E9=99=A4=E5=A4=96?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=81=9F=E3=82=81=E3=80=81=E5=87=A6=E7=90=86=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/Component/PermissionComponent.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Controller/Component/PermissionComponent.php b/Controller/Component/PermissionComponent.php index 6048503a..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'])) {