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>