本文整理匯總了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;
}