summaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication/TwoFactorAuth/Db
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-01-08 10:51:44 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-01-08 10:51:44 +0100
commit60d4b45e8924b2d8ccc2326a1f463ee9dae32905 (patch)
treebde191dd49f493e70749b56215aff7415128723e /lib/private/Authentication/TwoFactorAuth/Db
parent69ae7abe72fd032adbec1c7dc01fca64aea2fbe8 (diff)
downloadnextcloud-server-60d4b45e8924b2d8ccc2326a1f463ee9dae32905.tar.gz
nextcloud-server-60d4b45e8924b2d8ccc2326a1f463ee9dae32905.zip
Clean up 2FA provider registry when a user is deleted
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Authentication/TwoFactorAuth/Db')
-rw-r--r--lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php b/lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php
index adf16887efa..4e8f9731d94 100644
--- a/lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php
+++ b/lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php
@@ -93,6 +93,15 @@ class ProviderUserAssignmentDao {
}
+ public function deleteByUser(string $uid) {
+ $qb = $this->conn->getQueryBuilder();
+
+ $deleteQuery = $qb->delete(self::TABLE_NAME)
+ ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid)));
+
+ $deleteQuery->execute();
+ }
+
public function deleteAll(string $providerId) {
$qb = $this->conn->getQueryBuilder();