diff --git a/Controller/Component/PermissionComponent.php b/Controller/Component/PermissionComponent.php index 0047728c..02cf0ee0 100644 --- a/Controller/Component/PermissionComponent.php +++ b/Controller/Component/PermissionComponent.php @@ -186,7 +186,7 @@ public function startup(Controller $controller) { } //if ($controller->Auth->user('id')) { - throw new ForbiddenException(__d('net_commons', 'Permission denied')); + throw new ForbiddenException('Permission denied'); //} else { // return $controller->redirect($controller->Auth->redirect()); //} diff --git a/Error/NetCommonsExceptionRenderer.php b/Error/NetCommonsExceptionRenderer.php index 27dd111f..24431faa 100644 --- a/Error/NetCommonsExceptionRenderer.php +++ b/Error/NetCommonsExceptionRenderer.php @@ -69,8 +69,9 @@ public function error400($error) { if ($message === 'The request has been black-holed') { $message = __d('net_commons', 'The request has been black-holed'); $redirect = $this->controller->request->referer(true); - } elseif (get_class($error) === 'ForbiddenException' && - ! in_array($this->controller->request->params['action'], ['download'], true)) { + } elseif ($message === 'Permission denied' || + in_array($this->controller->params['action'], ['index', 'view'])) { + $message = __d('net_commons', 'Permission denied'); $redirect = Router::url('/auth/login'); $this->controller->Session->destroy(); if (! $this->controller->request->is('ajax')) { diff --git a/Locale/jpn/LC_MESSAGES/net_commons.po b/Locale/jpn/LC_MESSAGES/net_commons.po index ae1aae27..6a1c9774 100644 --- a/Locale/jpn/LC_MESSAGES/net_commons.po +++ b/Locale/jpn/LC_MESSAGES/net_commons.po @@ -359,7 +359,7 @@ msgstr "削除" #: AccessCounters/View/AccessCounterBlocks/index.ctp:43 msgid "Created datetime" -msgstr "作成日時" +msgstr "作成日" msgid "Created user" msgstr "作成者" @@ -375,7 +375,7 @@ msgid "Updated date" msgstr "更新日" msgid "Modified datetime" -msgstr "更新日時" +msgstr "更新日" msgid "Modified user" msgstr "更新者" @@ -585,7 +585,7 @@ msgstr "承認する" #: Comments/View/Elements/form.ctp:19;27 msgid "Comments to the person in charge." -msgstr "担当者へのコメント" +msgstr "担当者への連絡" #