Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Controller/PagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @copyright Copyright 2014, NetCommons Project
* @author Kohei Teraguchi <kteraguchi@commonsnet.org>
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @author Wataru Nishimoto <watura@willbooster.com>
* @author Kazunori Sakamoto <exkazuu@willbooster.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
*/
Expand All @@ -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 <kteraguchi@commonsnet.org>
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @author Wataru Nishimoto <watura@willbooster.com>
* @author Kazunori Sakamoto <exkazuu@willbooster.com>
* @package NetCommons\Pages\Controller
*/
class PagesController extends PagesAppController {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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('/');
}

}
5 changes: 4 additions & 1 deletion View/Layouts/default.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @author Noriko Arai <arai@nii.ac.jp>
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @author Kazunori Sakamoto <exkazuu@willbooster.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @copyright Copyright 2014, NetCommons Project
Expand Down Expand Up @@ -48,7 +49,9 @@ if (AuthComponent::user()) {

<?php echo $this->element('NetCommons.common_header'); ?>

<main id="nc-container" class="<?php echo $pageContainerCss; ?>" ng-init="hashChange()">
<main id="nc-container" class="<?php echo $pageContainerCss; ?>" ng-init="hashChange();
<?php echo $this->CDNCache->isCacheable() ? 'updateTokens();' : ''; ?> updateLikes();">

<?php echo $pageHeader; ?>

<div class="row">
Expand Down