[mw-devel] MW3 r1202 - trunk/webclient

dez at sucs.org dez at sucs.org
Sat Oct 9 16:13:47 BST 2010


Author: dez
Date: 2010-10-09 16:13:47 +0100 (Sat, 09 Oct 2010)
New Revision: 1202

Modified:
   trunk/webclient/say.js
   trunk/webclient/startup.php
Log:
Corrects typo tmp -> tmo in say.js
Adds smarty template calls to startup.php before exit() so that errors actually get displayed


Modified: trunk/webclient/say.js
===================================================================
--- trunk/webclient/say.js	2010-10-08 22:08:49 UTC (rev 1201)
+++ trunk/webclient/say.js	2010-10-09 15:13:47 UTC (rev 1202)
@@ -97,7 +97,7 @@
 			},
 			error: function(XMLHttpRequest, textStatus, errorThrown){
 				var tmo = addmsg("error", textStatus+" ("+errorThrown+")");
-				if (tmp>0) setTimeout('waitForMsg()', tmo);
+				if (tmo>0) setTimeout('waitForMsg()', tmo);
 			},
 		});
 	}

Modified: trunk/webclient/startup.php
===================================================================
--- trunk/webclient/startup.php	2010-10-08 22:08:49 UTC (rev 1201)
+++ trunk/webclient/startup.php	2010-10-09 15:13:47 UTC (rev 1202)
@@ -5,11 +5,15 @@
 
 if (empty($username) || empty($password)) {
 	$smarty->assign("error", "username and password must both be not empty");
+	$smarty->assign_by_ref("body", $smarty->fetch("login.html"));
+	$smarty->display("main.html");
 	exit;
 }
 
 if (ctype_alnum($username) === FALSE) {
 	$smarty->assign("error", "alphanumeric usernames only");
+	$smarty->assign_by_ref("body", $smarty->fetch("login.html"));
+	$smarty->display("main.html");
 	exit;
 }
 
@@ -22,6 +26,8 @@
 
 if ($p === FALSE) {
 	$smarty->assign("error", "failed to exec mwpoll");
+	$smarty->assign_by_ref("body", $smarty->fetch("login.html"));
+	$smarty->display("main.html");
 	exit;
 }
 
@@ -30,8 +36,11 @@
 $pid = trim(fgets($pipes[1]));
 if (!is_numeric($pid)) {
 	$smarty->assign("error", "Bad response: $pid");
+	$smarty->assign_by_ref("body", $smarty->fetch("login.html"));
+	$smarty->display("main.html");
 	exit;
 }
+echo $pid."pid";
 
 $auth = fgets($pipes[1]);
 




More information about the mw-devel mailing list