diff options
author | Christoph Wurst <christoph@owncloud.com> | 2016-05-18 11:33:56 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@owncloud.com> | 2016-05-18 18:25:37 +0200 |
commit | 062657873911bd1c1c633a5b4944ebc6f4781ea8 (patch) | |
tree | e92d6db32caf0265f8085e62aee2037d016da425 /lib/private/Authentication/Token/DefaultTokenProvider.php | |
parent | dc0e3617dc1c5a3d4c4fbc67e6bae957e5afff8e (diff) | |
download | nextcloud-server-062657873911bd1c1c633a5b4944ebc6f4781ea8.tar.gz nextcloud-server-062657873911bd1c1c633a5b4944ebc6f4781ea8.zip |
add method to query all user auth tokens
Diffstat (limited to 'lib/private/Authentication/Token/DefaultTokenProvider.php')
-rw-r--r-- | lib/private/Authentication/Token/DefaultTokenProvider.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/private/Authentication/Token/DefaultTokenProvider.php b/lib/private/Authentication/Token/DefaultTokenProvider.php index a335b79e332..6c69d852d7b 100644 --- a/lib/private/Authentication/Token/DefaultTokenProvider.php +++ b/lib/private/Authentication/Token/DefaultTokenProvider.php @@ -28,6 +28,7 @@ use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Utility\ITimeFactory; use OCP\IConfig; use OCP\ILogger; +use OCP\IUser; use OCP\Security\ICrypto; class DefaultTokenProvider implements IProvider { @@ -103,6 +104,19 @@ class DefaultTokenProvider implements IProvider { } /** + * Get all token of a user + * + * The provider may limit the number of result rows in case of an abuse + * where a high number of (session) tokens is generated + * + * @param IUser $user + * @return IToken[] + */ + public function getTokenByUser(IUser $user) { + return $this->mapper->getTokenByUser($user); + } + + /** * Get a token by token id * * @param string $tokenId |