本文整理汇总了PHP中Permission::IsAllowed方法的典型用法代码示例。如果您正苦于以下问题:PHP Permission::IsAllowed方法的具体用法?PHP Permission::IsAllowed怎么用?PHP Permission::IsAllowed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permission
的用法示例。
在下文中一共展示了Permission::IsAllowed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Permission
<?php
$perms = new Permission();
if (!$perms->IsAllowed('groups')) {
Exceptions::PrintOut("You do not have access to the Users and groups");
}
/**
* Check if post names are set
*/
$post_check = Post::Check(array("title", "users", "banned", "history"));
/**
* If post names are all set, try to insert the group
*/
if ($post_check) {
$new_user = new UsersAndGroups();
$result = $new_user->NewGroup($_POST['title'], array($_POST['users'], $_POST['banned'], $_POST['history']));
/*
* If result is not true, output the error variable
*/
if (!$result) {
$error = $new_user->error;
}
}
/**
* Include view template file
*/
include 'views/template/new_group.html';
示例2: Permission
<?php
$perms = new Permission();
if (!$perms->IsAllowed('history')) {
Exceptions::PrintOut("You do not have access to the History");
}
/**
* Check $_POST variables for "search"
*/
$post_check = Post::Check(array("search"));
if ($post_check) {
/**
* If variable is passed, search for the historic messages with passed variable
*/
$historic = History::SearchHistory($_POST['search']);
} else {
/**
* Else output the default historic messages
*/
$historic = History::ListHistory();
}
include 'views/template/history.html';
示例3: Permission
<?php
$perms = new Permission();
if (!$perms->IsAllowed('banned')) {
Exceptions::PrintOut("You do not have access to the Banned area");
}
/**
* Check for $_GET variable "id"
*/
$delcheck = Post::GCheck(array("id"));
/**
* If variable is set, delete the user and return to page
*/
if ($delcheck) {
UserBan::BanDelete($_GET['id']);
header("Location: index.php?page=UserBan");
}