diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6da4321..22b9bf5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,7 +37,7 @@ jobs: NC3_BUILD_DIR: "/opt/nc3" NC3_DOCKER_DIR: "/opt/docker" NC3_GIT_URL: "git://github.com/NetCommons3/NetCommons3.git" - NC3_GIT_BRANCH: "master" + NC3_GIT_BRANCH: "availability" PLUGIN_BUILD_DIR: ${{ github.workspace }} PHP_VERSION: ${{ matrix.php }} MYSQL_VERSION: ${{ matrix.mysql }} diff --git a/Controller/PagesController.php b/Controller/PagesController.php index 8be6ac3..ce069b8 100644 --- a/Controller/PagesController.php +++ b/Controller/PagesController.php @@ -5,6 +5,8 @@ * @copyright Copyright 2014, NetCommons Project * @author Kohei Teraguchi * @author Shohei Nakajima + * @author Wataru Nishimoto + * @author Kazunori Sakamoto * @link http://www.netcommons.org NetCommons Project * @license http://www.netcommons.org/license.txt NetCommons License */ @@ -13,12 +15,15 @@ App::uses('Space', 'Rooms.Model'); App::uses('NetCommonsUrl', 'NetCommons.Utility'); App::uses('CurrentLibPage', 'NetCommons.Lib/Current'); +App::uses('NetCommonsCDNCache', 'NetCommons.Utility'); /** * ページ表示 Controller * * @author Kohei Teraguchi * @author Shohei Nakajima + * @author Wataru Nishimoto + * @author Kazunori Sakamoto * @package NetCommons\Pages\Controller */ class PagesController extends PagesAppController { @@ -52,6 +57,7 @@ class PagesController extends PagesAppController { * @return void */ public function beforeFilter() { + $this->Auth->allow('clear'); //CurrentPage::__getPageConditionsでページ表示として扱う if ($this->params['action'] === 'index') { $this->request->params['pageView'] = true; @@ -120,4 +126,15 @@ public function change_setting_mode() { $this->redirect($redirectUrl); } +/** + * CDN Cache を削除する + * + * @return void + */ + public function clear() { + $cdnCache = new NetCommonsCDNCache(); + $cdnCache->invalidate(); + $this->redirect('/'); + } + } diff --git a/View/Layouts/default.ctp b/View/Layouts/default.ctp index 6c12c2e..cab4cb5 100644 --- a/View/Layouts/default.ctp +++ b/View/Layouts/default.ctp @@ -4,6 +4,7 @@ * * @author Noriko Arai * @author Shohei Nakajima + * @author Kazunori Sakamoto * @link http://www.netcommons.org NetCommons Project * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project @@ -48,7 +49,9 @@ if (AuthComponent::user()) { element('NetCommons.common_header'); ?> -
+
+