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


PHP OC_Group::displayNamesInGroups方法代码示例

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


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

示例1: array

OC_Util::addScript('core', 'multiselect');
OC_Util::addScript('core', 'singleselect');
OC_Util::addScript('core', 'jquery.inview');
OC_Util::addStyle('settings', 'settings');
OC_App::setActiveNavigationEntry('core_users');
$users = array();
$groups = array();
$isadmin = OC_User::isAdminUser(OC_User::getUser());
$recoveryAdminEnabled = OC_App::isEnabled('files_encryption') && OC_Appconfig::getValue('files_encryption', 'recoveryAdminEnabled');
if ($isadmin) {
    $accessiblegroups = OC_Group::getGroups();
    $accessibleusers = OC_User::getDisplayNames('', 30);
    $subadmins = OC_SubAdmin::getAllSubAdmins();
} else {
    $accessiblegroups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser());
    $accessibleusers = OC_Group::displayNamesInGroups($accessiblegroups, '', 30);
    $subadmins = false;
}
// load preset quotas
$quotaPreset = OC_Appconfig::getValue('files', 'quota_preset', '1 GB, 5 GB, 10 GB');
$quotaPreset = explode(',', $quotaPreset);
foreach ($quotaPreset as &$preset) {
    $preset = trim($preset);
}
$quotaPreset = array_diff($quotaPreset, array('default', 'none'));
$defaultQuota = OC_Appconfig::getValue('files', 'default_quota', 'none');
$defaultQuotaIsUserDefined = array_search($defaultQuota, $quotaPreset) === false && array_search($defaultQuota, array('none', 'default')) === false;
// load users and quota
foreach ($accessibleusers as $uid => $displayName) {
    $quota = OC_Preferences::getValue($uid, 'files', 'quota', 'default');
    $isQuotaUserDefined = array_search($quota, $quotaPreset) === false && array_search($quota, array('none', 'default')) === false;
开发者ID:omusico,项目名称:isle-web-framework,代码行数:31,代码来源:users.php

示例2: array

         $sharedGroups = $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP];
     }
     if (isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_SHARING_GROUP]) && is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_SHARING_GROUP])) {
         $sharedSharingGroups = $_GET['itemShares'][OCP\Share::SHARE_TYPE_SHARING_GROUP];
     }
 }
 $count = 0;
 $users = array();
 $limit = 0;
 $offset = 0;
 // limit defaults to 15 if not specified via request parameter and can be no larger than 500
 $request_limit = min((int) $_GET['limit'] ?: 15, 500);
 while ($count < $request_limit && count($users) == $limit) {
     $limit = $request_limit - $count;
     if ($shareWithinGroupOnly) {
         $users = OC_Group::displayNamesInGroups($usergroups, (string) $_GET['search'], $limit, $offset);
     } else {
         $users = OC_User::getDisplayNames((string) $_GET['search'], $limit, $offset);
     }
     $offset += $limit;
     foreach ($users as $uid => $displayName) {
         if (in_array($uid, $sharedUsers)) {
             continue;
         }
         if ((!isset($_GET['itemShares']) || !is_array((string) $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]) || !in_array($uid, (string) $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])) && $uid != OC_User::getUser()) {
             $shareWith[] = array('label' => $displayName, 'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER, 'shareWith' => $uid));
             $count++;
         }
     }
 }
 $count = 0;
开发者ID:yheric455042,项目名称:owncloud82,代码行数:31,代码来源:share.php

示例3: list

$groupsInfo = new \OC\Group\MetaData(OC_User::getUser(), $isAdmin, $groupManager);
$groupsInfo->setSorting($groupsInfo::SORT_USERCOUNT);
list($adminGroup, $groups) = $groupsInfo->get();
$recoveryAdminEnabled = OC_App::isEnabled('files_encryption') && OC_Appconfig::getValue('files_encryption', 'recoveryAdminEnabled');
if ($isAdmin) {
    $accessibleUsers = OC_User::getDisplayNames('', 30);
    $subadmins = OC_SubAdmin::getAllSubAdmins();
} else {
    /* Retrieve group IDs from $groups array, so we can pass that information into OC_Group::displayNamesInGroups() */
    $gids = array();
    foreach ($groups as $group) {
        if (isset($group['id'])) {
            $gids[] = $group['id'];
        }
    }
    $accessibleUsers = OC_Group::displayNamesInGroups($gids, '', 30);
    $subadmins = false;
}
// load preset quotas
$quotaPreset = OC_Appconfig::getValue('files', 'quota_preset', '1 GB, 5 GB, 10 GB');
$quotaPreset = explode(',', $quotaPreset);
foreach ($quotaPreset as &$preset) {
    $preset = trim($preset);
}
$quotaPreset = array_diff($quotaPreset, array('default', 'none'));
$defaultQuota = OC_Appconfig::getValue('files', 'default_quota', 'none');
$defaultQuotaIsUserDefined = array_search($defaultQuota, $quotaPreset) === false && array_search($defaultQuota, array('none', 'default')) === false;
// load users and quota
foreach ($accessibleUsers as $uid => $displayName) {
    $quota = OC_Preferences::getValue($uid, 'files', 'quota', 'default');
    $isQuotaUserDefined = array_search($quota, $quotaPreset) === false && array_search($quota, array('none', 'default')) === false;
开发者ID:Romua1d,项目名称:core,代码行数:31,代码来源:users.php


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