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

don't show ugly messages anymore

parent bfa1987e
...@@ -32,14 +32,15 @@ if(isset($_REQUEST['password'])) { ...@@ -32,14 +32,15 @@ if(isset($_REQUEST['password'])) {
} }
if ( in_array($username,$bannedUsers) ) { if ( in_array($username,$bannedUsers) ) {
die("u r b&"); $banned = true;
//die("u r b&");
} }
include_once("../ldap-auth.php"); include_once("../ldap-auth.php");
$isAuthd = ldapAuth($username, $password); $isAuthd = ldapAuth($username, $password);
if ($isAuthd == "sucs" && !$outsider) { if ($isAuthd == "sucs" && !$outsider && !$banned) {
include_once("../doorkey.php"); include_once("../doorkey.php");
//curl door //curl door
$curl = curl_init(); $curl = curl_init();
...@@ -47,7 +48,8 @@ if ($isAuthd == "sucs" && !$outsider) { ...@@ -47,7 +48,8 @@ if ($isAuthd == "sucs" && !$outsider) {
curl_setopt($curl,CURLOPT_RETURNTRANSFER,TRUE); curl_setopt($curl,CURLOPT_RETURNTRANSFER,TRUE);
curl_exec($curl); curl_exec($curl);
curl_close($curl); curl_close($curl);
exit("door unlocked! (probably)"); $success = true;
//exit("door unlocked! (probably)");
} }
?> ?>
...@@ -83,9 +85,27 @@ if ($isAuthd == "sucs" && !$outsider) { ...@@ -83,9 +85,27 @@ if ($isAuthd == "sucs" && !$outsider) {
<h4 class="card-title">❌</h4> <h4 class="card-title">❌</h4>
<p>You must be connected to GuestNET to use this service.</p> <p>You must be connected to GuestNET to use this service.</p>
</div> </div>
');
} elif ($banned) {
print('
<div class="card-body">
<h4 class="card-title">🔨</h4>
<p>You are banned from the room.</p>
</div>
');
}
} elif ($success) {
print('
<div class="card-body">
<h4 class="card-title">✔️</h4>
<p>Door unlocked!</p>
</div>
'); ');
} else {
}
else {
print(' print('
<div class="card-body"> <div class="card-body">
<h4 class="card-title">🔑</h4> <h4 class="card-title">🔑</h4>
...@@ -100,7 +120,6 @@ if ($isAuthd == "sucs" && !$outsider) { ...@@ -100,7 +120,6 @@ if ($isAuthd == "sucs" && !$outsider) {
'); ');
} }
?> ?>
</div>
</div> </div>
</div> </div>
</div> </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