Rename the table to a valid name
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
2c9007616b
commit
2dc79efb32
|
@ -5,7 +5,7 @@
|
||||||
<overwrite>false</overwrite>
|
<overwrite>false</overwrite>
|
||||||
<charset>utf8</charset>
|
<charset>utf8</charset>
|
||||||
<table>
|
<table>
|
||||||
<name>*dbprefix*twofactor_backup_codes</name>
|
<name>*dbprefix*twofactor_backupcodes</name>
|
||||||
<declaration>
|
<declaration>
|
||||||
<field>
|
<field>
|
||||||
<name>id</name>
|
<name>id</name>
|
||||||
|
|
|
@ -22,13 +22,14 @@
|
||||||
namespace OCA\TwoFactorBackupCodes\Db;
|
namespace OCA\TwoFactorBackupCodes\Db;
|
||||||
|
|
||||||
use OCP\AppFramework\Db\Mapper;
|
use OCP\AppFramework\Db\Mapper;
|
||||||
|
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||||
use OCP\IDBConnection;
|
use OCP\IDBConnection;
|
||||||
use OCP\IUser;
|
use OCP\IUser;
|
||||||
|
|
||||||
class BackupCodeMapper extends Mapper {
|
class BackupCodeMapper extends Mapper {
|
||||||
|
|
||||||
public function __construct(IDBConnection $db) {
|
public function __construct(IDBConnection $db) {
|
||||||
parent::__construct($db, 'twofactor_backup_codes');
|
parent::__construct($db, 'twofactor_backupcodes');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,7 +41,7 @@ class BackupCodeMapper extends Mapper {
|
||||||
$qb = $this->db->getQueryBuilder();
|
$qb = $this->db->getQueryBuilder();
|
||||||
|
|
||||||
$qb->select('id', 'user_id', 'code', 'used')
|
$qb->select('id', 'user_id', 'code', 'used')
|
||||||
->from('twofactor_backup_codes')
|
->from('twofactor_backupcodes')
|
||||||
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($user->getUID())));
|
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($user->getUID())));
|
||||||
$result = $qb->execute();
|
$result = $qb->execute();
|
||||||
|
|
||||||
|
@ -66,7 +67,7 @@ class BackupCodeMapper extends Mapper {
|
||||||
/* @var IQueryBuilder $qb */
|
/* @var IQueryBuilder $qb */
|
||||||
$qb = $this->db->getQueryBuilder();
|
$qb = $this->db->getQueryBuilder();
|
||||||
|
|
||||||
$qb->delete('twofactor_backup_codes')
|
$qb->delete('twofactor_backupcodes')
|
||||||
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($uid)));
|
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($uid)));
|
||||||
$qb->execute();
|
$qb->execute();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue