summaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication/Token/DefaultTokenMapper.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@owncloud.com>2016-05-19 11:20:22 +0200
committerChristoph Wurst <christoph@owncloud.com>2016-05-23 09:11:12 +0200
commit74277c25be2f3231e52a73a684bd14452a9ff2aa (patch)
treeca68eac57db357563e64e9f323df667fcc28f8f6 /lib/private/Authentication/Token/DefaultTokenMapper.php
parent6495534bcdbbda8aa2748cc9f5d94dcb2bc7a04a (diff)
downloadnextcloud-server-74277c25be2f3231e52a73a684bd14452a9ff2aa.tar.gz
nextcloud-server-74277c25be2f3231e52a73a684bd14452a9ff2aa.zip
add button to invalidate browser sessions/device tokens
Diffstat (limited to 'lib/private/Authentication/Token/DefaultTokenMapper.php')
-rw-r--r--lib/private/Authentication/Token/DefaultTokenMapper.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/private/Authentication/Token/DefaultTokenMapper.php b/lib/private/Authentication/Token/DefaultTokenMapper.php
index 9f173571270..970c2242dbe 100644
--- a/lib/private/Authentication/Token/DefaultTokenMapper.php
+++ b/lib/private/Authentication/Token/DefaultTokenMapper.php
@@ -111,4 +111,17 @@ class DefaultTokenMapper extends Mapper {
return $entities;
}
+ /**
+ * @param IUser $user
+ * @param int $id
+ */
+ public function deleteById(IUser $user, $id) {
+ /* @var $qb IQueryBuilder */
+ $qb = $this->db->getQueryBuilder();
+ $qb->delete('authtoken')
+ ->where($qb->expr()->eq('id', $qb->createNamedParameter($id)))
+ ->andWhere($qb->expr()->eq('uid', $qb->createNamedParameter($user->getUID())));
+ $qb->execute();
+ }
+
}