本文整理汇总了PHP中Permissions::checkPerm方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::checkPerm方法的具体用法?PHP Permissions::checkPerm怎么用?PHP Permissions::checkPerm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permissions
的用法示例。
在下文中一共展示了Permissions::checkPerm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
require_once "DB/DataObject.php";
require_once "DB/DataObject/Cast.php";
require_once "includes/config.php";
require_once "includes/utils.php";
require_once "includes/db.php";
require_once "includes/html.php";
require_once "includes/lang.php";
require_once "includes/permissions.php";
$session = Session::singletone();
if ($session->requireLogin()) {
exit;
}
if (!Permissions::checkPerm('admin_panel')) {
die("Permission denied.");
}
if (!Permissions::checkPerm('add_users')) {
die("Permission denied.");
}
HTML::startHTML();
HTML::head();
HTML::startBODY("a_body");
$err_login = false;
$err_pass1 = false;
$err_pass2 = false;
$err_email = false;
$user_login = "";
$user_pass1 = "";
$user_pass2 = "";
$user_email = "";
?>
示例2: die
require_once "DB/DataObject.php";
require_once "DB/DataObject/Cast.php";
require_once "includes/config.php";
require_once "includes/utils.php";
require_once "includes/db.php";
require_once "includes/html.php";
require_once "includes/lang.php";
require_once "includes/permissions.php";
$session = Session::singletone();
if ($session->requireLogin()) {
exit;
}
if (!Permissions::checkPerm('admin_panel')) {
die("Permission denied.");
}
if (!Permissions::checkPerm('delete_categories')) {
die("Permission denied.");
}
$ref = urldecode(Utils::pg("ref"));
$cid = urldecode(Utils::pg("cid"));
function delete_category($cid)
{
global $db;
$q = $db->prepare("SELECT category_id FROM phph_categories WHERE category_parent = ?");
$r = $db->execute($q, $cid);
if (PEAR::isError($r)) {
die($r->getMessage());
}
while ($row = $r->fetchRow()) {
delete_category($row['category_id']);
}
示例3: die
if ($session->requireLogin()) {
exit;
}
if (!Permissions::checkPerm('admin_panel')) {
die("Permission denied.");
}
HTML::startHTML();
HTML::head();
HTML::startBODY("a_body");
$action = Utils::pg("action", "edit");
if ($action == "edit") {
if (!Permissions::checkPerm('edit_categories')) {
die("Permission denied.");
}
} else {
if (!Permissions::checkPerm('add_categories')) {
die("Permission denied.");
}
}
$ref = urldecode(Utils::pg("ref"));
$cid = Utils::pg("cid");
$category_name = "";
$category_parent = 0;
$category_description = "";
if ($action == "edit") {
$category = DB_DataObject::Factory('phph_categories');
if (PEAR::isError($category)) {
die($category->getMessage());
}
$r = $category->get($cid);
if (PEAR::isError($r)) {
示例4: die
require_once "includes/session.php";
require_once "XML/Tree.php";
require_once "includes/config.php";
require_once "includes/utils.php";
require_once "includes/db.php";
require_once "includes/html.php";
require_once "includes/lang.php";
require_once "includes/permissions.php";
$session = Session::singletone();
if ($session->requireLogin()) {
exit;
}
if (!Permissions::checkPerm('admin_panel')) {
die("Permission denied.");
}
if (!Permissions::checkPerm('site_configuration')) {
die("Permission denied.");
}
HTML::startHTML();
HTML::head();
HTML::startBODY("a_body");
?>
<div class="a_white_pane">
<h1 class="a_title"><?php
echo _ADMIN_GENERAL_SETTINGS;
?>
:: <?php
echo _ADMIN_SITE_CONFIGURATION;
?>
</h1>
示例5: die
$user = DB_DataObject::Factory('phph_users');
if (PEAR::isError($user)) {
die($user->getMessage());
}
$r = $user->get($uid);
if (PEAR::isError($r)) {
die($r->getMessage());
}
if ($r == 0) {
header("Location: " . $session->addSID(Config::get("site_url") . "/admin/users.php"));
}
$name = $user->user_login;
$field = "user_id";
$id = $uid;
} else {
if (!Permissions::checkPerm('change_groups_permissions')) {
die("Permission denied.");
}
$group = DB_DataObject::Factory('phph_groups');
if (PEAR::isError($group)) {
die($group->getMessage());
}
$r = $group->get($gid);
if (PEAR::isError($r)) {
die($r->getMessage());
}
if ($r == 0) {
header("Location: " . $session->addSID(Config::get("site_url") . "/admin/groups.php"));
}
$name = $group->group_name;
$field = "group_id";
示例6: die
require_once "includes/permissions.php";
require_once "includes/comment.php";
$session = Session::singletone();
if ($session->requireLogin()) {
exit;
}
if (!Permissions::checkPerm('admin_panel')) {
die("Permission denied.");
}
HTML::startHTML();
HTML::head();
HTML::startBODY("a_body");
$ref = urldecode(Utils::pg("ref"));
$msg_subject = "";
$msg_text = "";
if (!Permissions::checkPerm('mass_message')) {
die("Permission denied.");
}
?>
<div class="a_white_pane">
<h1 class="a_title">Wiadomo¶æ masowa</h1>
</div>
<br />
<?php
if (!empty($_POST['submit'])) {
try {
$msg_subject = $_POST['msg_subject'];
$msg_text = $_POST['msg_text'];
示例7: die
require_once "includes/session.php";
require_once "includes/config.php";
require_once "includes/utils.php";
require_once "includes/db.php";
require_once "includes/html.php";
require_once "includes/lang.php";
require_once "includes/permissions.php";
require_once "includes/category.php";
$session = Session::singletone();
if ($session->requireLogin()) {
exit;
}
if (!Permissions::checkPerm('admin_panel')) {
die("Permission denied.");
}
if (!Permissions::checkPerm('edit_categories')) {
die("Permission denied.");
}
$ref = urldecode(Utils::pg("ref"));
$cid = urldecode(Utils::pg("cid"));
$pcid = urldecode(Utils::pg("pcid"));
$category = new Category($cid);
if (!empty($pcid)) {
$q = $db->prepare("SELECT category_order, category_id FROM phph_categories WHERE category_parent = ? AND category_order > ? ORDER BY category_order ASC LIMIT 0, 1");
$res = $db->execute($q, array($pcid, $category->_dbo->category_order));
} else {
$q = $db->prepare("SELECT category_order, category_id FROM phph_categories WHERE category_parent IS NULL AND category_order > ? ORDER BY category_order ASC LIMIT 0, 1");
$res = $db->execute($q, array($category->_dbo->category_order));
}
if ($res->numRows() == 1) {
$row = $res->fetchRow();
示例8: die
require_once "includes/session.php";
require_once "XML/Tree.php";
require_once "includes/config.php";
require_once "includes/utils.php";
require_once "includes/db.php";
require_once "includes/html.php";
require_once "includes/lang.php";
require_once "includes/permissions.php";
$session = Session::singletone();
if ($session->requireLogin()) {
exit;
}
if (!Permissions::checkPerm('admin_panel')) {
die("Permission denied.");
}
if (!Permissions::checkPerm('users_and_groups_settings')) {
die("Permission denied.");
}
HTML::startHTML();
HTML::head();
HTML::startBODY("a_body");
?>
<div class="a_white_pane">
<h1 class="a_title"><?php
echo _ADMIN_USERS_AND_GROUPS;
?>
:: <?php
echo _ADMIN_SETTINGS;
?>
</h1>
示例9: Pane_Preview
$pane = new Pane_Preview($photo);
$form->addPane($pane);
$pane = new HTML_AdminFormPane("p1", "Dane zdjêcia");
$field = new HTML_TextField("photo_title", "Tytu³", "", 50, $photo_title);
$pane->addField($field);
$field = new HTML_MemoField("photo_description", "Opis", "", $photo_description, 5, 50);
$pane->addField($field);
$field = new HTML_SelectField("photo_cids[]", "Kategorie", "Wybierz jedn± lub wiêcej kategorii", 10, $photo_cids);
$field->_multiselect = true;
$field->addOption(0, "Brak kategori");
fill_category_tree($field, null, 1);
$pane->addField($field);
if (Permissions::checkPerm("approve_photos") && !$photo_approved) {
$field = new HTML_SelectField("photo_approved", "Zaakceptowane", "", 0, $photo_approved);
$field->addYesNo();
} else {
$field = new HTML_StaticField("photo_approved_st", "Zaakceptowane", "", $photo_approved ? "Tak" : "Nie");
$form->addHidden("photo_approved", $photo_approved);
}
$pane->addField($field);
$form->addPane($pane);
$form->_submit = "Zapisz";
$form->show();
$block = new HTML_Block("comments", "Komentarze");
$block->_expanded = true;
示例10: array
$items['gs_db'] = array('name' => _ADMIN_DATABASE_OPERATIONS, 'href' => $session->addSID($admin_url . '/database.php'));
$menu_data = array('gs' => array('name' => _ADMIN_GENERAL_SETTINGS, 'items' => $items));
$menu = new HTML_Menu($menu_data, "a_menu_pane");
$menu->show();
echo "<br />";
$items = array();
if (Permissions::checkPerm('users_and_groups_settings')) {
$items['uag_s'] = array('name' => _ADMIN_SETTINGS, 'href' => $session->addSID($admin_url . '/user_settings.php'));
}
$items['uag_u'] = array('name' => _ADMIN_USERS, 'href' => $session->addSID($admin_url . '/users.php'));
if (Permissions::checkPerm('add_users')) {
$items['uag_au'] = array('name' => _ADMIN_ADD_NEW_USER, 'href' => $session->addSID($admin_url . '/add_user.php'));
}
$items['uag_g'] = array('name' => _ADMIN_GROUPS, 'href' => $session->addSID($admin_url . '/groups.php'));
if (Permissions::checkPerm('add_groups')) {
$items['uag_ag'] = array('name' => _ADMIN_ADD_NEW_GROUP, 'href' => $session->addSID($admin_url . '/edit_group.php?action=add'));
}
if (Permissions::checkPerm('mess_message')) {
$items['uag_mm'] = array('name' => "Wiadomo¶æ masowa", 'href' => $session->addSID($admin_url . '/mass.php'));
}
$menu_data = array('uag' => array('name' => _ADMIN_USERS_AND_GROUPS, 'items' => $items));
$menu = new HTML_Menu($menu_data, "a_menu_pane_2");
$menu->show();
echo "<br />";
$menu_data = array('gal' => array('name' => _ADMIN_GALLERY, 'items' => array('gal_s' => array('name' => _ADMIN_SETTINGS, 'href' => $session->addSID($admin_url . '/gallery.php')), 'gal_c' => array('name' => _ADMIN_CATEGORIES, 'href' => $session->addSID($admin_url . '/categories.php')), 'gal_ac' => array('name' => _ADMIN_ADD_NEW_CATEGORY, 'href' => $session->addSID($admin_url . '/edit_category.php?action=add')), 'gal_p' => array('name' => _ADMIN_PHOTOS, 'href' => $session->addSID($admin_url . '/photos.php')))));
$menu = new HTML_Menu($menu_data, "a_menu_pane_3");
$menu->show();
echo "<br />";
HTML::endBODY();
HTML::endHTML();
ini_restore('include_path');
示例11: header
if ($r == 0) {
if (!empty($ref)) {
header("Location: " . $ref);
}
$action = "add";
}
$group_name = $group->group_name;
$group_description = $group->group_description;
$group_level = $group->group_level;
}
if ($action == "edit") {
if (!Permissions::checkPermAndLevelVal('edit_groups', $group_level)) {
die("Permission denied.");
}
} else {
if (!Permissions::checkPerm('add_groups')) {
die("Permission denied.");
}
}
?>
<div class="a_white_pane">
<h1 class="a_title"><?php
echo _ADMIN_GROUPS;
?>
:: <?php
if ($action == "add") {
echo _ADMIN_ADD_NEW_GROUP;
} else {
echo _ADMIN_EDIT_GROUP;
}
示例12: die
require_once "includes/session.php";
require_once "XML/Tree.php";
require_once "includes/config.php";
require_once "includes/utils.php";
require_once "includes/db.php";
require_once "includes/html.php";
require_once "includes/lang.php";
require_once "includes/permissions.php";
$session = Session::singletone();
if ($session->requireLogin()) {
exit;
}
if (!Permissions::checkPerm('admin_panel')) {
die("Permission denied.");
}
if (!Permissions::checkPerm('gallery_settings')) {
die("Permission denied.");
}
HTML::startHTML();
HTML::head();
HTML::startBODY("a_body");
?>
<div class="a_white_pane">
<h1 class="a_title"><?php
echo _ADMIN_GALLERY;
?>
:: <?php
echo _ADMIN_SETTINGS;
?>
</h1>
示例13: checkPermAndLevelVal
static function checkPermAndLevelVal($perm, $level)
{
return Permissions::checkPerm($perm) && Permissions::checkLevel($level);
}
示例14: die
require_once "includes/session.php";
require_once "XML/Tree.php";
require_once "HTML/Crypt.php";
require_once "DB/DataObject.php";
require_once "DB/DataObject/Cast.php";
require_once "includes/config.php";
require_once "includes/utils.php";
require_once "includes/db.php";
require_once "includes/html.php";
require_once "includes/lang.php";
require_once "includes/permissions.php";
$session = Session::singletone();
if ($session->requireLogin()) {
exit;
}
if (!Permissions::checkPerm('admin_panel')) {
die("Permission denied.");
}
$cid = Utils::pg("cid", null);
HTML::startHTML();
HTML::head();
HTML::startBODY("a_body");
?>
<div class="a_white_pane">
<h1 class="a_title"><?php
echo _ADMIN_PHOTOS;
?>
:: <?php
echo _ADMIN_CATEGORIES;
?>
示例15: die
require_once "DB/DataObject.php";
require_once "DB/DataObject/Cast.php";
require_once "includes/config.php";
require_once "includes/utils.php";
require_once "includes/db.php";
require_once "includes/html.php";
require_once "includes/lang.php";
require_once "includes/permissions.php";
$session = Session::singletone();
if ($session->requireLogin()) {
exit;
}
if (!Permissions::checkPerm('admin_panel')) {
die("Permission denied.");
}
if (!Permissions::checkPerm('delete_users')) {
die("Permission denied.");
}
$ref = urldecode(Utils::pg("ref"));
$uid = urldecode(Utils::pg("uid"));
$user = DB_DataObject::Factory("phph_users");
if (PEAR::isError($user)) {
die($user->getMessage());
}
$r = $user->get($uid);
if (PEAR::isError($r)) {
die($r->getMessage());
}
if (!(Permissions::isAdmin() || Permissions::checkLevel($user->user_id))) {
header("Location: {$ref}");
}