diff rlgwebd.js @ 37:353be34de307

rlgwebd.js: remove dead code. Remove functions that dealt with HTML forms and other obsolete code.
author John "Elwin" Edwards <elwin@sdf.org>
date Wed, 06 Jun 2012 10:08:31 -0700
parents a0387f112bcf
children e8ac0e3d2614
line wrap: on
line diff
--- a/rlgwebd.js	Wed Jun 06 10:01:18 2012 -0700
+++ b/rlgwebd.js	Wed Jun 06 10:08:31 2012 -0700
@@ -19,7 +19,6 @@
 var dropToUID = 501;
 var dropToGID = 501;
 var serveStaticRoot = "/var/www/"; // inside the chroot
-var passwdfile = "/dgldir/dgl-login";
 var playtimeout = 3600000; // Idle time before games are autosaved, in ms
 
 /* Global state */
@@ -258,46 +257,6 @@
   return cookies;
 }
 
-function urlDec(encstr) {
-  var decstr = "";
-  var tnum;
-  for (var i = 0; i < encstr.length; i++)
-  {
-    if (encstr.charAt(i) == "+")
-      decstr += " ";
-    else if (encstr.charAt(i) == "%")
-    {
-      tnum = Number("0x" + encstr.slice(i + 1, 2));
-      if (!isNaN(tnum) && tnum >= 0)
-        decstr += String.fromCharCode(tnum);
-      i += 2;
-    }
-    else
-      decstr += encstr.charAt(i);
-  }
-  return decstr;
-}
-
-/* Returns the contents of a form */
-function getFormValues(formtext) {
-  var pairstrs = formtext.split("&");
-  var data = {};
-  for (var i = 0; i < pairstrs.length; i++)
-  {
-    var eqsign = pairstrs[i].indexOf("=");
-    if (eqsign > 0) {
-      rawname = pairstrs[i].slice(0, eqsign);
-      rawval = pairstrs[i].slice(eqsign + 1);
-      name = urlDec(rawname);
-      val = urlDec(rawval);
-      if (!(name in data))
-        data[name] = [];
-      data[name].push(val);
-    }
-  }
-  return data;
-}
-
 function getMsg(posttext) {
   var jsonobj;
   if (!posttext)
@@ -314,11 +273,6 @@
   return jsonobj;
 }
 
-function auth(username, password) {
-  // Real authentication not implemented
-  return true;
-}
-
 function reaper() {
   var now = new Date();
   function reapcheck(session) {