[SUCS Devel] [Git][sucssite/doorkey][master] don't show ugly messages anymore

Imran Hussain imranh at sucs.org
Thu Sep 26 17:15:39 BST 2019



Imran Hussain pushed to branch master at sucssite / doorkey


Commits:
d8af36e3 by Imran Hussain at 2019-09-26T16:14:14Z
don't show ugly messages anymore

- - - - -


1 changed file:

- public/index.php


Changes:

=====================================
public/index.php
=====================================
@@ -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>
@@ -100,7 +120,6 @@ if ($isAuthd == "sucs" && !$outsider) {
 								');
 							}
 						?>
-						</div>
 					</div>
 				</div>
 			</div>



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

-- 
View it on GitLab: https://projects.sucs.org/sucssite/doorkey/commit/d8af36e3d8995db15d89ab1a8e9093bca84eef33
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/d0421b9f/attachment-0001.html>


More information about the Devel mailing list