/** * Init the plugin * @access private */ function squirrelmail_plugin_init_administrator() { global $squirrelmail_plugin_hooks, $username; if (adm_check_user()) { $squirrelmail_plugin_hooks['optpage_register_block']['administrator'] = 'squirrelmail_administrator_optpage_register_block'; } }
/** * Register option block * @access private */ function squirrelmail_administrator_optpage_register_block() { /** add authentication functions */ include_once SM_PATH . 'plugins/administrator/auth.php'; if (adm_check_user()) { global $optpage_blocks; $optpage_blocks[] = array('name' => _("Administration"), 'url' => SM_PATH . 'plugins/administrator/options.php', 'desc' => _("This module allows administrators to manage SquirrelMail main configuration remotely."), 'js' => false); } }
// Last, if it's a relative path without a .. prefix, // we're somewhere within the config dir, so prepend // SM_PATH . 'config/ $new_path = "SM_PATH . 'config/" . $old_path . "'"; } return $new_path; } /* ---------------------- main -------------------------- */ /** @ignore */ define('SM_PATH', '../../'); /* SquirrelMail required files. */ require_once SM_PATH . 'include/validate.php'; require_once SM_PATH . 'plugins/administrator/defines.php'; require_once SM_PATH . 'plugins/administrator/auth.php'; global $data_dir, $username; if (!adm_check_user()) { header('Location: ' . SM_PATH . 'src/options.php'); exit; } displayPageHeader($color, 'None'); $newcfg = array(); foreach ($defcfg as $key => $def) { $newcfg[$key] = ''; } $cfgfile = SM_PATH . 'config/config.php'; parseConfig(SM_PATH . 'config/config_default.php'); parseConfig($cfgfile); $colapse = array('Titles' => 'off', 'Group1' => getPref($data_dir, $username, 'adm_Group1', 'off'), 'Group2' => getPref($data_dir, $username, 'adm_Group2', 'on'), 'Group3' => getPref($data_dir, $username, 'adm_Group3', 'on'), 'Group4' => getPref($data_dir, $username, 'adm_Group4', 'on'), 'Group5' => getPref($data_dir, $username, 'adm_Group5', 'on'), 'Group6' => getPref($data_dir, $username, 'adm_Group6', 'on'), 'Group7' => getPref($data_dir, $username, 'adm_Group7', 'on'), 'Group8' => getPref($data_dir, $username, 'adm_Group8', 'on'), 'Group9' => getPref($data_dir, $username, 'adm_Group9', 'on'), 'Group10' => getPref($data_dir, $username, 'adm_Group10', 'on')); /* look in $_GET array for 'switch' */ if (sqgetGlobalVar('switch', $switch, SQ_GET)) { if ($colapse[$switch] == 'on') {