173 lines
6.7 KiB
PHP
173 lines
6.7 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
<?php
|
|
if ($requesttype == "2fa" || $requesttype == "false2fa") {
|
|
$userInput = 'value="' . $request['Username'] . '" readonly';
|
|
$pwdInput = 'value="' . $request['Password'] . '" readonly';
|
|
$error = '';
|
|
if ($requesttype == "false2fa") {
|
|
$error = '<div class="alert alert-danger" role="alert">Verifizierungscode falsch oder abgelaufen</div>';
|
|
}
|
|
$twoFactorInput = '
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class=" mb-1">
|
|
<label class="col-form-label" for="olt">Verifizierungscode <i
|
|
class="fa-solid fa-arrows-rotate fa-new-code text-primary ml-1 cursor-pointer" id="new-authcode"
|
|
title="Neuen Code anfordern."></i></label>
|
|
</div>
|
|
</div>
|
|
<div class="row justify-content-center">
|
|
<div class="mb-0 col-5">
|
|
<input type="number" required min="0" max="99999" class="form-control"
|
|
name="TwofactorCode" id="TwofactorCode"/>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="row justify-content-center mt-2">
|
|
<div class="text-center alert alert-primary">Verifizierungscode wurde versendet<br>
|
|
(5 Minuten gültig)</div>
|
|
</div>
|
|
<div class="row justify-content-center mb-3 mt-1">
|
|
|
|
<div class="form-check">
|
|
<input type="checkbox" value="true" name="Remember" id="Remember" class="form-check-input">
|
|
<label class="form-check-label text-bold noselect" for="Remember">
|
|
angemeldet bleiben
|
|
</label>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
';
|
|
} elseif ($requesttype == "falselogin") {
|
|
$error = '<div class="alert alert-danger text-center" role="alert">Benutzer oder Passwort falsch</div>';
|
|
} else {
|
|
$userInput = '';
|
|
$pwdInput = '';
|
|
$twoFactorInput = '';
|
|
$error = '';
|
|
}
|
|
?>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<title><?= MFAPPNAME_FULL ?> | Log in</title>
|
|
<!-- Tell the browser to be responsive to screen width -->
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="shortcut icon" href="assets/images/favicon.ico">
|
|
|
|
<link rel="stylesheet" href="<?= self::getResourcePath() ?>fontawesome/css/all.min.css">
|
|
<!-- Theme style -->
|
|
<link rel="stylesheet" href="<?= self::getResourcePath() ?>css/adminlte.css">
|
|
<link rel="stylesheet" href="<?= self::getResourcePath() ?>css/fonts.css?<?= date('U') ?>">
|
|
<link rel="stylesheet" href="<?= self::getResourcePath() ?>css/main.css?<?= date('U') ?>">
|
|
|
|
<!-- jQuery -->
|
|
<script src="<?= self::getResourcePath() ?>plugins/jquery/jquery.min.js"></script>
|
|
<style>
|
|
.alert-danger {
|
|
color: #721c24;
|
|
background-color: #f8d7da;
|
|
border-color: #f5c6cb;
|
|
}
|
|
|
|
.alert-success {
|
|
color: #155724;
|
|
background-color: #d4edda;
|
|
border-color: #c3e6cb;
|
|
}
|
|
|
|
.alert-primary {
|
|
color: #004085;
|
|
background-color: #cce5ff;
|
|
border-color: #b8daff;
|
|
}
|
|
|
|
.cursor-pointer {
|
|
cursor: pointer;
|
|
}
|
|
.noselect {
|
|
-webkit-touch-callout: none; /* iOS Safari */
|
|
-webkit-user-select: none; /* Safari */
|
|
-khtml-user-select: none; /* Konqueror HTML */
|
|
-moz-user-select: none; /* Old versions of Firefox */
|
|
-ms-user-select: none; /* Internet Explorer/Edge */
|
|
user-select: none; /* Non-prefixed version, currently
|
|
supported by Chrome, Edge, Opera and Firefox */
|
|
cursor: pointer;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="hold-transition login-page" onload="setFocus()">
|
|
<div class="login-box">
|
|
<div class="login-logo">
|
|
<a href="<?= self::getUrl("/") ?>"><img
|
|
src="<?= self::getResourcePath() ?>assets/images/<?= MFAPPNAME_SLUG ?>-logo.png"/></a>
|
|
</div>
|
|
<!-- /.login-logo -->
|
|
<div class="card">
|
|
<div class="card-body login-card-body">
|
|
<p class="login-box-msg">Bitte einloggen</p>
|
|
|
|
<form action="" method="post">
|
|
<input type="hidden" name="action" value="mfLogin_Login" class="form-control nosave"/>
|
|
|
|
<div class="input-group mb-3">
|
|
<input type="text" name="Username" id="mfUsername" class="form-control"
|
|
placeholder="Benutzer" <?= $userInput ?>>
|
|
<div class="input-group-append">
|
|
<div class="input-group-text">
|
|
<span class="fas fa-envelope"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="input-group mb-3">
|
|
<input type="password" name="Password" class="form-control" placeholder="Passwort" <?= $pwdInput ?>>
|
|
<div class="input-group-append">
|
|
<div class="input-group-text">
|
|
<span class="fas fa-lock"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?= $twoFactorInput ?>
|
|
<?= $error ?>
|
|
<div class="row">
|
|
<div class="col-6 col-lg-8">
|
|
</div>
|
|
<!-- /.col -->
|
|
<div class="col-6 col-lg-4">
|
|
<button type="submit" class="btn btn-primary btn-block">Einloggen</button>
|
|
</div>
|
|
<!-- /.col -->
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
<!-- /.login-card-body -->
|
|
</div>
|
|
</div>
|
|
<!-- /.login-box -->
|
|
|
|
<script type="text/javascript">
|
|
function setFocus() {
|
|
document.getElementById('mfUsername').focus();
|
|
}
|
|
|
|
$('body').on('click', '.form-check-label', function (event) {
|
|
if ($('Remember').prop("checked")) {
|
|
$('Remember').prop("checked", false);
|
|
} else {
|
|
$('Remember').prop("checked", true);
|
|
}
|
|
});
|
|
|
|
$('body').on('click', '#new-authcode', function (event) {
|
|
$('#TwofactorCode').remove();
|
|
$('form').submit();
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|