當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PermissionsManager::deletePermission方法代碼示例

本文整理匯總了PHP中PermissionsManager::deletePermission方法的典型用法代碼示例。如果您正苦於以下問題:PHP PermissionsManager::deletePermission方法的具體用法?PHP PermissionsManager::deletePermission怎麽用?PHP PermissionsManager::deletePermission使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PermissionsManager的用法示例。


在下文中一共展示了PermissionsManager::deletePermission方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: PermissionsManager

include_once '../../config/symbini.php';
include_once $serverRoot . '/classes/PermissionsManager.php';
header("Content-Type: text/html; charset=" . $charset);
$action = array_key_exists("action", $_REQUEST) ? $_REQUEST["action"] : "";
$collId = array_key_exists("collid", $_REQUEST) ? $_REQUEST["collid"] : 0;
$permManager = new PermissionsManager();
$isEditor = 0;
if ($SYMB_UID) {
    if ($IS_ADMIN || array_key_exists("CollAdmin", $USER_RIGHTS) && in_array($collId, $USER_RIGHTS["CollAdmin"])) {
        $isEditor = 1;
    }
}
if ($isEditor) {
    if (array_key_exists('deladmin', $_GET)) {
        $permManager->deletePermission($_GET['deladmin'], 'CollAdmin', $collId);
    } elseif (array_key_exists('deleditor', $_GET)) {
        $permManager->deletePermission($_GET['deleditor'], 'CollEditor', $collId);
    } elseif (array_key_exists('delrare', $_GET)) {
        $permManager->deletePermission($_GET['delrare'], 'RareSppReader', $collId);
    } elseif (array_key_exists('delidenteditor', $_GET)) {
        $permManager->deletePermission($_GET['delidenteditor'], 'CollTaxon', $collId, $_GET['utid']);
        if (is_numeric($_GET['utid'])) {
            $permManager->deletePermission($_GET['delidenteditor'], 'CollTaxon', $collId, 'all');
        }
    } elseif ($action == 'Add Permissions for User') {
        $rightType = $_POST['righttype'];
        if ($rightType == 'admin') {
            $permManager->addPermission($_POST['uid'], "CollAdmin", $collId);
        } elseif ($rightType == 'editor') {
            $permManager->addPermission($_POST['uid'], "CollEditor", $collId);
開發者ID:urban011,項目名稱:ut-prc-symbiota,代碼行數:30,代碼來源:collpermissions.php

示例2: trim

include_once $serverRoot . '/classes/ProfileManager.php';
header("Content-Type: text/html; charset=" . $charset);
$loginAs = array_key_exists("loginas", $_REQUEST) ? trim($_REQUEST["loginas"]) : "";
$searchTerm = array_key_exists("searchterm", $_REQUEST) ? trim($_REQUEST["searchterm"]) : "";
$userId = array_key_exists("userid", $_REQUEST) ? $_REQUEST["userid"] : "";
$delRole = array_key_exists("delrole", $_REQUEST) ? $_REQUEST["delrole"] : "";
$tablePk = array_key_exists("tablepk", $_REQUEST) ? $_REQUEST["tablepk"] : "";
$userManager = new PermissionsManager();
if ($isAdmin) {
    if ($loginAs) {
        $pHandler = new ProfileManager();
        $pHandler->setUserName($loginAs);
        $pHandler->authenticate();
        header("Location: ../index.php");
    } elseif ($delRole) {
        $userManager->deletePermission($userId, $delRole, $tablePk);
    } elseif (array_key_exists("apsubmit", $_POST)) {
        foreach ($_POST["p"] as $pname) {
            $role = $pname;
            $tablePk = '';
            if (strpos($pname, '-')) {
                $tok = explode('-', $pname);
                $role = $tok[0];
                $tablePk = $tok[1];
            }
            $userManager->addPermission($userId, $role, $tablePk);
        }
    }
}
?>
<html>
開發者ID:jphilip124,項目名稱:Symbiota,代碼行數:31,代碼來源:usermanagement.php


注:本文中的PermissionsManager::deletePermission方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。