function adminMenu() { requireAdmin(); global $CFG; headContent(); echo '<div id="header" style="background: yellow;">'; echo '<h1>Admin Functions</h1>'; echo "<ul>\n"; echo '<li><a href="' . $CFG->wwwroot . '/users/index.php">Users</a><li>'; echo '<li><a href="' . $CFG->wwwroot . '/courses/index.php">Courses</a></li>'; echo '<li><a href="' . $CFG->wwwroot . '/courses.php">Non-Admin</a></li>'; echo "</ul></div>\n"; }
function requireLogin() { if (isLoginPage()) { return false; } $bUser = isset($_SESSION['user']); $bAdmin = $bUser ? $_SESSION['admin'] : false; foreach ($GLOBALS['aAdminDirs'] as $v) { if (strpos($_SERVER['SCRIPT_FILENAME'], $v) > 0) { requireAdmin(); } } foreach ($GLOBALS['aUserDirs'] as $v) { if (strpos($_SERVER['SCRIPT_FILENAME'], $v) > 0) { requireUser(); } } return false; }
<?php define('ROOT', '../../..'); include ROOT . '/lib/includeForAdmin.php'; requireAdmin(); include ROOT. '/lib/piece/adminHeader.php'; $config = new Settings; $logoFile = $config->logo; $logoPath = $service['path'].'/cache/logo/'.$logoFile; $logoAlt = _t('로고 이미지'); if (empty($logoFile) || !file_exists(ROOT . '/cache/logo/'.$logoFile)) { $logoPath = $service['path'].'/images/noimage.jpg'; $logoAlt = _t('로고 이미지가 설정되지 않았습니다'); } $useLogo = false; // 현재 사용중인 스킨 $n_skinname = Settings::get('metaskin'); $n_skinpath = ROOT . '/skin/meta/'.$n_skinname; if(file_exists($n_skinpath.'/skin.html')) { $n_skinhtml = file_get_contents($n_skinpath.'/skin.html'); if(empty($n_skinhtml)) { if(strpos('[##_logo_url_##]', $n_skinhtml) !== false) {
private function install() { requireAdmin($this->player); $table_prefix = DB_PREFIX; $create_table = <<<SQL CREATE TABLE IF NOT EXISTS `<ezrpg>mail` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `to` VARCHAR( 50 ) NOT NULL , `from` VARCHAR( 50 ) NOT NULL , `subject` VARCHAR( 45 ) NOT NULL , `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , `isread` INT( 1 ) NOT NULL , `message` VARCHAR( 5000 ) NOT NULL ) ENGINE = InnoDB; SQL; $this->db->execute($create_table); $msg = 'You have installed MailBox by JesterC.'; header('Location: index.php?mod=MailBox&msg=' . urlencode($msg)); exit; }
private function uninstall() { requireAdmin($this->player); $this->db->execute('DROP TABLE IF EXISTS `<ezrpg>mines`'); $msg = 'You have uninstalled Mines.'; header('Location: index.php?msg=' . urlencode($msg)); exit; }