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


PHP AuthService::getAuthScheme方法代码示例

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


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

示例1: listUsers


//.........这里部分代码省略.........
     if (!$returnNodes) {
         AJXP_XMLWriter::sendFilesListComponentConfig($columns);
     }
     if (!AuthService::usersEnabled()) {
         return array();
     }
     if (empty($hashValue)) {
         $hashValue = 1;
     }
     $count = AuthService::authCountUsers($baseGroup, "", null, null, false);
     if (AuthService::authSupportsPagination() && $count >= $USER_PER_PAGE) {
         $offset = ($hashValue - 1) * $USER_PER_PAGE;
         if (!$returnNodes) {
             AJXP_XMLWriter::renderPaginationData($count, $hashValue, ceil($count / $USER_PER_PAGE));
         }
         $users = AuthService::listUsers($baseGroup, "", $offset, $USER_PER_PAGE, true, false);
         if ($hashValue == 1) {
             $groups = AuthService::listChildrenGroups($baseGroup);
         } else {
             $groups = array();
         }
     } else {
         $users = AuthService::listUsers($baseGroup, "", -1, -1, true, false);
         $groups = AuthService::listChildrenGroups($baseGroup);
     }
     foreach ($groups as $groupId => $groupLabel) {
         $nodeKey = "/data/" . $root . "/" . ltrim($groupId, "/");
         $meta = array("icon" => "users-folder.png", "ajxp_mime" => "group", "object_id" => $groupId);
         if (in_array($nodeKey, $this->currentBookmarks)) {
             $meta = array_merge($meta, array("ajxp_bookmarked" => "true", "overlay_icon" => "bookmark.png"));
         }
         $xml = AJXP_XMLWriter::renderNode($nodeKey, $groupLabel, false, $meta, true, false);
         if (!$returnNodes) {
             print $xml;
         } else {
             $allNodes[$nodeKey] = $xml;
         }
     }
     $mess = ConfService::getMessages();
     $loggedUser = AuthService::getLoggedUser();
     $userArray = array();
     foreach ($users as $userObject) {
         $label = $userObject->getId();
         if ($userObject->hasParent()) {
             $label = $userObject->getParent() . "000" . $label;
         } else {
             $children = ConfService::getConfStorageImpl()->getUserChildren($label);
             foreach ($children as $addChild) {
                 $userArray[$label . "000" . $addChild->getId()] = $addChild;
             }
         }
         $userArray[$label] = $userObject;
     }
     ksort($userArray);
     foreach ($userArray as $userObject) {
         $repos = ConfService::getConfStorageImpl()->listRepositories($userObject);
         $isAdmin = $userObject->isAdmin();
         $userId = $userObject->getId();
         $icon = "user" . ($userId == "guest" ? "_guest" : ($isAdmin ? "_admin" : ""));
         if ($userObject->hasParent()) {
             $icon = "user_child";
         }
         if ($isAdmin) {
             $rightsString = $mess["ajxp_conf.63"];
         } else {
             $r = array();
             foreach ($repos as $repoId => $repository) {
                 if ($repository->getAccessType() == "ajxp_shared") {
                     continue;
                 }
                 if (!$userObject->canRead($repoId) && !$userObject->canWrite($repoId)) {
                     continue;
                 }
                 $rs = $userObject->canRead($repoId) ? "r" : "";
                 $rs .= $userObject->canWrite($repoId) ? "w" : "";
                 $r[] = $repository->getDisplay() . " (" . $rs . ")";
             }
             $rightsString = implode(", ", $r);
         }
         $nodeLabel = $userId;
         $test = $userObject->personalRole->filterParameterValue("core.conf", "USER_DISPLAY_NAME", AJXP_REPO_SCOPE_ALL, "");
         if (!empty($test)) {
             $nodeLabel = $test;
         }
         $scheme = AuthService::getAuthScheme($userId);
         $nodeKey = "/data/{$root}/" . $userId;
         $roles = array_filter(array_keys($userObject->getRoles()), array($this, "filterReservedRoles"));
         $meta = array("isAdmin" => $mess[$isAdmin ? "ajxp_conf.14" : "ajxp_conf.15"], "icon" => $icon . ".png", "object_id" => $userId, "auth_scheme" => $scheme != null ? $scheme : "", "rights_summary" => $rightsString, "ajxp_roles" => implode(", ", $roles), "ajxp_mime" => "user" . ($userId != "guest" && $userId != $loggedUser->getId() ? "_editable" : ""));
         if (in_array($nodeKey, $this->currentBookmarks)) {
             $meta = array_merge($meta, array("ajxp_bookmarked" => "true", "overlay_icon" => "bookmark.png"));
         }
         $xml = AJXP_XMLWriter::renderNode($nodeKey, $nodeLabel, true, $meta, true, false);
         if (!$returnNodes) {
             print $xml;
         } else {
             $allNodes[$nodeKey] = $xml;
         }
     }
     return $allNodes;
 }
