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

make sso look pretty

parent f12adfdb
......@@ -100,30 +100,72 @@ if ( isset($_POST["username"]) && isset($_POST["password"]) && !$RATELIMITED ) {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>SUCS sso</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="https://common.sucs.org/css/sucs.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="https://common.sucs.org/img/sucs_logo_white_trans.svg" /></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 (!$SUCS_LOGIN && !$ISS_LOGIN) {
print("
<form action=\"#\" method=\"post\">
Username: <input type=\"text\" name=\"username\"><br>
Password: <input type=\"password\" name=\"password\"><br>
<input type=\"submit\" value=\"Submit\">
</form>
");
if ($RATELIMITED) {
print('
<div class="card-body">
<h4 class="card-title">🔨</h4>
<p>Too many inncorrect password attempts!.</p>
</div>
');
} elseif (!$SUCS_LOGIN && !$ISS_LOGIN) {
print('
<div class="card-body">
<h4 class="card-title">🔑 SUCS or ISS</h4>
<form method="post">
<div class="form-group">
<input type="text" name="username" size="15" class="form-control" placeholder="Enter SUCS or ISS username" /><br />
<input type="password" name="password" size="15" class="form-control" placeholder="Enter password" /><br />
<input type="submit" class="btn btn-primary" value="SUCS Login" />
<input type="submit" class="btn btn-primary" value="ISS Login" />
</div>
</form>
</div>
');
} elseif ($SUCS_LOGIN && !$ISS_LOGIN) {
if ($details["sucs_username"] == null) {
$sucs_username = $_POST["username"];
} else {
$sucs_username = $details["sucs_username"];
}
print("
<p>Hi $sucs_username! Log in with your ISS creds if you want</p>
<form action=\"#\" method=\"post\">
Username: <input type=\"text\" name=\"username\"><br>
Password: <input type=\"password\" name=\"password\"><br>
<input type=\"submit\" value=\"Submit\">
</form>
");
print('
<div class="card-body">
<h4 class="card-title">🔑 ISS</h4>
<form method="post">
<div class="form-group">
<input type="text" name="username" size="15" class="form-control" placeholder="Enter ISS username" /><br />
<input type="password" name="password" size="15" class="form-control" placeholder="Enter password" /><br />
<input type="submit" class="btn btn-primary" value="SUCS Login" disabled/>
<input type="submit" class="btn btn-primary" value="ISS Login" />
</div>
</form>
</div>
');
} elseif (!$SUCS_LOGIN && $ISS_LOGIN) {
if ($details["iss_username"] == null) {
$iss_username = $_POST["username"];
......@@ -131,17 +173,34 @@ if (!$SUCS_LOGIN && !$ISS_LOGIN) {
$iss_username = $details["iss_username"];
}
print("
<p>Hi $iss_username! Log in with your SUCS creds</p>
<form action=\"#\" method=\"post\">
Username: <input type=\"text\" name=\"username\"><br>
Password: <input type=\"password\" name=\"password\"><br>
<input type=\"submit\" value=\"Submit\">
</form>
");
print('
<div class="card-body">
<h4 class="card-title">🔑 SUCS</h4>
<form method="post">
<div class="form-group">
<input type="text" name="username" size="15" class="form-control" placeholder="Enter SUCS username" /><br />
<input type="password" name="password" size="15" class="form-control" placeholder="Enter password" /><br />
<input type="submit" class="btn btn-primary" value="SUCS Login" />
<input type="submit" class="btn btn-primary" value="ISS Login" disabled/>
</div>
</form>
</div>
');
} else {
print("
<p>You've logged in in every possible way!</p>
");
print('
<div class="card-body">
<h4 class="card-title">✔️</h4>
<p>Hi '.$details["sucs_username"].' you have logged into your ISS account '.$details["iss_username"].' already!</p>
</div>
');
}
?>
\ No newline at end of file
?>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
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