VENOM-2 : WIP

This commit is contained in:
engineerTrooper 2020-10-05 20:02:43 +02:00
commit a2931d93f7
9 changed files with 311 additions and 37 deletions

View file

@ -1,19 +1,27 @@
<?php
use Venom\Models\User;
use \Venom\Security\Security;
use Venom\Views\Asset;
if (!Security::get()->hasRole(User::ADMIN_ROLE)) {
?>
<form method="post" action="/admin/api/login">
<input type="text" name="USERNAME" placeholder="Username">
<input type="password" name="PASSWORD" placeholder="Password">
<input type="hidden" name="REDIRECT_TO" value="/admin/">
<input type="submit" value="Login">
</form>
<?php
echo 'Login!';
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Venom Admin Interface</title>
<?php Asset::get()->renderCSS(); ?>
</head>
<body>
<?php
if (!$this->getVar('isLoggedIn')) {
$this->renderTemplate('login');
} else {
echo 'Admin Interface!';
echo '<a href="/admin/api/login/logout">Ausloggen</a>';
}
Asset::get()->renderJS();
?>
</body>
</html>

23
tpl/admin/login.php Normal file
View file

@ -0,0 +1,23 @@
<main>
<div>
<p>- Admin Login -<br>Be Carefully!</p>
<form id="login" novalidate method="POST" action="/admin/api/login">
<div class="input-group">
<input id="username" required>
<label for="name">Username</label>
<span class="error">Username is required</span>
</div>
<div class="input-group">
<input id="password" required type="password">
<label for="password">Password</label>
<span class="error">Password is required</span>
</div>
<button class="btn btn--primary">
<span class="btn-ripple"></span>
<span class="btn__content">Login</span>
</button>
</form>
<a href="">Forgotten Password? [not active!]</a>
</div>
</main>