forked from D3Public/oxtotp
add cancel login action to login dialog, add translations
This commit is contained in:
parent
57de2aabce
commit
644ceaeca3
@ -74,7 +74,7 @@ class d3user_totp extends AdminDetailsController
|
||||
/** @var d3_totp_user $oUser */
|
||||
$oUser = oxNew(User::class);
|
||||
if (false == $oUser->d3CheckPasswordPass($this->getEditObjectId(), $pwd)) {
|
||||
$oException = oxNew(StandardException::class, 'EXCEPTION_USER_PASSWORDDONTPASS');
|
||||
$oException = oxNew(StandardException::class, 'D3_TOTP_ERROR_PWDONTPASS');
|
||||
throw $oException;
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<input type="hidden" name="cl" value="login">
|
||||
|
||||
[{if $Errors.default|@count}]
|
||||
[{include file="inc_error.tpl" Errorlist=$Errors.default}]
|
||||
[{include file="inc_error.tpl" Errorlist=$Errors.default}]
|
||||
[{/if}]
|
||||
|
||||
<label for="d3totp">[{oxmultilang ident="TOTP_INPUT"}]</label>
|
||||
@ -13,7 +13,15 @@
|
||||
|
||||
[{oxmultilang ident="TOTP_INPUT_HELP"}]
|
||||
|
||||
--Anmeldung abbrechen--
|
||||
[{* prevent cancel button (1st button) action when form is sent via Enter key *}]
|
||||
<input type="submit" style="display:none !important;">
|
||||
|
||||
<input class="btn btn_cancel" value="[{oxmultilang ident="TOTP_CANCEL_LOGIN"}]" type="submit"
|
||||
onclick="document.getElementById('login').fnc.value='d3CancelLogin'; document.getElementById('login').submit();"
|
||||
>
|
||||
|
||||
[{oxstyle include=$oViewConf->getModuleUrl('d3totp', 'out/admin/src/css/d3totplogin.css')}]
|
||||
[{oxstyle}]
|
||||
[{else}]
|
||||
[{$smarty.block.parent}]
|
||||
[{/if}]
|
@ -21,7 +21,8 @@ $aLang = [
|
||||
'charset' => 'UTF-8',
|
||||
|
||||
'TOTP_INPUT' => 'Authentisierungscode',
|
||||
'TOTP_INPUT_HELP' => 'Den Authentisierungscode erhalten Sie von der Zweifaktorauthentisierung-App auf Ihrem Gerät.',
|
||||
'TOTP_INPUT_HELP' => 'Das Einmalpasswort erhalten Sie von der Zweifaktorauthentisierung-App auf Ihrem Gerät.',
|
||||
'TOTP_CANCEL_LOGIN' => 'Anmeldung abbrechen',
|
||||
|
||||
'd3mxuser_totp' => '2-Faktor-Authentisierung',
|
||||
|
||||
@ -40,4 +41,5 @@ $aLang = [
|
||||
'D3_TOTP_REGISTERDELETE_DESC' => 'Das Konto ist dann nicht mehr durch die Zweifaktorauthtisierung geschützt.',
|
||||
|
||||
'D3_TOTP_ERROR_UNVALID' => 'Das Einmalpasswort ist ungültig.',
|
||||
'D3_TOTP_ERROR_PWDONTPASS' => 'Das Passwort passt nicht zum gewählten Benutzerkonto.',
|
||||
];
|
||||
|
@ -22,6 +22,24 @@ $aLang = [
|
||||
|
||||
'TOTP_INPUT' => 'authentication code',
|
||||
'TOTP_INPUT_HELP' => 'The authentication code is available from the Two-Factor Authentication app on your device.',
|
||||
'TOTP_CANCEL_LOGIN' => 'Cancel login',
|
||||
|
||||
'd3mxuser_totp' => 'Two-factor authentication',
|
||||
|
||||
'D3_TOTP_REGISTERNEW' => 'create new registration',
|
||||
'D3_TOTP_QRCODE' => 'QR code',
|
||||
'D3_TOTP_QRCODE_HELP' => 'Scan this QR code with your authentication app to deposit this user account.',
|
||||
'D3_TOTP_SECRET' => 'Can not scan QR code?',
|
||||
'D3_TOTP_SECRET_HELP' => 'If you do not use an app that can scan the QR code, you can also copy this string into your authentication tool. Please also set the password length to 6 characters and the time interval to 30 seconds.',
|
||||
'D3_TOTP_CURRPWD' => 'Login password of the user account',
|
||||
'D3_TOTP_CURRPWD_HELP' => 'The character string is stored encrypted in the shop. To encrypt, the password of the selected customer account is required. Concurrently, this ensures that only authorized users can make changes to these settings.',
|
||||
'D3_TOTP_CURROTP' => 'Confirmation with one-time password',
|
||||
'D3_TOTP_CURROTP_HELP' => 'If you have registered this customer account in your authentication app, you generate a one-time password, enter it here and send the form out immediately.',
|
||||
|
||||
'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_ERROR_UNVALID' => 'The one-time password is invalid.',
|
||||
'D3_TOTP_ERROR_PWDONTPASS' => 'The password does not match the selected user account.',
|
||||
];
|
||||
|
@ -18,6 +18,7 @@ namespace D3\Totp\Modules\Application\Controller\Admin;
|
||||
use D3\Totp\Application\Model\d3totp;
|
||||
use D3\Totp\Application\Model\Exceptions\d3totp_wrongOtpException;
|
||||
use Doctrine\DBAL\DBALException;
|
||||
use OxidEsales\Eshop\Application\Model\User;
|
||||
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
|
||||
@ -106,4 +107,10 @@ class d3_totp_LoginController extends d3_totp_LoginController_parent
|
||||
$sTotp && $totp->verify($sTotp)
|
||||
);
|
||||
}
|
||||
|
||||
public function d3CancelLogin()
|
||||
{
|
||||
$oUser = oxNew(User::class);
|
||||
$oUser->logout();
|
||||
}
|
||||
}
|
@ -36,7 +36,7 @@ $sModuleId = 'd3totp';
|
||||
$aModule = [
|
||||
'id' => $sModuleId,
|
||||
'title' =>
|
||||
(class_exists(d3utils::class) ? d3utils::getInstance()->getD3Logo() : 'D³') . ' Zwei-Faktor-Authentisierung',
|
||||
(class_exists(d3utils::class) ? d3utils::getInstance()->getD3Logo() : 'D³') . ' Zwei-Faktor-Authentisierung / two-factor authentication',
|
||||
'description' => [
|
||||
'de' => 'Zwei-Faktor-Authentisierung (TOTP) für OXID eSales Shop',
|
||||
'en' => 'Two-factor authentication (TOTP) for OXID eSales shop',
|
||||
|
12
src/out/admin/src/css/d3totplogin.css
Normal file
12
src/out/admin/src/css/d3totplogin.css
Normal file
@ -0,0 +1,12 @@
|
||||
#login {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
}
|
||||
#login .btn {
|
||||
order: 1;
|
||||
}
|
||||
#login .btn.btn_cancel {
|
||||
order: 2;
|
||||
background: lightblue;
|
||||
color: black;
|
||||
}
|
Loading…
Reference in New Issue
Block a user