14
I have a few questions to your header files.
xoops_header.php:
include_once '../../mainfile.php';
include_once 'xoops_version.php';
include_once XOOPS_ROOT_PATH . '/header.php';
Why do you include xoops_version.php? Anything you need in there?
xoops_admin_header.php:
include '../../../mainfile.php';
include XOOPS_ROOT_PATH.'/include/cp_header.php';
include 'xoops_version.php';
if ( !file_exists("../language/".$xoopsConfig['language']."/admin.php") ) {
include "../language/".$xoopsConfig['language']."/admin.php";
}
if (is_object($xoopsUser)) {
$xoopsModule = XoopsModule::getByDirname($modversion['dirname']);
if (!$xoopsUser->isAdmin($xoopsModule->mid())) {
redirect_header(XOOPS_URL . "/", 3, _NOPERM);
exit();
}
} else {
redirect_header(XOOPS_URL . "/", 1, _NOPERM);
exit();
}
xoops_cp_header();
Don't include both mainfile.php and include/cp_header.php - just cp_header.php. That will include mainfile.php.
It will also perform the permission check and include the admin language files, so all you really need is
include XOOPS_ROOT_PATH.'/include/cp_header.php';
xoops_cp_header();