Commit bfa1987e authored by Imran Hussain's avatar Imran Hussain
Browse files

make doorkey.sucs.org look way nicer

parent 40cd7034
html,body {
height: 100%;
}
nav {
background-image: linear-gradient(to bottom left, #FA0, #f60);
}
nav img {
width: auto;
height: auto;
max-height: 4em;
}
h1 {
color: #fff;
font-weight: bold;
}
.btn-primary {
background-color: #f60;
border-color: #f60;
}
.btn-primary:hover {
background-color: #f80;
border-color: #f80;
}
\ No newline at end of file
......@@ -20,7 +20,8 @@ $ipAddr = $_SERVER['REMOTE_ADDR'];
//var_dump($ipAddr);
if (!ip_in_range($ipAddr, "137.44.10.128/25")){
exit("nah mate");
$outsider = true;
//exit("nah mate");
}
if(isset($_REQUEST['username'])) {
......@@ -38,7 +39,7 @@ include_once("../ldap-auth.php");
$isAuthd = ldapAuth($username, $password);
if ($isAuthd == "sucs"){
if ($isAuthd == "sucs" && !$outsider) {
include_once("../doorkey.php");
//curl door
$curl = curl_init();
......@@ -51,8 +52,60 @@ if ($isAuthd == "sucs"){
?>
<form method="post">
Username: <input type="text" name="username" size="15" /><br />
Password: <input type="password" name="password" size="15" /><br />
<input type="submit" value="Unlock Door!" />
</form>
<!DOCTYPE html>
<html lang="en">
<head>
<title>SUCS doorkey</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="css/doorkey.css">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</head>
<body>
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" href="https://sucs.org"><img src="img/sucslogo_trans_white.png" /></a>
</nav>
<div class="h-100 container justify-content-center text-center">
<div class="h-100 row d-flex justify-content-center align-items-center">
<div class="col-8">
<div class="card mb-4">
<?php
if ($outsider) {
print('
<div class="card-body">
<h4 class="card-title">❌</h4>
<p>You must be connected to GuestNET to use this service.</p>
</div>
');
} else {
print('
<div class="card-body">
<h4 class="card-title">🔑</h4>
<form method="post">
<div class="form-group">
<input type="text" name="username" size="15" class="form-control" placeholder="Enter username" /><br />
<input type="password" name="password" size="15" class="form-control" placeholder="Enter password" /><br />
<input type="submit" class="btn btn-primary" value="Unlock Door!" />
</div>
</form>
</div>
');
}
?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Supports Markdown
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