Minahito
minah****@users*****
2005年 12月 25日 (日) 19:54:27 JST
Index: xoops2jp/html/modules/user/admin/actions/UserGroupPermAction.class.php diff -u xoops2jp/html/modules/user/admin/actions/UserGroupPermAction.class.php:1.1.2.4 xoops2jp/html/modules/user/admin/actions/UserGroupPermAction.class.php:1.1.2.5 --- xoops2jp/html/modules/user/admin/actions/UserGroupPermAction.class.php:1.1.2.4 Sun Dec 25 00:03:10 2005 +++ xoops2jp/html/modules/user/admin/actions/UserGroupPermAction.class.php Sun Dec 25 19:54:27 2005 @@ -1,100 +1,13 @@ <?php -require_once XOOPS_ROOT_PATH."/class/XCube_PageNavigator.class.php"; -require_once XOOPS_MODULE_PATH."/user/admin/class/Permission.class.php"; +require_once XOOPS_MODULE_PATH."/user/admin/actions/UserGroupPropertyAction.class.php"; /** * * This function keeps difficult problems that this depens on the column's block of X2 theme format. */ -class UserGroupPermAction extends UserAction +class UserGroupPermAction extends UserGroupPropertyAction { - var $mGroup; - var $mPermissions; - var $mSystemPermissions; - var $mBlockPermissions; - - function isSecure() - { - return true; - } - - function getDefaultView(&$controller, &$xoopsUser) - { - $this->_loadGroup(); - - if (!is_object($this->mGroup)) { - return USER_FRAME_VIEW_ERROR; - } - - $gpermHandler =& xoops_gethandler('groupperm'); - $criteria =& new CriteriaCompo(); - $criteria->add(new Criteria('gperm_groupid', $this->mGroup->getVar('groupid'))); - $criteria->add(new Criteria('gperm_modid', 1)); -// $this->mPermissions =& $gpermHandler->getObjects($criteria); - - $root =& XCube_Root::getSingleton(); - $root->mLanguageManager->loadModuleAdminLanguage("system"); - $root->mLanguageManager->loadManifestoLanguage("system"); - - // - // Get... - // - require_once XOOPS_ROOT_PATH . "/modules/system/constants.php"; - $fileHandler = opendir(XOOPS_ROOT_PATH . "/modules/system/admin"); - while ($file = readdir($fileHandler)) { - $infoFile = XOOPS_ROOT_PATH . "/modules/system/admin/" . $file . "/xoops_version.php"; - if (file_exists($infoFile)) { - require_once $infoFile; - if (!empty($modversion['category'])) { - $item =& new User_PermissionSystemAdminItem($modversion['category'], $modversion['name']); - $this->mSystemPermissions[] =& new User_Permission($this->mGroup->getVar('groupid'), $item); - - unset($item); - } - unset($modversion); - } - } - - // - // Get module list - // - $moduleHandler =& xoops_gethandler('module'); - $modules =& $moduleHandler->getObjects(); - - foreach ($modules as $module) { - $item =& new User_PermissionModuleItem($module); - $this->mPermissions[] =& new User_Permission($this->mGroup->getVar('groupid'), $item); - - unset($module); - unset($item); - } - - // - // Get block list - // - require_once XOOPS_ROOT_PATH.'/class/xoopsblock.php'; - - $blockHandler = new XoopsBlock(); - - $idx = 0; - foreach (array(0, 1, 3, 4, 5) as $side) { - $this->mBlockPermissions[$idx] = array(); - $blocks =& $blockHandler->getAllBlocks("object", $side, null); - - foreach ($blocks as $block) { - $item =& new User_PermissionBlockItem($block); - $this->mBlockPermissions[$idx][] =& new User_Permission($this->mGroup->getVar('groupid'), $item); - - unset($block); - } - - $idx++; - } - - return USER_FRAME_VIEW_INDEX; - } - /** * This function don't use actionform, now. * I (minahito) must remove code-clone. @@ -183,14 +96,6 @@ return USER_FRAME_VIEW_SUCCESS; } - function _loadGroup() - { - $groupId = isset($_REQUEST['groupid']) ? intval($_REQUEST['groupid']) : 0; - - $groupHandler =& xoops_gethandler('group'); - $this->mGroup =& $groupHandler->get($groupId); - } - function executeViewIndex(&$controller,&$xoopsUser,&$render) { $render->setTemplateName("group_perm.html");