本文整理汇总了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/>";