本文整理匯總了PHP中AllowUser函數的典型用法代碼示例。如果您正苦於以下問題:PHP AllowUser函數的具體用法?PHP AllowUser怎麽用?PHP AllowUser使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AllowUser函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: toLogin
<?php
require_once 'support/config.php';
if (!isLoggedIn()) {
toLogin();
die;
}
if (!AllowUser(array(1, 2))) {
redirect("index.php");
}
if (empty($_GET['id']) || empty($_GET['t'])) {
redirect('index.php');
die;
} else {
$table = "";
switch ($_GET['t']) {
case 'a':
$table = "assets";
$page = "assets.php";
$activity_input['admin_id'] = $_SESSION[WEBAPP]['user']['id'];
$activity_input['item_id'] = $_GET['id'];
$con->myQuery("INSERT INTO activities(admin_id,action,action_date,category_type_id,item_id) VALUES(:admin_id,'Deleted Asset',NOW(),1,:item_id)", $activity_input);
break;
case 'am':
$table = "asset_models";
$page = "asset_models.php";
break;
case 'c':
$table = "consumables";
$page = "consumables.php";
break;
示例2: htmlspecialchars
<h1>
View Asset <?php
echo htmlspecialchars($asset['asset_name']);
?>
(<?php
echo htmlspecialchars($asset['category']);
?>
)
</h1>
</section>
<section class='content'>
<div class="row">
<div class="col-lg-12">
<h3 class="page-header">
<?php
if (AllowUser(array(1, 2)) && $asset['is_deleted'] == 0) {
?>
<div class="dropdown" style='display:inline'>
<button class="btn btn-flat btn-success dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Actions
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="frm_assets.php?id=<?php
echo $asset['id'];
?>
">Edit Asset</a></li>
<li><a href="delete.php?id=<?php
echo $asset['id'];
?>
示例3: toLogin
<?php
require_once 'support/config.php';
if (!isLoggedIn()) {
toLogin();
die;
}
if (!AllowUser(array(1, 2, 3))) {
redirect("index.php");
}
if (!empty($_GET['date_start'])) {
$date_start = date_create($_GET['date_start']);
} else {
$date_start = "";
}
if (!empty($_GET['date_end'])) {
$date_end = date_create($_GET['date_end']);
} else {
$date_end = "";
}
makeHead("Asset Depreciation Report");
require_once "template/header.php";
require_once "template/sidebar.php";
?>
<div class='content-wrapper'>
<div class='content-header'>
<h1 class='page-header text-center text-green'>Asset Maintenance Report</h1>
</div>
<section class='content'>
<div class="row">
<div class='col-lg-12'>
示例4: toLogin
<?php
require_once 'support/config.php';
if (!isLoggedIn()) {
toLogin();
die;
}
if (!AllowUser(array(1))) {
redirect("index.php");
}
if (!empty($_POST)) {
//Validate form inputs
$inputs = $_POST;
$errors = "";
if (empty($_POST['user_type_id'])) {
$errors .= "Select user type. <br/>";
}
if (empty($_POST['first_name'])) {
$errors .= "Enter first name. <br/>";
}
if (empty($_POST['middle_name'])) {
$errors .= "Enter middle name. <br/>";
}
if (empty($_POST['last_name'])) {
$errors .= "Enter last name. <br/>";
}
if (empty($_POST['username'])) {
$errors .= "Enter username. <br/>";
}
if (empty($_POST['password'])) {
$errors .= "Enter password. <br/>";