Commit 86e6be9f authored by Gustav Arneving's avatar Gustav Arneving Committed by root

Made project structure

parent 71730925
<?php include "base.php";
if ( is_null($_REQUEST["username"]) || is_null($_request["password"])){
header("Location: /content/admin.php?errmsg=login failed");
die();
}
$auth = login_user($_REQUEST["username"], $_request["password"]);
if ($auth) {
setcookie ("login", $auth);
} else {
$retry = "content?errmsg=login failed";
}
header("Location: /$retry");
die();
......@@ -2,8 +2,12 @@
<article>
<?php if (isset($_GET["errmsg"])) { ?>
<div class="error-msg"><?= $_GET["errmsg"] ?></div>
<?php } ?>
<?php if (! $authenticated) { ?>
<form method="POST" action="login.php" class="loginform">
<form method="POST" action="/code/login.php" class="loginform">
<label>Username:</label><input type="text" name="username"/>
<label>Password:</label><input type="password" name="password">
<input type="hidden" name="returnaddr" value="<?= $url ?>"/>
......
......@@ -5,7 +5,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width; initial-scale=1.0"/>
<link rel="stylesheet" href="style.css"/>
<link rel="stylesheet" href="/content/style/style.css"/>
<title>Häfvfakultet</title>
</head>
<body>
......@@ -21,23 +21,23 @@ if ($authenticated) { ?>
<p>Häfv nollan, nollan häfv!</p>
<?php } ?>
</div>
<img src="hf-logo.png" alt="HF Logo"/>
<img src="img/hf-logo.png" alt="HF Logo"/>
</header>
<nav>
<ul>
<li><a href="/">Startsidan</a></li>
<li><a href="medlem.php">Bli medlem</a></li>
<li><a href="/stadgar.php">Stadgar</a></li>
<li><a href="/regler.php">Reglemente</a></li>
<li class="facebook">Facebook</li>
<li><a href="/content/medlem.php">Bli medlem</a></li>
<li><a href="/content/stadgar.php">Stadgar</a></li>
<li><a href="/content/regler.php">Reglemente</a></li>
<li class="facebook"><a href="https://www.facebook.com/hafvfakultet">Facebook</a></li>
<hr/>
<?php if($authenticated) { ?>
<li><a href="/logout.php">Log Out</a></li>
<li><a href="/code/logout.php">Log Out</a></li>
<?php } else { ?>
<li><a href="/admin.php">Log in</a></li>
<li><a href="/content/admin.php">Log in</a></li>
<?php } ?>
<li><a href="/admin.php">Admin</a></li>
<li><a href="/content/admin.php">Admin</a></li>
</ul>
</nav>
......
......@@ -111,6 +111,12 @@ form td {
grid-column-end: span 2;
}
.error-msg {
font-size: 200%;
background-color: darkred;
color: white;
}
nav ul {
list-style-type: none;
padding: 0;
......
<?php include "head.php"; ?>
<?php include "content/head.php"; ?>
<article>
<h2>Häfvbastu!</h2>
......@@ -38,7 +38,7 @@ while ($row = $times->fetch_assoc()) { ?>
</tbody>
<?php if ($authenticated) { ?>
<tfoot>
<form method="POST" action="add_time.php">
<form method="POST" action="code/add_time.php">
<tr>
<td></td>
<td><input name="name" type="text" placeholder="Namn"/></td>
......@@ -55,4 +55,4 @@ while ($row = $times->fetch_assoc()) { ?>
</article>
<?php include "tail.php"; ?>
<?php include "content/tail.php"; ?>
<?php
include "base.php";
$auth = login_user($_REQUEST["username"], $_REQUEST["password"]);
if ($auth) {
setcookie ("login", $auth);
}
header("Location: /");
die();
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width; initial-scale=1.0"/>
<link rel="stylesheet" href="style.css"/>
<title>Bli medlemm­- Häfvfakultet</title>
</head>
<body>
</body>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment