本文整理汇总了PHP中requireAdmin函数的典型用法代码示例。如果您正苦于以下问题:PHP requireAdmin函数的具体用法?PHP requireAdmin怎么用?PHP requireAdmin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了requireAdmin函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: adminMenu
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";
}
示例2: requireLogin
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;
}
示例3:
<?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) {
示例4: install
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;
}
示例5: uninstall
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;
}