2
You can edit system/class/cpanel.php and change the constructor into:
/**
* Constructer
*
*/
function __construct()
{
global $xoopsUser;
if ($xoopsUser->getVar('uid') == 1) {
$cpanel = 'oxygen';
} else {
$cpanel = 'default';
}
$this->loadGui($cpanel);
}
User 1 will have oxygen and all others will have default cpanel.
Regarding permissions, you can edit file include/cp_header.php and create a page blacklist so the user gets a redirect message if he is trying to reach one of them.
Here is one example(not hacker proof, use of reg expressions would be better):
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit authors.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* XOOPS Admin Functions
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
* @package kernel
* @subpackage XOOPS CP Functions
* @since 2.0.0
* @version $Id: cp_header.php 3541 2009-08-31 23:02:37Z trabis $
*/
/**
* module files can include this file for admin authorization
* the file that will include this file must be located under xoops_url/modules/module_directory_name/admin_directory_name/
*/
$xoopsOption['pagetype'] = 'admin';
include_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'mainfile.php';
include_once $GLOBALS['xoops']->path('include/cp_functions.php');
$moduleperm_handler =& xoops_gethandler('groupperm');
if ($xoopsUser) {
$url_arr = explode('/', strstr($_SERVER['REQUEST_URI'], '/modules/'));
$module_handler =& xoops_gethandler('module');
$xoopsModule =& $module_handler->getByDirname($url_arr[2]);
unset($url_arr);
if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
redirect_header(XOOPS_URL, 1, _NOPERM);
exit();
}
} else {
redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
exit();
}
//START OF HACK
$denny = array (
'/xoops_2.4.0/modules/news/admin/index.php?op=export',
'/xoops_2.4.0/modules/news/admin/index.php?op=configurenewsletter'
);
if ($xoopsUser->getVar('uid') != 1 && in_array($_SERVER['REQUEST_URI'], $denny)) {
redirect_header(XOOPS_URL . '/admin.php', 1, _NOPERM);
exit();
}
//END OF HACK
// set config values for this module
if ($xoopsModule->getVar('hasconfig') == 1 || $xoopsModule->getVar('hascomments') == 1) {
$config_handler =& xoops_gethandler('config');
$xoopsModuleConfig = $config_handler->getConfigsByCat(0, $xoopsModule->getVar('mid'));
}
// include the default language file for the admin interface
if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/admin.php'))) {
include_once $file;
} else if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname') . '/language/english/admin.php'))) {
include_once $file;
}
// I will disable this because module developer should nod be forced to have a admin.php
// xoops_loadLanguage('admin', $xoopsModule->getVar('dirname'));
?>