Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Rename the table to a valid name
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen authored and MorrisJobke committed May 15, 2017
commit 2dc79efb32ed268637489a5411ca36aed5da9b45
2 changes: 1 addition & 1 deletion apps/twofactor_backupcodes/appinfo/database.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<overwrite>false</overwrite>
<charset>utf8</charset>
<table>
<name>*dbprefix*twofactor_backup_codes</name>
<name>*dbprefix*twofactor_backupcodes</name>
<declaration>
<field>
<name>id</name>
Expand Down
7 changes: 4 additions & 3 deletions apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
namespace OCA\TwoFactorBackupCodes\Db;

use OCP\AppFramework\Db\Mapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\IUser;

class BackupCodeMapper extends Mapper {

public function __construct(IDBConnection $db) {
parent::__construct($db, 'twofactor_backup_codes');
parent::__construct($db, 'twofactor_backupcodes');
}

/**
Expand All @@ -40,7 +41,7 @@ public function getBackupCodes(IUser $user) {
$qb = $this->db->getQueryBuilder();

$qb->select('id', 'user_id', 'code', 'used')
->from('twofactor_backup_codes')
->from('twofactor_backupcodes')
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($user->getUID())));
$result = $qb->execute();

Expand All @@ -66,7 +67,7 @@ public function deleteCodesByUserId($uid) {
/* @var IQueryBuilder $qb */
$qb = $this->db->getQueryBuilder();

$qb->delete('twofactor_backup_codes')
$qb->delete('twofactor_backupcodes')
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($uid)));
$qb->execute();
}
Expand Down