本文整理汇总了PHP中OCP\IConfig::getUsersForUserValue方法的典型用法代码示例。如果您正苦于以下问题:PHP IConfig::getUsersForUserValue方法的具体用法?PHP IConfig::getUsersForUserValue怎么用?PHP IConfig::getUsersForUserValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\IConfig
的用法示例。
在下文中一共展示了IConfig::getUsersForUserValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchDeletedUsers
/**
* reads LDAP users marked as deleted from the database
* @return OCA\user_ldap\lib\user\OfflineUser[]
*/
private function fetchDeletedUsers()
{
$deletedUsers = $this->config->getUsersForUserValue('user_ldap', 'isDeleted', '1');
$userObjects = array();
foreach ($deletedUsers as $user) {
$userObjects[] = new OfflineUser($user, $this->config, $this->db, $this->mapping);
}
$this->deletedUsers = $userObjects;
return $this->deletedUsers;
}
示例2: getByEmail
/**
* @param string $email
* @return IUser[]
* @since 9.1.0
*/
public function getByEmail($email)
{
$userIds = $this->config->getUsersForUserValue('settings', 'email', $email);
return array_map(function ($uid) {
return $this->get($uid);
}, $userIds);
}
示例3: getUserFromToken
/**
* Get the user for the token
*
* @return string
* @throws \UnexpectedValueException If the token is invalid, does not exist or is not unique
*/
protected function getUserFromToken()
{
$token = (string) $this->request->getParam('token', '');
if (strlen($token) !== 30) {
throw new \UnexpectedValueException('The token is invalid');
}
$users = $this->config->getUsersForUserValue('activity', 'rsstoken', $token);
if (sizeof($users) !== 1) {
// No unique user found
throw new \UnexpectedValueException('The token is invalid');
}
// Token found login as that user
return array_shift($users);
}
示例4: feed
/**
* @NoAdminRequired
*
* @param string $enable 'true' if the feed is enabled
* @return DataResponse
*/
public function feed($enable)
{
$token = $tokenUrl = '';
if ($enable === 'true') {
$conflicts = true;
// Check for collisions
while (!empty($conflicts)) {
$token = $this->random->generate(30);
$conflicts = $this->config->getUsersForUserValue('activity', 'rsstoken', $token);
}
$tokenUrl = $this->urlGenerator->linkToRouteAbsolute('activity.Feed.show', ['token' => $token]);
}
$this->config->setUserValue($this->user, 'activity', 'rsstoken', $token);
return new DataResponse(array('data' => array('message' => (string) $this->l10n->t('Your settings have been updated.'), 'rsslink' => $tokenUrl)));
}
示例5: getUsersForValue
/**
* Gets the users for a preference
* @param string $app
* @param string $key
* @param string $value
* @return array
* @deprecated use getUsersForUserValue of \OCP\IConfig instead
*/
public function getUsersForValue($app, $key, $value)
{
return $this->config->getUsersForUserValue($app, $key, $value);
}