开发者ID:rcmarotz,项目名称:pydio-core,代码行数:101,代码来源:class.ajxp_confAccessDriver.php

示例2: listUsers

 function listUsers($root, $child, $hashValue = null)
 {
     $columns = '<columns switchGridMode="filelist" template_name="ajxp_conf.users">
     			<column messageId="ajxp_conf.6" attributeName="ajxp_label" sortType="String" defaultWidth="40%"/>
     			<column messageId="ajxp_conf.7" attributeName="isAdmin" sortType="String" defaultWidth="10%"/>
     			<column messageId="ajxp_conf.70" attributeName="ajxp_roles" sortType="String" defaultWidth="15%"/>
     			<column messageId="ajxp_conf.62" attributeName="rights_summary" sortType="String" defaultWidth="15%"/>
     			</columns>';
     if (AuthService::driverSupportsAuthSchemes()) {
         $columns = '<columns switchGridMode="filelist" template_name="ajxp_conf.users">
         			<column messageId="ajxp_conf.6" attributeName="ajxp_label" sortType="String" defaultWidth="40%"/>
         			<column messageId="ajxp_conf.115" attributeName="auth_scheme" sortType="String" defaultWidth="5%"/>
         			<column messageId="ajxp_conf.7" attributeName="isAdmin" sortType="String" defaultWidth="5%"/>
         			<column messageId="ajxp_conf.70" attributeName="ajxp_roles" sortType="String" defaultWidth="15%"/>
         			<column messageId="ajxp_conf.62" attributeName="rights_summary" sortType="String" defaultWidth="15%"/>
         </columns>';
     }
     AJXP_XMLWriter::sendFilesListComponentConfig($columns);
     if (!AuthService::usersEnabled()) {
         return;
     }
     $count = AuthService::authCountUsers();
     $USER_PER_PAGE = 50;
     if (empty($hashValue)) {
         $hashValue = 1;
     }
     if (AuthService::authSupportsPagination() && $count > $USER_PER_PAGE) {
         $offset = ($hashValue - 1) * $USER_PER_PAGE;
         AJXP_XMLWriter::renderPaginationData($count, $hashValue, ceil($count / $USER_PER_PAGE));
         $users = AuthService::listUsers("", $offset, $USER_PER_PAGE);
     } else {
         $users = AuthService::listUsers();
     }
     $mess = ConfService::getMessages();
     $repos = ConfService::getRepositoriesList();
     $loggedUser = AuthService::getLoggedUser();
     $userArray = array();
     foreach ($users as $userIndex => $userObject) {
         $label = $userObject->getId();
         if ($userObject->hasParent()) {
             $label = $userObject->getParent() . "000" . $label;
         }
         $userArray[$label] = $userObject;
     }
     ksort($userArray);
     foreach ($userArray as $userObject) {
         $isAdmin = $userObject->isAdmin();
         $userId = $userObject->getId();
         $icon = "user" . ($userId == "guest" ? "_guest" : ($isAdmin ? "_admin" : ""));
         if ($userObject->hasParent()) {
             $icon = "user_child";
         }
         $rightsString = "";
         if ($isAdmin) {
             $rightsString = $mess["ajxp_conf.63"];
         } else {
             $r = array();
             foreach ($repos as $repoId => $repository) {
                 if ($repository->getAccessType() == "ajxp_shared") {
                     continue;
                 }
                 if (!$userObject->canRead($repoId) && !$userObject->canWrite($repoId)) {
                     continue;
                 }
                 $rs = $userObject->canRead($repoId) ? "r" : "";
                 $rs .= $userObject->canWrite($repoId) ? "w" : "";
                 $r[] = $repository->getDisplay() . " (" . $rs . ")";
             }
             $rightsString = implode(", ", $r);
         }
         $nodeLabel = $userId;
         $scheme = AuthService::getAuthScheme($userId);
         AJXP_XMLWriter::renderNode("/users/" . $userId, $nodeLabel, true, array("isAdmin" => $mess[$isAdmin ? "ajxp_conf.14" : "ajxp_conf.15"], "icon" => $icon . ".png", "auth_scheme" => $scheme != null ? $scheme : "", "rights_summary" => $rightsString, "ajxp_roles" => implode(", ", array_keys($userObject->getRoles())), "ajxp_mime" => "user" . ($userId != "guest" && $userId != $loggedUser->getId() ? "_editable" : "")));
     }
 }
开发者ID:crodriguezn,项目名称:administrator-files,代码行数:75,代码来源:class.ajxp_confAccessDriver.php


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