# HG changeset patch # User John "Elwin" Edwards # Date 1339002511 25200 # Node ID 353be34de307ed89ce48749c51a29307521f6ffc # Parent a0387f112bcfca289b9520f60947583d3d18facf rlgwebd.js: remove dead code. Remove functions that dealt with HTML forms and other obsolete code. diff -r a0387f112bcf -r 353be34de307 rlgwebd.js --- 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) {