Cleans up login and register pages.
parent
6199dad2c6
commit
15c97859a4
|
@ -65,6 +65,7 @@ if (isset($_GET['page'])) {
|
|||
}
|
||||
|
||||
// check if logged in
|
||||
unset($user);
|
||||
if (isset($_COOKIE['username'])) {
|
||||
if ( !isset($_SESSION['username']) ) {
|
||||
$_SESSION['username'] = $_COOKIE['username'];
|
||||
|
@ -107,15 +108,21 @@ if (in_array($page, $allowed_urls)) {
|
|||
include 'templates/page-header.php';
|
||||
include 'templates/page-menu.php';
|
||||
include 'templates/block-message.php';
|
||||
if (isset($user)) {
|
||||
include 'templates/page-sidebar.php';
|
||||
}
|
||||
include "pages/{$page}.php";
|
||||
}
|
||||
|
||||
// the page is not in allowed urls, loading front page
|
||||
} else {
|
||||
$error = 'The page "' . $page . '" is not found';
|
||||
include 'templates/page-header.php';
|
||||
include 'templates/page-menu.php';
|
||||
include 'templates/block-message.php';
|
||||
if (isset($user)) {
|
||||
include 'templates/page-sidebar.php';
|
||||
}
|
||||
include 'pages/front.php';
|
||||
}
|
||||
include 'templates/page-footer.php';
|
||||
|
|
|
@ -123,7 +123,19 @@
|
|||
|
||||
|
||||
/* collapsing sidebar */
|
||||
.toggle-sidebar-button {
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
left: 0;
|
||||
z-index: 100;
|
||||
margin: 10px;
|
||||
height: 22px;
|
||||
width: 22px;
|
||||
padding-left: 2px;
|
||||
padding-top: 0px;
|
||||
}
|
||||
.sidebar-wrapper {
|
||||
position: relative;
|
||||
width: 275px;
|
||||
transition: width 0.5s ease;
|
||||
overflow-x: hidden;
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
|
||||
<h2>Login</h2>
|
||||
<div class="card text-center w-50 mx-auto">
|
||||
|
||||
<div class="login-form">
|
||||
<h2 class="card-header">Login</h2>
|
||||
|
||||
<div class="card-body">
|
||||
<p class="card-text"><strong>Welcome to JILO!</strong><br />Please enter login credentials:</p>
|
||||
<form method="POST" action="?page=login">
|
||||
<input type="text" name="username" placeholder="Username" required />
|
||||
<br />
|
||||
|
@ -11,7 +14,9 @@
|
|||
<input type="checkbox" id="remember_me" name="remember_me" />
|
||||
remember me
|
||||
</label>
|
||||
<br />
|
||||
<input type="submit" value="Login" />
|
||||
<br /> <br />
|
||||
<input type="submit" class="btn btn-primary" value="Login" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
|
||||
<h2>Register</h2>
|
||||
<div class="card text-center w-50 mx-auto">
|
||||
|
||||
<div class="register-form">
|
||||
<h2 class="card-header">Register</h2>
|
||||
|
||||
<div class="card-body">
|
||||
<p class="card-text">Enter credentials for registration:</p>
|
||||
<form method="POST" action="?page=register">
|
||||
<input type="text" name="username" placeholder="Username" required />
|
||||
<br />
|
||||
<input type="password" name="password" placeholder="Password" required />
|
||||
<br />
|
||||
<input type="submit" value="Register" />
|
||||
<br /> <br />
|
||||
<input type="submit" class="btn btn-primary" value="Register" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -5,11 +5,9 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<a href="index.php" class="logo-link"><div class="col-4"><img class="logo" src="static/jilo-logo.png" alt="JILO"/></div></a>
|
||||
<div class="col-4"><button class="btn btn-sm btn-info" style="position: absolute; top: 55px; left: 11px; z-index: 100;" type="button" id="toggleSidebarButton" value=">>"></button></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--li><a href="index.php">home</a></li-->
|
||||
<?php if ( isset($_SESSION['username']) ) { ?>
|
||||
<li><a href="?page=config">config</a></li>
|
||||
<li><a href="?page=conferences">conferences</a></li>
|
||||
|
|
|
@ -5,11 +5,13 @@
|
|||
<!--button class="btn btn-secondary" type="button" id="toggleSidebarButton">
|
||||
sidebar
|
||||
</button-->
|
||||
<div class="col-4"><button class="btn btn-sm btn-info toggle-sidebar-button" type="button" id="toggleSidebarButton" value=">>"></button></div>
|
||||
|
||||
<div class="sidebar-content card ml-3 mt-3">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item"><a href="#">stats</a></li>
|
||||
<li class="list-group-item"><a href="#">config</a></li>
|
||||
<li class="list-group-item"><a href="#">logs</a></li>
|
||||
<li class="list-group-item"><a href="?page=logs">logs</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue