[SUCS Devel] [Git][sucssite/doorkey][master] make doorkey.sucs.org look way nicer

Imran Hussain imranh at sucs.org
Thu Sep 26 16:25:17 BST 2019



Imran Hussain pushed to branch master at sucssite / doorkey


Commits:
bfa1987e by Imran Hussain at 2019-09-26T15:24:46Z
make doorkey.sucs.org look way nicer

- - - - -


3 changed files:

- + public/css/doorkey.css
- + public/img/sucslogo_trans_white.png
- public/index.php


Changes:

=====================================
public/css/doorkey.css
=====================================
@@ -0,0 +1,28 @@
+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


=====================================
public/img/sucslogo_trans_white.png
=====================================
Binary files /dev/null and b/public/img/sucslogo_trans_white.png differ


=====================================
public/index.php
=====================================
@@ -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>



View it on GitLab: https://projects.sucs.org/sucssite/doorkey/commit/bfa1987ead04d5c91812df6778b692019b007b7c

-- 
View it on GitLab: https://projects.sucs.org/sucssite/doorkey/commit/bfa1987ead04d5c91812df6778b692019b007b7c
You're receiving this email because of your account on projects.sucs.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/devel/attachments/20190926/2d0fd761/attachment-0001.html>


More information about the Devel mailing list