8
0
oxtotp/views/twig/admin/d3totplogin.html.twig

94 Zeilen
4.8 KiB
Twig

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>{{ translate({ ident: "LOGIN_TITLE" }) }}</title>
<meta http-equiv="Content-Type" content="text/html; charset={{ charset }}">
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<link rel="shortcut icon" href="{{ oViewConf.getImageUrl()|raw }}favicon.ico">
<link rel="stylesheet" href="{{ oViewConf.getResourceUrl()|raw }}login.css">
<link rel="stylesheet" href="{{ oViewConf.getResourceUrl()|raw }}colors_{{ oViewConf.getEdition()|lower }}.css">
</head>
<body>
<div class="admin-login-box">
<div id="shopLogo"><img src="{{ oViewConf.getImageUrl('logo_dark.svg')|raw }}" alt="" /></div>
<form action="{{ oViewConf.getSelfLink()|raw }}" method="post" id="login">
{% block admin_login_form %}
{{ oViewConf.getHiddenSid()|raw }}
<input type="hidden" name="fnc" value="checklogin">
<input type="hidden" name="cl" value="{{ oViewConf.getActiveClassName() }}">
<input type="hidden" name="profile" value="{{ selectedProfile }}">
<input type="hidden" name="chlanguage" value="{{ selectedChLanguage }}">
<h3>{{ translate({ ident: "TOTP_INPUT" }) }}</h3>
{% if not empty(Errors.default) %}
{% include "inc_error.html.twig" with {Errorlist: Errors.default} %}
{% endif %}
{{ oView.getBackupCodeCountMessage()|raw }}
<div class="container">
<label for="1st">erste TOTP-Ziffer</label>
<input type="text" name="d3totp[]" class="digit" id='1st' inputmode="numeric" pattern="[0-9]*" maxlength="1" onkeyup="clickEvent(null, '2nd')" autofocus autocomplete="off">
<label for="2nd">zweite TOTP-Ziffer</label>
<input type="text" name="d3totp[]" class="digit" id="2nd" inputmode="numeric" pattern="[0-9]*" maxlength="1" onkeyup="clickEvent('1st', '3rd')" autocomplete="off">
<label for="3rd">dritte TOTP-Ziffer</label>
<input type="text" name="d3totp[]" class="digit" id="3rd" inputmode="numeric" pattern="[0-9]*" maxlength="1" onkeyup="clickEvent('2nd', '4th')" autocomplete="off">
<label for="4th">vierte TOTP-Ziffer</label>
<input type="text" name="d3totp[]" class="digit" id="4th" inputmode="numeric" pattern="[0-9]*" maxlength="1" onkeyup="clickEvent('3rd', '5th')" autocomplete="off">
<label for="5th">fünfte TOTP-Ziffer</label>
<input type="text" name="d3totp[]" class="digit" id="5th" inputmode="numeric" pattern="[0-9]*" maxlength="1" onkeyup="clickEvent('4th', '6th')" autocomplete="off">
<label for="6th">sechste TOTP-Ziffer</label>
<input type="text" name="d3totp[]" class="digit" id="6th" inputmode="numeric" pattern="[0-9]*" maxlength="1" onkeyup="clickEvent('5th', null)" autocomplete="off">
</div>
{% set name = "d3js" %}
function clickEvent(previous, next){
const digitKeys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
const deleteKeys = ['Backspace', 'Delete'];
if(next && digitKeys.includes(event.key)){
document.getElementById(next).focus();
} else if(previous && deleteKeys.includes(event.key)){
document.getElementById(previous).focus();
}
}
document.addEventListener("paste", function(e) {
if (e.target.type is same as("text") {
)
var data = e.clipboardData.getData('Text');
data = data.split('');
[].forEach.call(document.querySelectorAll("#login input[type=text]"), (node, index) => {
node.value = data[index];
});
}
});
{% endset %}
{{ script({ add: d3js, dynamic: __oxid_include_dynamic }) }}
<div>{{ translate({ ident: "TOTP_INPUT_HELP" }) }}</div>
<input type="submit" value="{{ translate({ ident: "LOGIN_START" }) }}" class="btn"><br>
<input class="btn btn_cancel" value="{{ translate({ ident: "TOTP_CANCEL_LOGIN" }) }}" type="submit"
onclick="document.getElementById('login').fnc.value='d3CancelLogin'; document.getElementById('login').submit();"
>
{{ style({ include: oViewConf.getModuleUrl('d3totp', 'out/admin/src/css/d3totplogin.css'): 'out/admin/src/css/d3totplogin.css') }) }}
{{ style() }}
{% endblock %}
</form>
</div>
{{ script({ dynamic: __oxid_include_dynamic }) }}
<script type="text/javascript">if (window !== window.top) top.location.href = document.location.href;</script>
</body>
</html>