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

don't show ugly messages anymore

parent bfa1987e
Loading
Loading
Loading
Loading
+24 −5
Original line number Diff line number Diff line
@@ -32,14 +32,15 @@ if(isset($_REQUEST['password'])) {
}

if ( in_array($username,$bannedUsers) ) {
	die("u r b&");
	$banned = true;
	//die("u r b&");
}

include_once("../ldap-auth.php");

$isAuthd = ldapAuth($username, $password);

if ($isAuthd == "sucs" && !$outsider) {
if ($isAuthd == "sucs" && !$outsider && !$banned) {
	include_once("../doorkey.php");
	//curl door
	$curl = curl_init();
@@ -47,7 +48,8 @@ if ($isAuthd == "sucs" && !$outsider) {
	curl_setopt($curl,CURLOPT_RETURNTRANSFER,TRUE);
	curl_exec($curl);
	curl_close($curl);
	exit("door unlocked! (probably)");
	$success = true;
	//exit("door unlocked! (probably)");
}

?>
@@ -83,9 +85,27 @@ if ($isAuthd == "sucs" && !$outsider) {
								<h4 class="card-title">❌</h4>
								<p>You must be connected to GuestNET to use this service.</p>
							</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('
							<div class="card-body">
								<h4 class="card-title">🔑</h4>
@@ -104,7 +124,6 @@ if ($isAuthd == "sucs" && !$outsider) {
				</div>
			</div>
		</div>
		</div>

	</body>