本文整理汇总了PHP中OC_Group::getManager方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Group::getManager方法的具体用法?PHP OC_Group::getManager怎么用?PHP OC_Group::getManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Group
的用法示例。
在下文中一共展示了OC_Group::getManager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(array $urlParams = array())
{
parent::__construct('User_Servervars2', $urlParams);
$container = $this->getContainer();
// Controller
/* $container->registerService('PageController', function ($c) {
return new PageController();
}); */
$container->registerService('TokensFactory', function ($c) {
return new TokensFactory($c->query('ServerContainer')->getAppConfig());
});
$container->registerService('Tokens', function ($c) {
return $c->query('TokensFactory')->getTokens();
});
// Service
$container->registerService('TokenService', function ($c) {
return new TokenService($c->query('Tokens'));
});
$container->registerService('GroupManager', function ($c) {
return \OC_Group::getManager();
// return new \OC\Group\Manager(
// $c->query('ServerContainer')->getUserManager()
// );
});
// Service
$container->registerService('UserAndGroupService', function ($c) {
return new ProxyUserAndGroupService($c->query('ServerContainer')->getUserManager(), $c->query('GroupManager'), $c->query('GroupNamingServiceFactory')->getGroupNamingService(), $c->query('UserBackend'), $c->query('ServerContainer')->getConfig());
});
$container->registerService('GroupNamingServiceFactory', function ($c) {
return new \OCA\User_Servervars2\Service\GroupNamingServiceFactory($c->query('ServerContainer')->getAppConfig());
});
// Interceptor
$container->registerService('Interceptor', function ($c) {
return new Interceptor($c->query('ServerContainer')->getAppConfig(), $c->query('Tokens'), $c->query('UserAndGroupService'));
});
// Hooks
$container->registerService('ServerVarsHooks', function ($c) {
return new ServerVarsHooks($c->query('TokenService'), $c->query('UserAndGroupService'), $c->query('ServerContainer')->getAppConfig());
});
// Backend
$container->registerService('UserBackend', function ($c) {
return new UserBackend($c->query('TokenService'), $c->query('ServerContainer')->getAppConfig());
});
// MetadataProvider
// Backend
$container->registerService('MetadataProvider', function ($c) {
return new MetadataProvider($c->query('MetadataMapper'));
});
// Mappers
$container->registerService('MetadataMapper', function ($c) {
return new MetadataMapper();
});
// Mappers
$container->registerService('SettingsController', function ($c) {
return new SettingsController($c->query('Request'), $c->query('ServerContainer')->getAppConfig());
});
}
示例2: __construct
public function __construct(array $urlParams = array())
{
parent::__construct('gatekeeper', $urlParams);
$container = $this->getContainer();
// Hooks
$container->registerService('GateKeeperHooks', function ($c) {
return new \OCA\GateKeeper\Hooks\GateKeeperHooks($c->query('GateKeeperService'), $c->query('Logger'));
});
// Service
$container->registerService('GateKeeperService', function ($c) {
return new \OCA\GateKeeper\Service\GateKeeperService($c->query('ServerContainer')->getAppConfig()->getValue('gatekeeper', 'mode'), $c->query('ServerContainer')->getSession(), $c->query('AccessObjectMapper'), $c->query('GroupManager'), GKHelper::isRemote(), $c->query('ServerContainer')->getAppConfig()->getValue('gatekeeper', 'refresh_delay'));
});
// Mapper
$container->registerService('AccessObjectMapper', function ($c) {
return new \OCA\GateKeeper\Db\AccessObjectMapper($c->query('ServerContainer')->getDb());
});
// groupManager
$container->registerService('GroupManager', function ($c) {
return \OC_Group::getManager();
});
// - logger -
$container->registerService('Logger', function ($c) {
return $c->query('ServerContainer')->getLogger();
});
$container->registerService('Interceptor', function ($c) {
return new \OCA\GateKeeper\AppInfo\Interceptor($c->query('ServerContainer')->getUserSession(), \OC_User::isLoggedIn(), $c->query('GateKeeperService'), $c->query('L10N'), $c->query('DenyLogger'));
});
$container->registerService('L10N', function ($c) {
return $c->query('ServerContainer')->getL10N($c->query('AppName'));
});
$container->registerService('SettingsController', function ($c) {
return new \OCA\GateKeeper\Controller\SettingsController($c->query('Request'), $c->query('ServerContainer')->getAppConfig(), $c->query('AccessObjectMapper'), $c->query('GroupManager'));
});
$container->registerService('DenyLoggerFactory', function ($c) {
return new \OCA\GateKeeper\Lib\DenyLoggerFactory($c->query('ServerContainer')->getAppConfig());
});
$container->registerService('DenyLogger', function ($c) {
return $c->query('DenyLoggerFactory')->getInstance();
});
}
示例3:
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
OC_Util::checkSubAdminUser();
OC_App::setActiveNavigationEntry('core_users');
$userManager = \OC_User::getManager();
$groupManager = \OC_Group::getManager();
// Set the sort option: SORT_USERCOUNT or SORT_GROUPNAME
$sortGroupsBy = \OC\Group\MetaData::SORT_USERCOUNT;
if (\OC_App::isEnabled('user_ldap')) {
$isLDAPUsed = $groupManager->isBackendUsed('\\OCA\\user_ldap\\GROUP_LDAP') || $groupManager->isBackendUsed('\\OCA\\user_ldap\\Group_Proxy');
if ($isLDAPUsed) {
// LDAP user count can be slow, so we sort by group name here
$sortGroupsBy = \OC\Group\MetaData::SORT_GROUPNAME;
}
}
$config = \OC::$server->getConfig();
$isAdmin = OC_User::isAdminUser(OC_User::getUser());
$groupsInfo = new \OC\Group\MetaData(OC_User::getUser(), $isAdmin, $groupManager);
$groupsInfo->setSorting($sortGroupsBy);
list($adminGroup, $groups) = $groupsInfo->get();
$recoveryAdminEnabled = OC_App::isEnabled('encryption') && $config->getAppValue('encryption', 'recoveryAdminEnabled', null);
示例4: checkSingleUserMode
public static function checkSingleUserMode() {
$user = OC_User::getUserSession()->getUser();
$group = OC_Group::getManager()->get('admin');
if ($user && \OC::$server->getSystemConfig()->getValue('singleuser', false) && !$group->inGroup($user)) {
// send http status 503
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 120');
// render error page
$tmpl = new OC_Template('', 'singleuser.user', 'guest');
$tmpl->printPage();
die();
}
}