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


PHP User::getDisplayNames方法代码示例

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


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

示例1: index

 /**
  * @NoAdminRequired
  *
  * @param int $offset
  * @param int $limit
  * @param string $gid GID to filter for
  * @param string $pattern Pattern to search for in the username
  * @param string $backend Backend to filter for (class-name)
  * @return DataResponse
  *
  * TODO: Tidy up and write unit tests - code is mainly static method calls
  */
 public function index($offset = 0, $limit = 10, $gid = '', $pattern = '', $backend = '')
 {
     // FIXME: The JS sends the group '_everyone' instead of no GID for the "all users" group.
     if ($gid === '_everyone') {
         $gid = '';
     }
     // Remove backends
     if (!empty($backend)) {
         $activeBackends = $this->userManager->getBackends();
         $this->userManager->clearBackends();
         foreach ($activeBackends as $singleActiveBackend) {
             if ($backend === get_class($singleActiveBackend)) {
                 $this->userManager->registerBackend($singleActiveBackend);
                 break;
             }
         }
     }
     //$users = ($gid !== '') ? Data::readGroupUsers($gid) : Data::readAllUsers();
     $users = \OCP\User::getDisplayNames();
     ksort($users, SORT_NATURAL | SORT_FLAG_CASE);
     $users = array_diff($users, array(User::getUser()));
     $users = array_slice($users, 0);
     return new DataResponse(array('data' => $users, 'status' => 'success'));
 }
开发者ID:inwinstack,项目名称:owncloud-sharing_group,代码行数:36,代码来源:usercontroller.php

示例2: array

<?php

OCP\JSON::checkAppEnabled('files_external');
OCP\JSON::callCheck();
OCP\JSON::checkAdminUser();
$pattern = '';
$limit = null;
$offset = null;
if (isset($_GET['pattern'])) {
    $pattern = $_GET['pattern'];
}
if (isset($_GET['limit'])) {
    $limit = $_GET['limit'];
}
if (isset($_GET['offset'])) {
    $offset = $_GET['offset'];
}
$groups = \OC_Group::getGroups($pattern, $limit, $offset);
$users = \OCP\User::getDisplayNames($pattern, $limit, $offset);
$results = array('groups' => $groups, 'users' => $users);
\OCP\JSON::success($results);
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:21,代码来源:applicable.php


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