diff --git a/src/Application/Controller/Admin/d3user_totp.php b/src/Application/Controller/Admin/d3user_totp.php index 04b7b81..37bd028 100644 --- a/src/Application/Controller/Admin/d3user_totp.php +++ b/src/Application/Controller/Admin/d3user_totp.php @@ -166,6 +166,6 @@ class d3user_totp extends AdminDetailsController public function getAvailableBackupCodeCount() { $oBackupCodeList = $this->getBackupcodeListObject(); - return $oBackupCodeList->getAvailableCodeCount($this->getUser()->getId()); + return $oBackupCodeList->getAvailableCodeCount($this->getEditObjectId()); } } \ No newline at end of file diff --git a/src/Application/Model/d3totp.php b/src/Application/Model/d3totp.php index bab1ad5..e798da8 100644 --- a/src/Application/Model/d3totp.php +++ b/src/Application/Model/d3totp.php @@ -51,7 +51,6 @@ class d3totp extends BaseModel /** * @param $userId - * @return bool * @throws DBALException * @throws DatabaseConnectionException */ @@ -66,10 +65,8 @@ class d3totp extends BaseModel ->where("oxuserid = " . $oQB->createNamedParameter($userId)) ->setMaxResults(1); - return $this->load(DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getOne($oQB->getSQL(), $oQB->getParameters())); + $this->load(DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getOne($oQB->getSQL(), $oQB->getParameters())); } - - return false; } /** diff --git a/src/Application/views/admin/tpl/d3user_totp.tpl b/src/Application/views/admin/tpl/d3user_totp.tpl index a610382..8d73e9c 100644 --- a/src/Application/views/admin/tpl/d3user_totp.tpl +++ b/src/Application/views/admin/tpl/d3user_totp.tpl @@ -1,6 +1,8 @@ [{include file="headitem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}] [{assign var="totp" value=$edit->d3GetTotp()}] +[{assign var="userid" value=$edit->getId()}] +[{$totp->loadByUserId($userid)}] [{if $readonly}] [{assign var="readonly" value="readonly disabled"}] diff --git a/src/Application/views/tpl/d3_account_totp.tpl b/src/Application/views/tpl/d3_account_totp.tpl index 614e3ce..f30039e 100644 --- a/src/Application/views/tpl/d3_account_totp.tpl +++ b/src/Application/views/tpl/d3_account_totp.tpl @@ -3,6 +3,8 @@

[{oxmultilang ident="D3_TOTP_ACCOUNT"}]

[{assign var="totp" value=$user->d3GetTotp()}] + [{assign var="userid" value=$user->getId()}] + [{$totp->loadByUserId($userid)}]