本文整理匯總了PHP中session::is_admin方法的典型用法代碼示例。如果您正苦於以下問題:PHP session::is_admin方法的具體用法?PHP session::is_admin怎麽用?PHP session::is_admin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類session
的用法示例。
在下文中一共展示了session::is_admin方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
$ts = isset($_GET['ts']) ? $_GET['ts'] : '';
$rec = isset($_GET['rec']) ? intval($_GET['rec']) : '0';
$spellset = isset($_GET['spellset']) ? $_GET['spellset'] : '';
$playerid = isset($_GET['playerid']) ? $_GET['playerid'] : null;
$acctid = isset($_GET['acctid']) ? $_GET['acctid'] : null;
$guildid = isset($_GET['guildid']) ? $_GET['guildid'] : null;
$aaid = isset($_GET['aaid']) ? $_GET['aaid'] : null;
$searchbar = '';
$body = '';
$javascript = '';
$breadcrumbs = '';
$headbar = '';
require_once 'lib/headbars.php';
require_once 'lib/breadcrumbs.php';
if (isset($_GET['admin'])) {
if (session::is_admin()) {
require_once 'lib/admin.php';
}
}
switch ($editor) {
case '':
$body = new Template("templates/intro.tmpl.php");
$body->set('current_revision', $current_revision);
break;
case 'loot':
require_once 'lib/loot.php';
break;
case 'npc':
require_once 'lib/npc.php';
break;
case 'spawn':
示例2: check_admin_authorization
function check_admin_authorization()
{
global $tmpl;
if (!session::is_admin()) {
$body = "<center><br><br><br><br><br><h2>Sorry, only admins have access to this function.<br><br><a href=\"javascript:history.back();\">Go Back</a></h2>";
$tmpl->set('body', $body);
echo $tmpl->fetch('templates/index.tmpl.php');
exit;
}
}
示例3: build_tabs
//.........這裏部分代碼省略.........
$tabstatus21 = "off";
$tabstatus22 = "off";
$tabstatus23 = "off";
$zoneurl = "";
$npcurl = "";
if ($z) {
$zoneurl = "&z={$z}&zoneid={$zoneid}";
}
if ($npcid) {
$npcurl = "&npcid={$npcid}";
}
switch ($editor) {
case '':
break;
case 'npc':
$tabstatus1 = "on";
break;
case 'loot':
$tabstatus2 = "on";
break;
case 'spawn':
$tabstatus3 = "on";
break;
case 'merchant':
$tabstatus4 = "on";
break;
case 'spellset':
$tabstatus5 = "on";
break;
case 'spells':
$tabstatus5 = "on";
break;
case 'spellops':
$tabstatus5 = "on";
break;
case 'faction':
$tabstatus6 = "on";
break;
case 'tradeskill':
$tabstatus7 = "on";
break;
case 'zone':
$tabstatus8 = "on";
break;
case 'misc':
$tabstatus9 = "on";
break;
case 'server':
$tabstatus10 = "on";
break;
case 'adventures':
$tabstatus11 = "on";
break;
case 'tasks':
$tabstatus12 = "on";
break;
case 'items':
$tabstatus13 = "on";
break;
case 'player':
$tabstatus14 = "on";
break;
case 'account':
$tabstatus15 = "on";
break;
case 'guild':
$tabstatus16 = "on";
break;
case 'mail':
$tabstatus17 = "on";
break;
case 'aa':
$tabstatus18 = "on";
break;
case 'qglobal':
$tabstatus19 = "on";
break;
case 'util':
$tabstatus20 = "on";
break;
case 'altcur':
$tabstatus21 = "on";
break;
case 'inv':
$tabstatus22 = "on";
break;
case 'keys':
$tabstatus23 = "on";
break;
}
$admin = '';
if (session::is_admin()) {
$admin = "<a href=\"index.php?admin\">Admin</a> | ";
}
ob_start();
echo " <div id=\"menubar\">\n <div class=\"{$tabstatus1}\"><a href=\"index.php?editor=npc{$zoneurl}{$npcurl}\">NPCs</a></div>\n <div class=\"{$tabstatus2}\"><a href=\"index.php?editor=loot{$zoneurl}{$npcurl}\">Loot</a></div>\n <div class=\"{$tabstatus3}\"><a href=\"index.php?editor=spawn{$zoneurl}{$npcurl}\">Spawns</a></div>\n <div class=\"{$tabstatus4}\"><a href=\"index.php?editor=merchant{$zoneurl}{$npcurl}\">Merchants</a></div>\n <div class=\"{$tabstatus5}\"><a href=\"index.php?editor=spellops{$zoneurl}{$npcurl}\">Spells</a></div>\n <div class=\"{$tabstatus6}\"><a href=\"index.php?editor=faction\">Factions</a></div>\n <div class=\"{$tabstatus7}\"><a href=\"index.php?editor=tradeskill\">Tradeskills</a></div>\n <div class=\"{$tabstatus8}\"><a href=\"index.php?editor=zone{$zoneurl}\">Zones</a></div>\n <div class=\"{$tabstatus9}\"><a href=\"index.php?editor=misc{$zoneurl}\">Misc</a></div>\n <div class=\"{$tabstatus10}\"><a href=\"index.php?editor=server\">Server</a></div>\n <div class=\"{$tabstatus11}\"><a href=\"index.php?editor=adventures{$zoneurl}{$npcurl}\">Adventures</a></div><br/><br/>\n <div class=\"{$tabstatus12}\"><a href=\"index.php?editor=tasks\">Tasks</a></div>\n <div class=\"{$tabstatus13}\"><a href=\"index.php?editor=items\">Items</a></div>\n <div class=\"{$tabstatus14}\"><a href=\"index.php?editor=player\">Players</a></div>\n <div class=\"{$tabstatus15}\"><a href=\"index.php?editor=account\">Accounts</a></div>\n <div class=\"{$tabstatus16}\"><a href=\"index.php?editor=guild\">Guilds</a></div>\n <div class=\"{$tabstatus17}\"><a href=\"index.php?editor=mail\">Mail</a></div>\n <div class=\"{$tabstatus18}\"><a href=\"index.php?editor=aa\">AAs</a></div>\n <div class=\"{$tabstatus19}\"><a href=\"index.php?editor=qglobal\">QGlobals</a></div>\n <div class=\"{$tabstatus20}\"><a href=\"index.php?editor=util\">Utilities</a></div>\n <div class=\"{$tabstatus21}\"><a href=\"index.php?editor=altcur\">Alt Curr</a></div>\n <div class=\"{$tabstatus22}\"><a href=\"index.php?editor=inv\">Inventory</a></div>\n <div class=\"{$tabstatus23}\"><a href=\"index.php?editor=keys\">Keys</a></div><br/>\n <div style=\"float: right;\">{$admin}<a href=\"index.php?logout\">Logout</a></div><br/><br/>\n </div>\n";
$headbar = ob_get_contents();
ob_end_clean();
return $headbar;
}