當前位置: 首頁>>代碼示例>>PHP>>正文


PHP requireAdmin函數代碼示例

本文整理匯總了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";
}
開發者ID:jesusvaz,項目名稱:ims-dev,代碼行數:13,代碼來源:portal.php

示例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;
}
開發者ID:prymribb,項目名稱:starter,代碼行數:19,代碼來源:user.php

示例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) {
開發者ID:ncloud,項目名稱:bloglounge,代碼行數:31,代碼來源:index.php

示例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;
    }
開發者ID:EdwardBlack13,項目名稱:ezrpg-1.0.x,代碼行數:20,代碼來源:index.php

示例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;
 }
開發者ID:EdwardBlack13,項目名稱:ezrpg-1.0.x,代碼行數:8,代碼來源:index.php


注:本文中的requireAdmin函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。