From 4e1e5653fba52eee05591d401210c0bd82cb15f3 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Tue, 23 Oct 2018 22:33:14 +0200 Subject: [PATCH] add delete function --- .../Controller/Admin/d3user_totp.php | 12 ++++++++++ .../views/admin/de/d3totp_lang.php | 4 +++- .../views/admin/en/d3totp_lang.php | 4 +++- .../views/admin/tpl/d3user_totp.tpl | 22 +++++++++---------- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/Application/Controller/Admin/d3user_totp.php b/src/Application/Controller/Admin/d3user_totp.php index 9407eed..2467161 100644 --- a/src/Application/Controller/Admin/d3user_totp.php +++ b/src/Application/Controller/Admin/d3user_totp.php @@ -98,4 +98,16 @@ class d3user_totp extends AdminDetailsController $this->_sSaveError = $oExcp->getMessage(); } } + + public function delete() + { + $aParams = Registry::getRequest()->getRequestEscapedParameter("editval"); + + /** @var d3totp $oTotp */ + $oTotp = oxNew(d3totp::class); + if ($aParams['d3totp__oxid']) { + $oTotp->load($aParams['d3totp__oxid']); + $oTotp->delete(); + } + } } \ No newline at end of file diff --git a/src/Application/views/admin/de/d3totp_lang.php b/src/Application/views/admin/de/d3totp_lang.php index d3ac1da..e67dde1 100644 --- a/src/Application/views/admin/de/d3totp_lang.php +++ b/src/Application/views/admin/de/d3totp_lang.php @@ -38,7 +38,9 @@ $aLang = [ 'D3_TOTP_REGISTEREXIST' => 'vorhandene Registrierung', 'D3_TOTP_REGISTERDELETE' => 'Registrierung löschen', - 'D3_TOTP_REGISTERDELETE_DESC' => 'Das Konto ist dann nicht mehr durch die Zweifaktorauthtisierung geschützt.', + 'D3_TOTP_REGISTERDELETE_DESC' => 'Um die Registrierung zu ändern, löschen Sie diese bitte vorerst. Sie können sofort im Anschluss eine neue Registrierung anlegen.
Wenn Sie die Registrierung löschen, ist das Konto nicht mehr durch die Zweifaktorauthentisierung geschützt.', + + 'D3_TOTP_SAVE' => 'Speichern', 'D3_TOTP_ERROR_UNVALID' => 'Das Einmalpasswort ist ungültig.', 'D3_TOTP_ERROR_PWDONTPASS' => 'Das Passwort passt nicht zum gewählten Benutzerkonto.', diff --git a/src/Application/views/admin/en/d3totp_lang.php b/src/Application/views/admin/en/d3totp_lang.php index 1b54dd5..2b486fa 100644 --- a/src/Application/views/admin/en/d3totp_lang.php +++ b/src/Application/views/admin/en/d3totp_lang.php @@ -38,7 +38,9 @@ $aLang = [ 'D3_TOTP_REGISTEREXIST' => 'existing registration', 'D3_TOTP_REGISTERDELETE' => 'Delete registration', - 'D3_TOTP_REGISTERDELETE_DESC' => 'The account is then no longer protected by the two-factor authentication.', + 'D3_TOTP_REGISTERDELETE_DESC' => 'To change the registration, please delete it. You can then immediately create a new registration.
If you delete the registration, the account is no longer protected by the two-factor authentication.', + + 'D3_TOTP_SAVE' => 'Save', 'D3_TOTP_ERROR_UNVALID' => 'The one-time password is invalid.', 'D3_TOTP_ERROR_PWDONTPASS' => 'The password does not match the selected user account.', diff --git a/src/Application/views/admin/tpl/d3user_totp.tpl b/src/Application/views/admin/tpl/d3user_totp.tpl index 959fa98..9aab0ec 100644 --- a/src/Application/views/admin/tpl/d3user_totp.tpl +++ b/src/Application/views/admin/tpl/d3user_totp.tpl @@ -59,14 +59,15 @@ - - - - - [{oxmultilang ident="D3_TOTP_REGISTERDELETE"}]
+ [{oxmultilang ident="D3_TOTP_REGISTERDELETE_DESC"}] + +

+ + + [{/if}] [{/block}] @@ -111,15 +112,14 @@ [{oxinputhelp ident="D3_TOTP_CURROTP_HELP"}] + +

+ + + [{/if}] [{/block}] - - -

- - -