当前位置: 首页>>代码示例>>PHP>>正文


PHP AJXP_Utils::filterFormElementsFromMeta方法代码示例

本文整理汇总了PHP中AJXP_Utils::filterFormElementsFromMeta方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Utils::filterFormElementsFromMeta方法的具体用法?PHP AJXP_Utils::filterFormElementsFromMeta怎么用?PHP AJXP_Utils::filterFormElementsFromMeta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AJXP_Utils的用法示例。


在下文中一共展示了AJXP_Utils::filterFormElementsFromMeta方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: switchAction


//.........这里部分代码省略.........
                 $roleGroup = true;
             }
             if (strpos($roleId, "AJXP_USR_") === 0) {
                 $usrId = str_replace("AJXP_USR_/", "", $roleId);
                 $userObject = ConfService::getConfStorageImpl()->createUserObject($usrId);
                 if (!AuthService::canAdministrate($userObject)) {
                     throw new Exception("Cannot post role for user " . $usrId);
                 }
                 $originalRole = $userObject->personalRole;
             } else {
                 // second param = create if not exists.
                 $originalRole = AuthService::getRole($roleId, $roleGroup);
             }
             if ($originalRole === false) {
                 throw new Exception("Cant find role! ");
             }
             $jsonData = SystemTextEncoding::magicDequote($httpVars["json_data"]);
             $data = json_decode($jsonData, true);
             $roleData = $data["ROLE"];
             $binariesContext = array();
             if (isset($userObject)) {
                 $binariesContext = array("USER" => $userObject->getId());
             }
             if (isset($data["FORMS"])) {
                 $forms = $data["FORMS"];
                 foreach ($forms as $repoScope => $plugData) {
                     foreach ($plugData as $plugId => $formsData) {
                         $parsed = array();
                         AJXP_Utils::parseStandardFormParameters($formsData, $parsed, $userObject != null ? $usrId : null, "ROLE_PARAM_", $binariesContext, AJXP_Role::$cypheredPassPrefix);
                         $roleData["PARAMETERS"][$repoScope][$plugId] = $parsed;
                     }
                 }
             } else {
                 AJXP_Utils::filterFormElementsFromMeta($data["METADATA"], $roleData, $userObject != null ? $usrId : null, $binariesContext, AJXP_Role::$cypheredPassPrefix);
             }
             $existingParameters = $originalRole->listParameters(true);
             $this->mergeExistingParameters($roleData["PARAMETERS"], $existingParameters);
             if (isset($userObject) && isset($data["USER"]) && isset($data["USER"]["PROFILE"])) {
                 $userObject->setAdmin($data["USER"]["PROFILE"] == "admin");
                 $userObject->setProfile($data["USER"]["PROFILE"]);
             }
             if (isset($data["GROUP_LABEL"]) && isset($groupLabel) && $groupLabel != $data["GROUP_LABEL"]) {
                 ConfService::getConfStorageImpl()->relabelGroup($filteredGroupPath, $data["GROUP_LABEL"]);
             }
             if ($currentUserIsGroupAdmin) {
                 // FILTER DATA FOR GROUP ADMINS
                 $params = $this->getEditableParameters(false);
                 foreach ($roleData["PARAMETERS"] as $scope => &$plugsParameters) {
                     foreach ($plugsParameters as $paramPlugin => &$parameters) {
                         foreach ($parameters as $pName => $pValue) {
                             if (!isset($params[$paramPlugin]) || !in_array($pName, $params[$paramPlugin])) {
                                 unset($parameters[$pName]);
                             }
                         }
                         if (!count($parameters)) {
                             unset($plugsParameters[$paramPlugin]);
                         }
                     }
                     if (!count($plugsParameters)) {
                         unset($roleData["PARAMETERS"][$scope]);
                     }
                 }
                 // Remerge from parent
                 $roleData["PARAMETERS"] = $originalRole->array_merge_recursive2($originalRole->listParameters(), $roleData["PARAMETERS"]);
                 // Changing Actions is not allowed
                 $roleData["ACTIONS"] = $originalRole->listActionsStates();
开发者ID:thermalpaste,项目名称:pydio-core,代码行数:67,代码来源:class.ajxp_confAccessDriver.php


注:本文中的AJXP_Utils::filterFormElementsFromMeta方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。