本文整理匯總了PHP中is_privileged函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_privileged函數的具體用法?PHP is_privileged怎麽用?PHP is_privileged使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了is_privileged函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: is_privileged
<!DOCTYPE html>
<?php
@session_start();
if (!isset($_SESSION['username'])) {
echo '<script language="javascript">
alert(\'Unable to view this page you have to login!\')
</script>';
echo "<meta http-equiv=\"refresh\" content=\"0;URL=../?error=Login_Required\">";
} else {
$username = $_SESSION['username'];
include "../db/db.php";
include "../actions/user_priviledges.php";
$developer = is_privileged($_SESSION['account_no'], 1);
//$registrar= is_privileged($_SESSION['account_no'], 13);
$eis_admin = is_privileged($_SESSION['account_no'], 3);
$super_admin = is_privileged($_SESSION['account_no'], 2);
if (!$developer && !$eis_admin) {
header("Location: ../restrict.php");
}
?>
<html lang="en"><!-- InstanceBegin template="/Templates/eis_admin_template.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Pagasa National Highschool:: Base Admin</title>
<!-- InstanceEndEditable -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
示例2: refreshParent
window.onunload = refreshParent;
function refreshParent() {
window.opener.location.reload();
}
</script>
<?php
include "../db/db.php";
include '../actions/user_priviledges.php';
@session_start();
if (!isset($_SESSION['username'])) {
header("Location: ../restrict.php");
}
$developer = is_privileged($_SESSION['account_no'], 1);
$super_admin = is_privileged($_SESSION['account_no'], 2);
$supply_admin = is_privileged($_SESSION['account_no'], 9);
$supply_officer = is_privileged($_SESSION['account_no'], 16);
if (!$developer && !$super_admin && !$supply_admin && !$supply_officer) {
header("Location: ../restrict.php");
}
?>
<meta charset="utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Pagasa National Highschool:: Base Admin</title>
<!-- InstanceEndEditable -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link href="../css/bootstrap.css" rel="stylesheet" />
示例3: header
}
?>
<html lang="en"><!-- InstanceBegin template="/Templates/sched_template.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<?php
@session_start();
include "../db/db.php";
include "../actions/user_privileges.php";
if (!isset($_SESSION['username'])) {
header("Location: ../restrict.php");
}
$developer = is_privileged($_SESSION['account_no'], 1);
$super_admin = is_privileged($_SESSION['account_no'], 2);
$scheduling_admin = is_privileged($_SESSION['account_no'], 6);
$scheduling_officer = is_privileged($_SESSION['account_no'], 14);
if (!$developer && !$super_admin && !$scheduling_admin && !$scheduling_officer) {
header("Location: restrict.php");
}
?>
<meta charset="utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Pagasa National Highschool:: Base Admin</title>
<!-- InstanceEndEditable -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link href="../css/bootstrap.css" rel="stylesheet" />
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600" rel="stylesheet" />
示例4: header
<!DOCTYPE html>
<html lang="en"><!-- InstanceBegin template="/Templates/library_template.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<?php
require "db.php";
@session_start();
if (!isset($_SESSION['username'])) {
header("location: ../restrict.php");
// IMPORTANT!!!!
}
include_once "../actions/user_priviledges.php";
$developer = is_privileged($_SESSION['account_no'], 1);
$super_admin = is_privileged($_SESSION['account_no'], 2);
$librarian = is_privileged($_SESSION['account_no'], 8);
?>
<meta charset="utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Pagasa National Highschool:: Base Admin</title>
<!-- InstanceEndEditable -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link href="../css/bootstrap.min.css" rel="stylesheet" />
<link href="../css/bootstrap-responsive.min.css" rel="stylesheet" />
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600" rel="stylesheet" />
<link href="../css/font-awesome.min.css" rel="stylesheet" />
<link href="../css/base-admin-2.css" rel="stylesheet" />
示例5: header
$_SESSION['username'];
$username = $_SESSION['username'];
?>
<html lang="en"><!-- InstanceBegin template="/Templates/grading_template.dwt.php" codeOutsideHTMLIsLocked="false" -->
<?php
@session_start();
include "../db/db.php";
include "../actions/user_privileges.php";
if (!isset($_SESSION['username'])) {
header("Location: ../restrict.php");
}
$developer = is_privileged($_SESSION['account_no'], 1);
$super_admin = is_privileged($_SESSION['account_no'], 2);
$adviser = is_privileged($_SESSION['account_no'], 10);
$teacher = is_privileged($_SESSION['account_no'], 12);
if (!$developer && !$super_admin && !$adviser && !$teacher) {
header("Location: restrict.php");
}
?>
<head>
<meta charset="utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Pagasa National Highschool:: Base Admin</title>
<!-- InstanceEndEditable -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link href="../css/bootstrap.css" rel="stylesheet" />
示例6: header
<!DOCTYPE html>
<?php
@session_start();
?>
<html lang="en"><!-- InstanceBegin template="/Templates/ams_template.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<?php
//
@session_start();
include "../db/db.php";
include "../actions/user_priviledges.php";
if (!isset($_SESSION['username'])) {
header("Location: ../restrict.php");
}
if (!is_privileged($_SESSION['account_no'], 2)) {
header("Location: ../restrict.php");
}
?>
<meta charset="utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Pagasa National Highschool:: Base Admin</title>
<!-- InstanceEndEditable -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link href="../css/bootstrap.css" rel="stylesheet" />
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600" rel="stylesheet" />
<link href="../css/font-awesome.min.css" rel="stylesheet" />
示例7: mx_counton
function mx_counton()
{
// how many users connected ?
global $mxdb;
$users = $mxdb->counton();
echo '<div class="quicknums">';
echo '<h5>' . _('Some Numbers') . '</h5>';
if (is_privileged()) {
echo '<a href="' . mx_pageurl('whoswhere') . '" alt="' . mx_pagename('whoswhere') . '">';
if (!$users['on']) {
__('Nobody\'s online...');
} else {
if ($users['on'] == 1) {
__('1 user online');
} else {
echo sprintf(_('%s users online'), $users['on']);
}
}
echo '</a>';
echo '<br/>';
echo '<a href="' . mx_optionurl('fans', 'fandir') . '" alt="' . mx_optionname('fans', 'fandir') . '">';
if (!$users['fans']) {
__('No fan registered...');
} else {
if ($users['fans'] == 1) {
__('1 fan registered');
} else {
echo sprintf(_('%s fans registered'), $users['fans']);
}
}
echo '</a>';
echo '<br/>';
echo '<a href="' . mx_optionurl('artists', 'artsdir') . '" alt="' . mx_optionname('artists', 'artsdir') . '">';
if (!$users['artists']) {
__('No artist registered...');
} else {
if ($users['artists'] == 1) {
__('1 artist registered');
} else {
echo sprintf(_('%s artists registered'), $users['artists']);
}
}
echo '</a>';
echo '<hr/>';
}
echo sprintf(_('%s visitors'), '<span id="mxvisits">' . $users['visitors'] . '</span>');
echo '<br/>';
//echo sprintf(_('%d connections'),$users['connections']);
//echo '<br/>';
echo sprintf(_('%s hits'), '<span id="mxhits">' . $users['hits'] . '</span>');
echo '<br/>';
echo '<script>cnttmr=setInterval(\'checkvisits()\',10000);</script>';
echo '</div>';
}
示例8: session_start
<?php
include "../db/db.php";
session_start();
if (!isset($_SESSION['username'])) {
header("location: ../restrict.php");
}
?>
<?php
include "../actions/user_priviledges.php";
$developer = is_privileged($_SESSION['account_no'], 1);
$super_admin = is_privileged($_SESSION['account_no'], 2);
$sis_admin = is_privileged($_SESSION['account_no'], 4);
$club_adviser = is_privileged($_SESSION['account_no'], 11);
$student = is_privileged($_SESSION['account_no'], 17);
if (!$developer || !$club_adviser) {
header("Location: ../restrict.php");
}
?>
<html lang="en"><!-- InstanceBegin template="/Templates/sisclubadviser_template.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Pagasa National Highschool:: Base Admin</title>
<!-- InstanceEndEditable -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link href="./css/pages/reports.css" rel="stylesheet" />
<link href="../../css/bootstrap.css" rel="stylesheet" />
示例9: mx_showmenu
function mx_showmenu($menu, $menutype, $curpage = '', $curopt = '')
{
global $mx_ctxmenu, $mx_fbmenu, $mxuser;
define('MXMENUVERTUSER', 0);
define('MXMENUHORIZTOP', 1);
define('MXMENUHORIZBOT', 2);
define('MXMENUHORIZICON', 3);
define('MXMENUHORIZHELP', 4);
define('MXMENUVERTMAIN', 5);
define('MXMENUHORIZFB', 6);
define('MXMENUVERTICON', 7);
if ($menutype != 0 && $menutype != 4 && $menutype != 6 && $menu != $mx_ctxmenu && array_key_exists($curpage, $mx_ctxmenu) && ($mx_ctxmenu[$curpage][0] == 1 && is_logged() || $mx_ctxmenu[$curpage][0] == 1.5 && !is_confirmed() || $mx_ctxmenu[$curpage][0] == 2 && !is_logged() || $mx_ctxmenu[$curpage][0] == 2.4 && (!is_logged() || is_confirmed()) || $mx_ctxmenu[$curpage][0] == 2.5 && (!is_confirmed() || is_setup()) || $mx_ctxmenu[$curpage][0] >= 3 && !is_setup() || $mx_ctxmenu[$curpage][0] == 10 && !(is_setup() && is_artist()) || $mx_ctxmenu[$curpage][0] == 11 && !(is_setup() && is_artist() && is_pageadmin()) || $mx_ctxmenu[$curpage][0] == 20 && !is_privileged() || $mx_ctxmenu[$curpage][0] < 0 || $mx_ctxmenu[$curpage][0] == 127 && !is_admin() || $mx_ctxmenu[$curpage][0] == 126 && !is_pseudoadmin())) {
return;
}
if ($menutype == 6 && ($mx_fbmenu[$curpage][0] == 1 && is_logged() || $mx_fbmenu[$curpage][0] == 1.5 && !is_confirmed() || $mx_fbmenu[$curpage][0] == 2 && !is_logged() || $mx_fbmenu[$curpage][0] == 2.4 && (!is_logged() || is_confirmed()) || $mx_fbmenu[$curpage][0] == 2.5 && (!is_confirmed() || is_setup()) || $mx_fbmenu[$curpage][0] >= 3 && !is_setup() || $mx_fbmenu[$curpage][0] == 10 && !(is_setup() && is_artist()) || $mx_fbmenu[$curpage][0] == 11 && !(is_setup() && is_artist() && is_pageadmin()) || $mx_fbmenu[$curpage][0] < 0 || $mx_fbmenu[$curpage][0] == 127 && !is_admin() || $mx_fbmenu[$curpage][0] == 126 && !is_pseudoadmin())) {
//error_log(print_r($mx_fbmenu[$curpage][0],true));
return;
}
switch ($menutype) {
case MXMENUVERTUSER:
// user vertical menu
$style = 'usermenu menusep';
break;
case MXMENUHORIZTOP:
// topbar horizontal menu
$style = 'ctxmenu';
break;
case MXMENUHORIZBOT:
// bottom screen menu
$style = 'musxmenu';
break;
case MXMENUHORIZICON:
// topbar icon menu
$style = 'iconmenu';
break;
case MXMENUHORIZHELP:
// help menu
$style = 'helpmenu';
break;
case MXMENUVERTMAIN:
// main vertical menu
$style = 'mainmenu menusep';
break;
case MXMENUHORIZFB:
// facebook menu
$style = 'fbmenu';
break;
case MXMENUVERTICON:
// big icons menu
$style = 'bigmenu';
break;
}
echo '<div class=\'' . $style . '\'>';
echo '<ul>';
if ($mxuser->id && ($menutype == MXMENUVERTUSER || $menutype == MXMENUVERTMAIN)) {
echo '<li class="menutitle">' . ($menutype == MXMENUVERTMAIN ? '' : strtoupper(mx_pagename($curpage))) . '</li>';
}
foreach ($menu as $menuopt => $menutable) {
/*if (abs($menutable[0])>1 && !is_confirmed()
&& $menuopt!='signoff'
//&& $menuopt!='messages'
&& $menuopt!='help'
//&& $menuopt!='friends'
&& $menuopt!='setup') continue;*/
if (array_key_exists(2, $menutable) && !is_array($menutable[2]) && $menutable[2] != '#') {
// redirection
$page = $menutable[2];
$option = $menutable[3] != '' ? $menutable[3] : '';
} else {
if (array_key_exists(2, $menutable) && $menutable[2] == '#') {
// javascript (feedback)
$page = '#';
$option = '';
} else {
if ($menutype == 1 || $menutype == 0 || $menutype == 7) {
// top or user menu
$page = $curpage;
$option = $menuopt;
} else {
if ($menutype == 4) {
// help menu
if ($mx_ctxmenu['help'][2][$curpage][3] == '') {
$page = 'help';
$option = $curpage;
} else {
$page = 'help';
$option = $mx_ctxmenu['help'][2][$curpage][3];
}
} else {
$page = $menuopt;
$option = '';
}
}
}
}
if (($menutype != 4 || $curpage != $menuopt) && (!$menutable[0] || $menutable[0] == 1 && !is_logged() || $menutable[0] == 1.5 && !is_logged() || $menutable[0] == 2 && is_logged() || $menutable[0] == 2.4 && is_logged() && !is_confirmed() || $menutable[0] == 2.5 && is_confirmed() && !is_setup() || $menutable[0] == 3 && is_setup() || $menutable[0] == 10 && is_setup() && is_artist() || $menutable[0] == 11 && is_setup() && is_artist() && is_pageadmin() || $menutable[0] == 20 && is_privileged() || $menutable[0] == 127 && is_admin() || $menutable[0] == 126 && is_pseudoadmin())) {
if ($menutype == 3) {
// icon menu
$label = mx_icon($menuopt, $menutable[1], '20px');
if ($menuopt == 'messages' && $mxuser->newmsgs > 0) {
//.........這裏部分代碼省略.........