summaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php')
-rw-r--r--apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php b/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php
index 85cc174fb6a..ff993683c59 100644
--- a/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php
+++ b/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php
@@ -52,12 +52,22 @@ class BackupCodeMapper extends Mapper {
}, $rows);
}
+ /**
+ * @param IUser $user
+ */
public function deleteCodes(IUser $user) {
+ $this->deleteCodesByUserId($user->getUID());
+ }
+
+ /**
+ * @param string $uid
+ */
+ public function deleteCodesByUserId($uid) {
/* @var IQueryBuilder $qb */
$qb = $this->db->getQueryBuilder();
$qb->delete('twofactor_backup_codes')
- ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($user->getUID())));
+ ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($uid)));
$qb->execute();
}