Minahito
minah****@users*****
2006年 9月 24日 (日) 23:05:09 JST
Index: xoops2jp/html/modules/stdCache/preload/Initialize.class.php diff -u /dev/null xoops2jp/html/modules/stdCache/preload/Initialize.class.php:1.1.2.1 --- /dev/null Sun Sep 24 23:05:09 2006 +++ xoops2jp/html/modules/stdCache/preload/Initialize.class.php Sun Sep 24 23:05:09 2006 @@ -0,0 +1,44 @@ +<?php +/** + * @package stdCache + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +class StdCache_Initialize extends XCube_ActionFilter +{ + function preBlockFilter() + { + $this->mController->mCheckEnableBlockCache->add(array(&$this, 'checkForBlock'), XCUBE_DELEGATE_PRIORITY_FIRST + 10); + $this->mController->mCheckEnableModuleCache->add(array(&$this, 'checkForModule'), XCUBE_DELEGATE_PRIORITY_FIRST + 10); + } + + function checkForBlock(&$cacheInfo) + { + $user =& $this->mController->mXoopsUser; + if (is_object($user)) { + $cacheInfo->mGroupArr = $user->getGroups(); + $cacheInfo->setEnableCache(!in_array(XOOPS_GROUP_ADMIN, $user->getGroups())); + } + else { + $cacheInfo->mGroupArr = array(XOOPS_GROUP_ANONYMOUS); + $cacheInfo->setEnableCache(true); + } + } + + function checkForModule(&$cacheInfo) + { + $user =& $this->mController->mXoopsUser; + if (is_object($user)) { + $cacheInfo->mGroupArr = $user->getGroups(); + $cacheInfo->setEnableCache(!in_array(XOOPS_GROUP_ADMIN, $user->getGroups())); + } + else { + $cacheInfo->mGroupArr = array(XOOPS_GROUP_ANONYMOUS); + $cacheInfo->setEnableCache(true); + } + } +} + +?> \ No newline at end of file