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

Close #1 and #2

parent d787d619
......@@ -75,7 +75,6 @@ if ( isset($_POST["username"]) && isset($_POST["password"]) && !$RATELIMITED ) {
$ISS_LOGIN = true;
}else{
//do stuff for not authd peeps
echo "failed!";
$details["failedlogincount"] = $details["failedlogincount"] + 1;
$DB_CON->exec("UPDATE sessions SET failedlogincount=${details['failedlogincount']}, lastfailedlogintime=strftime('%s','now') WHERE id='${SESSIONID}'");
}
......@@ -126,17 +125,26 @@ if ( isset($_POST["username"]) && isset($_POST["password"]) && !$RATELIMITED ) {
<?php
// do something on failed login attempt
if (isset($isAuthd) && $isAuthd === "nope") {
print('
<div class="alert alert-danger" role="alert">
❌ Login failed! 😞
</div>
');
}
if ($RATELIMITED) {
print('
<div class="card-body">
<h4 class="card-title">🔨</h4>
<p>Too many inncorrect password attempts!.</p>
<h4 class="card-title">👨‍⚖️</h4>
<p>Too many inncorrect password attempts!. Sober up and try again in a bit</p>
</div>
');
} elseif (!$SUCS_LOGIN && !$ISS_LOGIN) {
print('
<div class="card-body">
<h4 class="card-title">🔑 SUCS or ISS</h4>
<h4 class="card-title">🔑</h4>
<p class="card-text">Hello stranger!</p>
<form method="post">
<div class="form-group">
<input type="text" name="username" size="15" class="form-control" placeholder="Enter SUCS or ISS username" /><br />
......@@ -156,6 +164,7 @@ if ($RATELIMITED) {
print('
<div class="card-body">
<h4 class="card-title">🔑 ISS</h4>
<p class="card-text">Hello '.$sucs_username.'! You\'re logged in but may also login with your ISS details</p>
<form method="post">
<div class="form-group">
<input type="text" name="username" size="15" class="form-control" placeholder="Enter ISS username" /><br />
......@@ -176,6 +185,7 @@ if ($RATELIMITED) {
print('
<div class="card-body">
<h4 class="card-title">🔑 SUCS</h4>
<p class="card-text">Ah you\'ve only logged in with your ISS username: '.$iss_username.'</p>
<form method="post">
<div class="form-group">
<input type="text" name="username" size="15" class="form-control" placeholder="Enter SUCS username" /><br />
......@@ -190,7 +200,7 @@ if ($RATELIMITED) {
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>
<p>Hi '.$details["sucs_username"].' you have logged into your ISS account '.$details["iss_username"].' already! 🍻</p>
</div>
');
}
......
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