當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。