Minahito
minah****@users*****
2006年 2月 3日 (金) 15:04:51 JST
Index: xoops2jp/html/modules/base/admin/actions/HelpAction.class.php diff -u xoops2jp/html/modules/base/admin/actions/HelpAction.class.php:1.1.2.1 xoops2jp/html/modules/base/admin/actions/HelpAction.class.php:1.1.2.2 --- xoops2jp/html/modules/base/admin/actions/HelpAction.class.php:1.1.2.1 Thu Jan 26 01:18:51 2006 +++ xoops2jp/html/modules/base/admin/actions/HelpAction.class.php Fri Feb 3 15:04:51 2006 @@ -1,6 +1,6 @@ <?php /** - * @version $Id: HelpAction.class.php,v 1.1.2.1 2006/01/25 16:18:51 minahito Exp $ + * @version $Id: HelpAction.class.php,v 1.1.2.2 2006/02/03 06:04:51 minahito Exp $ */ /** @@ -66,42 +66,47 @@ var $mErrorMessage = null; + /** + * @access private + */ + var $_mDirname = null; + + function isPerm(&$controller, &$xoopsUser) + { + $this->_mDirname = xoops_getrequest('dirname'); + + $moduleHandler =& xoops_gethandler('module'); + $permHandler =& xoops_gethandler('groupperm'); + + $module =& $moduleHandler->getByDirname($this->_mDirname); + + return $permHandler->checkRight('module_admin', $module->get('mid'), $xoopsUser->getGroups()); + } + function getDefaultView(&$controller, &$xoopsUser) { - // - // TODO We must change the following lines to ActionForm. - // - $dirname = $_GET['dirname']; - if (!preg_match("/^[a-z\_]+$/i", $dirname)) { - return LEGACY_FRAME_VIEW_ERROR; - } - - if (!is_dir(XOOPS_MODULE_PATH . "/" . $dirname)) { - return LEGACY_FRAME_VIEW_ERROR; - } - $moduleHandler =& xoops_gethandler('module'); - $this->mModuleObject =& $moduleHandler->getByDirname($dirname); + $this->mModuleObject =& $moduleHandler->getByDirname($this->_mDirname); $language =& $controller->getConfig('language'); // // TODO We must change the following lines to ActionForm. // - $helpfile = isset($_GET['file']) ? $_GET['file'] : $this->mModuleObject->getHelp(); + $helpfile = xoops_getrequest('file') ? xoops_getrequest('file') : $this->mModuleObject->getHelp(); // // Smarty // $smarty =& new Legacy_HelpSmarty(); - $smarty->setDirname($dirname); + $smarty->setDirname($this->_mDirname); // // file check // - $template_dir = XOOPS_MODULE_PATH . "/" . $dirname . "/language/" . $language; + $template_dir = XOOPS_MODULE_PATH . "/" . $this->_mDirname . "/language/" . $language; if (!file_exists($template_dir . "/" . $helpfile)) { - $template_dir = XOOPS_MODULE_PATH . "/" . $dirname . "/language/english"; + $template_dir = XOOPS_MODULE_PATH . "/" . $this->_mDirname . "/language/english"; if (!file_exists($template_dir . "/" . $helpfile)) { $this->mErrorMessage = _MD_A_BASE_ERROR_NO_HELP_FILE; return LEGACY_FRAME_VIEW_ERROR;