当前位置: 首页>>代码示例>>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;未经允许,请勿转载。