diff --git a/web/root/ecWeb/fTelnet/ClientFuncs.js b/web/root/ecWeb/fTelnet/ClientFuncs.js new file mode 100644 index 0000000000000000000000000000000000000000..26c7c689366086628eb7ce4e0897e67f0b2f78d9 --- /dev/null +++ b/web/root/ecWeb/fTelnet/ClientFuncs.js @@ -0,0 +1,85 @@ +function ClientConnect(AHost, APort) { + if (HtmlTerm.Loaded) { + HtmlTerm.Connect(AHost, APort); + } else { + var FO = GetfTelnetObject(); + if (FO) { FO.Connect(AHost, APort); } + } +} + +function ClientConnected() { + if (HtmlTerm.Loaded) { + return HtmlTerm.Connected(); + } else { + var FO = GetfTelnetObject(); + if (FO) { return FO.Connected(); } + } + + return false; +} + +function ClientDisconnect() { + if (HtmlTerm.Loaded) { + HtmlTerm.Disconnect(); + } else { + var FO = GetfTelnetObject(); + if (FO) { FO.Disconnect(); } + } +} + +function ClientSetBorderStyle(AStyle) { + ClientVars.BorderStyle = AStyle; + + if (HtmlTerm.Loaded) { + // TODO HtmlTerm doesn't support border style yet + // TODO HtmlTerm.SetBorderStyle(ClientVars.BorderStyle); + } else { + var FO = GetfTelnetObject(); + if (FO) { FO.SetBorderStyle(ClientVars.BorderStyle); } + } +} + +function ClientSetFont(ACodePage, AWidth, AHeight) { + ClientVars.CodePage = ACodePage; + ClientVars.FontWidth = AWidth; + ClientVars.FontHeight = AHeight; + + if (HtmlTerm.Loaded) { + Crt.SetFont(ClientVars.CodePage, ClientVars.FontWidth, ClientVars.FontHeight); + } else { + var FO = GetfTelnetObject(); + if (FO) { FO.SetFont(ClientVars.CodePage, ClientVars.FontWidth, ClientVars.FontHeight); } + } +} + +function ClientSetScreenSize(AColumns, ARows) { + ClientVars.ScreenColumns = AColumns; + ClientVars.ScreenRows = ARows; + + if (HtmlTerm.Loaded) { + Crt.SetScreenSize(ClientVars.ScreenColumns, ClientVars.ScreenRows); + } else { + var FO = GetfTelnetObject(); + if (FO) { FO.SetScreenSize(ClientVars.ScreenColumns, ClientVars.ScreenRows); } + } +} + +function fTelnetResize(AWidth, AHeight) { + var FO = GetfTelnetObject(); + if (FO) { + FO.setAttribute("width", AWidth); + FO.setAttribute("height", AHeight); + } +} + +function GetfTelnetObject() { + var AID = "fTelnet"; + + if (window.document[AID]) { return window.document[AID]; } + + if (navigator.appName.indexOf("Microsoft Internet") == -1) { + if (document.embeds && document.embeds[AID]) { return document.embeds[AID]; } + } else { + return document.getElementById(AID); + } +} diff --git a/web/root/ecWeb/fTelnet/RMLib.dll b/web/root/ecWeb/fTelnet/RMLib.dll new file mode 100644 index 0000000000000000000000000000000000000000..3d27031d770b95a5d1e5532e07d9539f9e481d19 Binary files /dev/null and b/web/root/ecWeb/fTelnet/RMLib.dll differ diff --git a/web/root/ecWeb/fTelnet/fTelnet.ssjs b/web/root/ecWeb/fTelnet/fTelnet.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..8d3141e14f4397bfecf0689b1f61837688a0f0d6 --- /dev/null +++ b/web/root/ecWeb/fTelnet/fTelnet.ssjs @@ -0,0 +1,32 @@ +/* fTelnet.ssjs, from ecWeb v2 for Synchronet BBS 3.15+ + by Derek Mullin (echicken -at- bbs.electronicchicken.com) */ + +/* This should configure and embed the fTelnet flash app for most people. + Should be modified to use exec/load/ftelnethelper.js, but I don't feel + like doing that today. */ + +/* If you're running some other socket policy server on some other port, you + could comment the following if..else block out and just set var fspPort to + whichever port you like. */ +var f = new File(system.ctrl_dir + 'services.ini'); +if(f.open("r")) { + var servicesIni = f.iniGetObject('FlashPolicy'); + f.close(); + var fspPort = servicesIni.Port; +} else { + var fspPort = 843; +} + +print("<p id='ClientContainer' style='text-align: center;'></p>"); +print("<script type='text/javascript' src='" + eval(webIni.webUrl) + "fTelnet/ClientFuncs.js'></script>"); +print("<script type='text/javascript' src='" + eval(webIni.webUrl) + "fTelnet/swfobject.js'></script>"); +print("<script type='text/javascript'>"); +print("var ClientVars = { AutoConnect:0, BitsPerSecond:115200, Blink:1, BorderStyle:'FlashTerm', CodePage:'437', Enter:'\\r', FontHeight:16, FontWidth:9, ScreenColumns:80, ScreenRows:25, SendOnConnect:'' };"); +print("ClientVars.ConnectAnsi = '" + eval(webIni.webUrl) + "fTelnet/img/sync.an1';"); // You could point this to the location of another background ANSI file. +//print("ClientVars.ServerName='" + system.name + "';"); // No matter what I do, anything with an apostrophe in it here breaks fTelnet, so this is commented out. +print("ClientVars.ServerName='BBS';"); +print("ClientVars.SocketPolicyPort = " + fspPort + ";"); // If you're running your Flash Socket Policy server on a nonstandard port, edit this line. +print("ClientVars.TelnetHostName='" + system.inet_addr + "';"); +print("ClientVars.TelnetPort=23;"); // If your telnet server is on a nonstandard port, edit this line. +print("swfobject.embedSWF('" + eval(webIni.webUrl) + "fTelnet/fTelnet.swf','ClientContainer',(location.href.indexOf('file:') === 0) ? 740 : '100%',(location.href.indexOf('file:') === 0) ? 442 : '100%','10.0.0','playerProductInstall.swf',ClientVars,{ allowfullscreen: 'true', allowscriptaccess: 'sameDomain', bgcolor: '#ffffff', quality: 'high' },{ align: 'middle', id: 'fTelnet', name: 'fTelnet', swliveconnect: 'true' },function (callbackObj) {if (!callbackObj.success) { } } );"); +print("</script>"); diff --git a/web/root/ecWeb/fTelnet/fTelnet.swf b/web/root/ecWeb/fTelnet/fTelnet.swf new file mode 100644 index 0000000000000000000000000000000000000000..48d566ead8426a71d26f36e85b4093c59cd9b8fb Binary files /dev/null and b/web/root/ecWeb/fTelnet/fTelnet.swf differ diff --git a/web/root/ecWeb/fTelnet/images/botbg.jpg b/web/root/ecWeb/fTelnet/images/botbg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..75b021f642c8ff3277e5aaeb61adf04a3cd665d9 Binary files /dev/null and b/web/root/ecWeb/fTelnet/images/botbg.jpg differ diff --git a/web/root/ecWeb/fTelnet/images/hidr.jpg b/web/root/ecWeb/fTelnet/images/hidr.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ce5613fa29270624e4ec6888f210618a327fae7f Binary files /dev/null and b/web/root/ecWeb/fTelnet/images/hidr.jpg differ diff --git a/web/root/ecWeb/fTelnet/images/midbg.jpg b/web/root/ecWeb/fTelnet/images/midbg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cd582a1ceec5809b1110c7fa9f94733b21b2fc17 Binary files /dev/null and b/web/root/ecWeb/fTelnet/images/midbg.jpg differ diff --git a/web/root/ecWeb/fTelnet/images/topbg.jpg b/web/root/ecWeb/fTelnet/images/topbg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..aa495d28a343e6ae00c437ad451bb6a11d277d9c Binary files /dev/null and b/web/root/ecWeb/fTelnet/images/topbg.jpg differ diff --git a/web/root/ecWeb/fTelnet/img/ConnectDown.png b/web/root/ecWeb/fTelnet/img/ConnectDown.png new file mode 100644 index 0000000000000000000000000000000000000000..c202c8f697ec6e052ec2e30e18b2addc80af58e0 Binary files /dev/null and b/web/root/ecWeb/fTelnet/img/ConnectDown.png differ diff --git a/web/root/ecWeb/fTelnet/img/ConnectOver.png b/web/root/ecWeb/fTelnet/img/ConnectOver.png new file mode 100644 index 0000000000000000000000000000000000000000..9b76e7508772df7e6ed2d95ac932f6af4d05624e Binary files /dev/null and b/web/root/ecWeb/fTelnet/img/ConnectOver.png differ diff --git a/web/root/ecWeb/fTelnet/img/ConnectUp.png b/web/root/ecWeb/fTelnet/img/ConnectUp.png new file mode 100644 index 0000000000000000000000000000000000000000..0b66f8701d86bf0e10cea26340f7471137211973 Binary files /dev/null and b/web/root/ecWeb/fTelnet/img/ConnectUp.png differ diff --git a/web/root/ecWeb/fTelnet/img/SaveFilesDown.png b/web/root/ecWeb/fTelnet/img/SaveFilesDown.png new file mode 100644 index 0000000000000000000000000000000000000000..b6db5834b1ab85899433f785e9e6006d74eff5ee Binary files /dev/null and b/web/root/ecWeb/fTelnet/img/SaveFilesDown.png differ diff --git a/web/root/ecWeb/fTelnet/img/SaveFilesOver.png b/web/root/ecWeb/fTelnet/img/SaveFilesOver.png new file mode 100644 index 0000000000000000000000000000000000000000..0cb12f8f313caa7c58d8deb5bba4c7caf00c8551 Binary files /dev/null and b/web/root/ecWeb/fTelnet/img/SaveFilesOver.png differ diff --git a/web/root/ecWeb/fTelnet/img/SaveFilesUp.png b/web/root/ecWeb/fTelnet/img/SaveFilesUp.png new file mode 100644 index 0000000000000000000000000000000000000000..90e21ab6e2083f96fa7803bcad7ab43be6e830ac Binary files /dev/null and b/web/root/ecWeb/fTelnet/img/SaveFilesUp.png differ diff --git a/web/root/ecWeb/fTelnet/img/sync.an1 b/web/root/ecWeb/fTelnet/img/sync.an1 new file mode 100644 index 0000000000000000000000000000000000000000..fa852dee8c491fa1a069637c4f57dd7f3f6ec519 --- /dev/null +++ b/web/root/ecWeb/fTelnet/img/sync.an1 @@ -0,0 +1,55 @@ +[?7h[255D[40m + +[0;1m[51C[0;34m�[1m� [0;34m� +[29C� �ܰ[30;44m�[13C[1;34;40m��[9C[30mgj/�� +[7C[37msynchronet [30m�� � [0;34m�[7C߲��� �� [1m�[0;34m� +[8C� � [37m���[1m��� [0;34m�����[1;44m� �[0;34m����[30;44m[40m[A +[38C[44m�[34;40m�� �[1;44m��[0;34m���[1m�[46m�[1C[0m�[1;30m�[0m�[A +[54C[1;47m�����[0m� [34m� ���� +[5C[1m�[0;34m� [37m�[1m�[47m�[40m��[47m��۱[40m� [0;34m�[A +[23C[1;44m��[40m���[0;34m� [37m��� [34m�[1;44m�[0;34m�� [37m��� [A +[43C[34m�[1;44m�[0;34m�[32;44m�[34;46m�[1;40m��[0;34m� [A +[54C[1;30;47m�[37m����[40m� [0m������ [1;34m�� + �[0;34m� [1;37m�[47m�������۲[0m� [1;34m�[46m�[47m�[46m�[40m[A +[25C[40m� [37;47m����[40m� [34m�[44m�[0;34m�[37m�[1;47m���۲[40m[A +[42C[0m� [34;46m�[1;40m� [30m�[0m�[1;47m�����[0m��[1;47m��۲[40m[A +[60C[40m� [0m�[1;47m�۰[1C[0;34m��[1m���[0;34m� +[5C[30;46m�[2C[1;40m�[37;47m�����[0m� �[1;47m��[0m�� [1;34m�� � [A +[27C[37;47m���[40m�[0m�[1;34m�[46m�[1C[30;40m�[0m��[1;47m����[40m[A +[42C[40m� [0m�[1;47m���������[1C[30m�[37m���[40m� [0m�[1;47m�[40m[A +[64C[47m۲[0m�[34m�[1;44m�[40m�[47m��[40m�[0;34m�� � + ��[1;44m�[0;34m� [1;30m�[0m�[1;47m�����[0m� [1;30m�[0m���[1m�[A +[24C[30m�[34m� [37;47m���[40m��[0m�[36m� [34m� [37m�[1;47m�۲[40m[A +[42C[47m�[1C[40m�[47m��������[40m�[0m� [1;30m�[37;47m��۱[0m���[A +[64C[1;47m��[40m���[0m�[1m�[0m�� � [1;34m�[0;30;44m�[40m + [34m�[1;44m��[1C�[40m�[0;34;46m�[40m�� [37m��[1;47m���[0m� [A +[20C[1;47m����[0m� [1;30m�[37;47m���[40m��[47m���[40m�[0m� [A +[39C[1;47m��� [30;40m�[37;47m����[0m� [1m�[47m���[1C[0;34m� [1;37m�[A +[58C[47m�������۲�[1C[0;34m�[1m�[0;36m�[1;34m�[0;34m��[1m�[0;34m� + �[36;44m�[34;46m�[1;40m���� [0m��� [34m� [37m��[1;47m�[0m�[1m�[A +[21C[47m����[0m��[1;47m�۲[0m�[1;47m�������[0m�[1;47m���[0m�[1;30m�[A +[44C[37;47m��۱[2C[0;34m�[1;30m�[0m�[1m�� [0m�[1;47m���[0m� �[A +[65C[1;47m���[0m� [34m�[1m��[46m�[40m + [0;34m�[1m�[46m߲[40m�[0m�[30;47m�[37;40m�[1m�[0m����[47m [40m[A +[17C[1;40m��[47m [0m�[1;30;47m�[37;40m�[47m�����۱[1C����[1C[40m[A +[36C[40m��[47m�۲�[0m� [1;30;47m�[37m���[0m�� [34m�� [37mܱ[1;30m� [A +[58C[0m�[1;47m��[0m�[34m��[37m�[1;47m���[0m� [1;36;44m�[34;40m�� +[8C[0m�[30;47m�[37;40m���[1;47m۲��� [0m���[1;30;47m�[40m� [0m�[A +[26C[1;47m���[0m���[1;47m��[0m�� [1m��[47m۱�[0m� �[47m [40m[A +[47C[1;40m��[47m �[0m�[1;47m�[0m�۲[1m�[0;34m�[37m�[1;47m�[0m�[1m[A +[61C�[34m�[0;36;44m�[37;40m�[1;47m���[0m�[1m�[0;36m�� +[5C�[30;46m�[2C[1;37;40m�[47m���[40m�[0m����� [1;34m��[0;34m�� [37m[A +[25C�[1;47m���[1C[40m���[47m���[40m�[0;34m�[1m� [37m�[47m��[40m[A +[43C[40m�[0m� [34m� [37m����[30;47m�[37;40m�[1m�� [0m��[1m� [A +[62C[0;36;44m�[1C[1;37;40m�[0m��[30;47m�[1;37;40m� [36m� +[7C[0;36m� � ��[1m�[0;36m���[1m�[44m�[0;36;44m�[34;40m��[37m�[A +[25C[47m [40m�[1;33;47m�[40m�[30m�[0m�[30;47m�[2C[34;40m� [1;37m� [A +[38C[36m�[34;46m�[40m�� [37m����� [0;34m� ��� [1;37m�[0m�[1m� [A +[61C[34m� [0m���[1m�� +[17C[0;34m� �[30;44m�[2C[1;37;40m�[47m�[33m�۲�[37;40m���[33m� [A +[36C[0;34m��[44m [36m�߰[34;40m�[1m��[5C[0m� �[6C[34m� +[27C[1;33m����[13C[0;34m�[1mݰ[0;30;44m�[3C[1;33;40mbbs [0msoftware +[26C[1;33m��[37m�[12C[0;34m� � +[25C[1;36m�[37m�[33m�� +[26C�� +[26C�[0m diff --git a/web/root/ecWeb/fTelnet/playerProductInstall.swf b/web/root/ecWeb/fTelnet/playerProductInstall.swf new file mode 100644 index 0000000000000000000000000000000000000000..bdc3437856cb0ae54bb9423700ba6ec89f35282c Binary files /dev/null and b/web/root/ecWeb/fTelnet/playerProductInstall.swf differ diff --git a/web/root/ecWeb/fTelnet/swfobject.js b/web/root/ecWeb/fTelnet/swfobject.js new file mode 100644 index 0000000000000000000000000000000000000000..bf35c07c8f4e0bde7b0bfab54712c1abfb30dcaa --- /dev/null +++ b/web/root/ecWeb/fTelnet/swfobject.js @@ -0,0 +1,777 @@ +/*! SWFObject v2.2 <http://code.google.com/p/swfobject/> + is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> +*/ + +var swfobject = function() { + + var UNDEF = "undefined", + OBJECT = "object", + SHOCKWAVE_FLASH = "Shockwave Flash", + SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", + FLASH_MIME_TYPE = "application/x-shockwave-flash", + EXPRESS_INSTALL_ID = "SWFObjectExprInst", + ON_READY_STATE_CHANGE = "onreadystatechange", + + win = window, + doc = document, + nav = navigator, + + plugin = false, + domLoadFnArr = [main], + regObjArr = [], + objIdArr = [], + listenersArr = [], + storedAltContent, + storedAltContentId, + storedCallbackFn, + storedCallbackObj, + isDomLoaded = false, + isExpressInstallActive = false, + dynamicStylesheet, + dynamicStylesheetMedia, + autoHideShow = true, + + /* Centralized function for browser feature detection + - User agent string detection is only used when no good alternative is possible + - Is executed directly for optimal performance + */ + ua = function() { + var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, + u = nav.userAgent.toLowerCase(), + p = nav.platform.toLowerCase(), + windows = p ? /win/.test(p) : /win/.test(u), + mac = p ? /mac/.test(p) : /mac/.test(u), + webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit + ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html + playerVersion = [0,0,0], + d = null; + if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) { + d = nav.plugins[SHOCKWAVE_FLASH].description; + if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+ + plugin = true; + ie = false; // cascaded feature detection for Internet Explorer + d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); + playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); + playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); + playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0; + } + } + else if (typeof win.ActiveXObject != UNDEF) { + try { + var a = new ActiveXObject(SHOCKWAVE_FLASH_AX); + if (a) { // a will return null when ActiveX is disabled + d = a.GetVariable("$version"); + if (d) { + ie = true; // cascaded feature detection for Internet Explorer + d = d.split(" ")[1].split(","); + playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; + } + } + } + catch(e) {} + } + return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac }; + }(), + + /* Cross-browser onDomLoad + - Will fire an event as soon as the DOM of a web page is loaded + - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/ + - Regular onload serves as fallback + */ + onDomLoad = function() { + if (!ua.w3) { return; } + if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically + callDomLoadFunctions(); + } + if (!isDomLoaded) { + if (typeof doc.addEventListener != UNDEF) { + doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false); + } + if (ua.ie && ua.win) { + doc.attachEvent(ON_READY_STATE_CHANGE, function() { + if (doc.readyState == "complete") { + doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee); + callDomLoadFunctions(); + } + }); + if (win == top) { // if not inside an iframe + (function(){ + if (isDomLoaded) { return; } + try { + doc.documentElement.doScroll("left"); + } + catch(e) { + setTimeout(arguments.callee, 0); + return; + } + callDomLoadFunctions(); + })(); + } + } + if (ua.wk) { + (function(){ + if (isDomLoaded) { return; } + if (!/loaded|complete/.test(doc.readyState)) { + setTimeout(arguments.callee, 0); + return; + } + callDomLoadFunctions(); + })(); + } + addLoadEvent(callDomLoadFunctions); + } + }(); + + function callDomLoadFunctions() { + if (isDomLoaded) { return; } + try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early + var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span")); + t.parentNode.removeChild(t); + } + catch (e) { return; } + isDomLoaded = true; + var dl = domLoadFnArr.length; + for (var i = 0; i < dl; i++) { + domLoadFnArr[i](); + } + } + + function addDomLoadEvent(fn) { + if (isDomLoaded) { + fn(); + } + else { + domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+ + } + } + + /* Cross-browser onload + - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/ + - Will fire an event as soon as a web page including all of its assets are loaded + */ + function addLoadEvent(fn) { + if (typeof win.addEventListener != UNDEF) { + win.addEventListener("load", fn, false); + } + else if (typeof doc.addEventListener != UNDEF) { + doc.addEventListener("load", fn, false); + } + else if (typeof win.attachEvent != UNDEF) { + addListener(win, "onload", fn); + } + else if (typeof win.onload == "function") { + var fnOld = win.onload; + win.onload = function() { + fnOld(); + fn(); + }; + } + else { + win.onload = fn; + } + } + + /* Main function + - Will preferably execute onDomLoad, otherwise onload (as a fallback) + */ + function main() { + if (plugin) { + testPlayerVersion(); + } + else { + matchVersions(); + } + } + + /* Detect the Flash Player version for non-Internet Explorer browsers + - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description: + a. Both release and build numbers can be detected + b. Avoid wrong descriptions by corrupt installers provided by Adobe + c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports + - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available + */ + function testPlayerVersion() { + var b = doc.getElementsByTagName("body")[0]; + var o = createElement(OBJECT); + o.setAttribute("type", FLASH_MIME_TYPE); + var t = b.appendChild(o); + if (t) { + var counter = 0; + (function(){ + if (typeof t.GetVariable != UNDEF) { + var d = t.GetVariable("$version"); + if (d) { + d = d.split(" ")[1].split(","); + ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; + } + } + else if (counter < 10) { + counter++; + setTimeout(arguments.callee, 10); + return; + } + b.removeChild(o); + t = null; + matchVersions(); + })(); + } + else { + matchVersions(); + } + } + + /* Perform Flash Player and SWF version matching; static publishing only + */ + function matchVersions() { + var rl = regObjArr.length; + if (rl > 0) { + for (var i = 0; i < rl; i++) { // for each registered object element + var id = regObjArr[i].id; + var cb = regObjArr[i].callbackFn; + var cbObj = {success:false, id:id}; + if (ua.pv[0] > 0) { + var obj = getElementById(id); + if (obj) { + if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match! + setVisibility(id, true); + if (cb) { + cbObj.success = true; + cbObj.ref = getObjectById(id); + cb(cbObj); + } + } + else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported + var att = {}; + att.data = regObjArr[i].expressInstall; + att.width = obj.getAttribute("width") || "0"; + att.height = obj.getAttribute("height") || "0"; + if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); } + if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); } + // parse HTML object param element's name-value pairs + var par = {}; + var p = obj.getElementsByTagName("param"); + var pl = p.length; + for (var j = 0; j < pl; j++) { + if (p[j].getAttribute("name").toLowerCase() != "movie") { + par[p[j].getAttribute("name")] = p[j].getAttribute("value"); + } + } + showExpressInstall(att, par, id, cb); + } + else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF + displayAltContent(obj); + if (cb) { cb(cbObj); } + } + } + } + else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content) + setVisibility(id, true); + if (cb) { + var o = getObjectById(id); // test whether there is an HTML object element or not + if (o && typeof o.SetVariable != UNDEF) { + cbObj.success = true; + cbObj.ref = o; + } + cb(cbObj); + } + } + } + } + } + + function getObjectById(objectIdStr) { + var r = null; + var o = getElementById(objectIdStr); + if (o && o.nodeName == "OBJECT") { + if (typeof o.SetVariable != UNDEF) { + r = o; + } + else { + var n = o.getElementsByTagName(OBJECT)[0]; + if (n) { + r = n; + } + } + } + return r; + } + + /* Requirements for Adobe Express Install + - only one instance can be active at a time + - fp 6.0.65 or higher + - Win/Mac OS only + - no Webkit engines older than version 312 + */ + function canExpressInstall() { + return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312); + } + + /* Show the Adobe Express Install dialog + - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 + */ + function showExpressInstall(att, par, replaceElemIdStr, callbackFn) { + isExpressInstallActive = true; + storedCallbackFn = callbackFn || null; + storedCallbackObj = {success:false, id:replaceElemIdStr}; + var obj = getElementById(replaceElemIdStr); + if (obj) { + if (obj.nodeName == "OBJECT") { // static publishing + storedAltContent = abstractAltContent(obj); + storedAltContentId = null; + } + else { // dynamic publishing + storedAltContent = obj; + storedAltContentId = replaceElemIdStr; + } + att.id = EXPRESS_INSTALL_ID; + if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; } + if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; } + doc.title = doc.title.slice(0, 47) + " - Flash Player Installation"; + var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", + fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title; + if (typeof par.flashvars != UNDEF) { + par.flashvars += "&" + fv; + } + else { + par.flashvars = fv; + } + // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, + // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work + if (ua.ie && ua.win && obj.readyState != 4) { + var newObj = createElement("div"); + replaceElemIdStr += "SWFObjectNew"; + newObj.setAttribute("id", replaceElemIdStr); + obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf + obj.style.display = "none"; + (function(){ + if (obj.readyState == 4) { + obj.parentNode.removeChild(obj); + } + else { + setTimeout(arguments.callee, 10); + } + })(); + } + createSWF(att, par, replaceElemIdStr); + } + } + + /* Functions to abstract and display alternative content + */ + function displayAltContent(obj) { + if (ua.ie && ua.win && obj.readyState != 4) { + // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, + // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work + var el = createElement("div"); + obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content + el.parentNode.replaceChild(abstractAltContent(obj), el); + obj.style.display = "none"; + (function(){ + if (obj.readyState == 4) { + obj.parentNode.removeChild(obj); + } + else { + setTimeout(arguments.callee, 10); + } + })(); + } + else { + obj.parentNode.replaceChild(abstractAltContent(obj), obj); + } + } + + function abstractAltContent(obj) { + var ac = createElement("div"); + if (ua.win && ua.ie) { + ac.innerHTML = obj.innerHTML; + } + else { + var nestedObj = obj.getElementsByTagName(OBJECT)[0]; + if (nestedObj) { + var c = nestedObj.childNodes; + if (c) { + var cl = c.length; + for (var i = 0; i < cl; i++) { + if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) { + ac.appendChild(c[i].cloneNode(true)); + } + } + } + } + } + return ac; + } + + /* Cross-browser dynamic SWF creation + */ + function createSWF(attObj, parObj, id) { + var r, el = getElementById(id); + if (ua.wk && ua.wk < 312) { return r; } + if (el) { + if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content + attObj.id = id; + } + if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML + var att = ""; + for (var i in attObj) { + if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries + if (i.toLowerCase() == "data") { + parObj.movie = attObj[i]; + } + else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword + att += ' class="' + attObj[i] + '"'; + } + else if (i.toLowerCase() != "classid") { + att += ' ' + i + '="' + attObj[i] + '"'; + } + } + } + var par = ""; + for (var j in parObj) { + if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries + par += '<param name="' + j + '" value="' + parObj[j] + '" />'; + } + } + el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>'; + objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only) + r = getElementById(attObj.id); + } + else { // well-behaving browsers + var o = createElement(OBJECT); + o.setAttribute("type", FLASH_MIME_TYPE); + for (var m in attObj) { + if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries + if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword + o.setAttribute("class", attObj[m]); + } + else if (m.toLowerCase() != "classid") { // filter out IE specific attribute + o.setAttribute(m, attObj[m]); + } + } + } + for (var n in parObj) { + if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element + createObjParam(o, n, parObj[n]); + } + } + el.parentNode.replaceChild(o, el); + r = o; + } + } + return r; + } + + function createObjParam(el, pName, pValue) { + var p = createElement("param"); + p.setAttribute("name", pName); + p.setAttribute("value", pValue); + el.appendChild(p); + } + + /* Cross-browser SWF removal + - Especially needed to safely and completely remove a SWF in Internet Explorer + */ + function removeSWF(id) { + var obj = getElementById(id); + if (obj && obj.nodeName == "OBJECT") { + if (ua.ie && ua.win) { + obj.style.display = "none"; + (function(){ + if (obj.readyState == 4) { + removeObjectInIE(id); + } + else { + setTimeout(arguments.callee, 10); + } + })(); + } + else { + obj.parentNode.removeChild(obj); + } + } + } + + function removeObjectInIE(id) { + var obj = getElementById(id); + if (obj) { + for (var i in obj) { + if (typeof obj[i] == "function") { + obj[i] = null; + } + } + obj.parentNode.removeChild(obj); + } + } + + /* Functions to optimize JavaScript compression + */ + function getElementById(id) { + var el = null; + try { + el = doc.getElementById(id); + } + catch (e) {} + return el; + } + + function createElement(el) { + return doc.createElement(el); + } + + /* Updated attachEvent function for Internet Explorer + - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks + */ + function addListener(target, eventType, fn) { + target.attachEvent(eventType, fn); + listenersArr[listenersArr.length] = [target, eventType, fn]; + } + + /* Flash Player and SWF content version matching + */ + function hasPlayerVersion(rv) { + var pv = ua.pv, v = rv.split("."); + v[0] = parseInt(v[0], 10); + v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0" + v[2] = parseInt(v[2], 10) || 0; + return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; + } + + /* Cross-browser dynamic CSS creation + - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php + */ + function createCSS(sel, decl, media, newStyle) { + if (ua.ie && ua.mac) { return; } + var h = doc.getElementsByTagName("head")[0]; + if (!h) { return; } // to also support badly authored HTML pages that lack a head element + var m = (media && typeof media == "string") ? media : "screen"; + if (newStyle) { + dynamicStylesheet = null; + dynamicStylesheetMedia = null; + } + if (!dynamicStylesheet || dynamicStylesheetMedia != m) { + // create dynamic stylesheet + get a global reference to it + var s = createElement("style"); + s.setAttribute("type", "text/css"); + s.setAttribute("media", m); + dynamicStylesheet = h.appendChild(s); + if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) { + dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1]; + } + dynamicStylesheetMedia = m; + } + // add style rule + if (ua.ie && ua.win) { + if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) { + dynamicStylesheet.addRule(sel, decl); + } + } + else { + if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) { + dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}")); + } + } + } + + function setVisibility(id, isVisible) { + if (!autoHideShow) { return; } + var v = isVisible ? "visible" : "hidden"; + if (isDomLoaded && getElementById(id)) { + getElementById(id).style.visibility = v; + } + else { + createCSS("#" + id, "visibility:" + v); + } + } + + /* Filter to avoid XSS attacks + */ + function urlEncodeIfNecessary(s) { + var regex = /[\\\"<>\.;]/; + var hasBadChars = regex.exec(s) != null; + return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s; + } + + /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only) + */ + var cleanup = function() { + if (ua.ie && ua.win) { + window.attachEvent("onunload", function() { + // remove listeners to avoid memory leaks + var ll = listenersArr.length; + for (var i = 0; i < ll; i++) { + listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]); + } + // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect + var il = objIdArr.length; + for (var j = 0; j < il; j++) { + removeSWF(objIdArr[j]); + } + // cleanup library's main closures to avoid memory leaks + for (var k in ua) { + ua[k] = null; + } + ua = null; + for (var l in swfobject) { + swfobject[l] = null; + } + swfobject = null; + }); + } + }(); + + return { + /* Public API + - Reference: http://code.google.com/p/swfobject/wiki/documentation + */ + registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) { + if (ua.w3 && objectIdStr && swfVersionStr) { + var regObj = {}; + regObj.id = objectIdStr; + regObj.swfVersion = swfVersionStr; + regObj.expressInstall = xiSwfUrlStr; + regObj.callbackFn = callbackFn; + regObjArr[regObjArr.length] = regObj; + setVisibility(objectIdStr, false); + } + else if (callbackFn) { + callbackFn({success:false, id:objectIdStr}); + } + }, + + getObjectById: function(objectIdStr) { + if (ua.w3) { + return getObjectById(objectIdStr); + } + }, + + embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) { + var callbackObj = {success:false, id:replaceElemIdStr}; + if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) { + setVisibility(replaceElemIdStr, false); + addDomLoadEvent(function() { + widthStr += ""; // auto-convert to string + heightStr += ""; + var att = {}; + if (attObj && typeof attObj === OBJECT) { + for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs + att[i] = attObj[i]; + } + } + att.data = swfUrlStr; + att.width = widthStr; + att.height = heightStr; + var par = {}; + if (parObj && typeof parObj === OBJECT) { + for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs + par[j] = parObj[j]; + } + } + if (flashvarsObj && typeof flashvarsObj === OBJECT) { + for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs + if (typeof par.flashvars != UNDEF) { + par.flashvars += "&" + k + "=" + flashvarsObj[k]; + } + else { + par.flashvars = k + "=" + flashvarsObj[k]; + } + } + } + if (hasPlayerVersion(swfVersionStr)) { // create SWF + var obj = createSWF(att, par, replaceElemIdStr); + if (att.id == replaceElemIdStr) { + setVisibility(replaceElemIdStr, true); + } + callbackObj.success = true; + callbackObj.ref = obj; + } + else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install + att.data = xiSwfUrlStr; + showExpressInstall(att, par, replaceElemIdStr, callbackFn); + return; + } + else { // show alternative content + setVisibility(replaceElemIdStr, true); + } + if (callbackFn) { callbackFn(callbackObj); } + }); + } + else if (callbackFn) { callbackFn(callbackObj); } + }, + + switchOffAutoHideShow: function() { + autoHideShow = false; + }, + + ua: ua, + + getFlashPlayerVersion: function() { + return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] }; + }, + + hasFlashPlayerVersion: hasPlayerVersion, + + createSWF: function(attObj, parObj, replaceElemIdStr) { + if (ua.w3) { + return createSWF(attObj, parObj, replaceElemIdStr); + } + else { + return undefined; + } + }, + + showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) { + if (ua.w3 && canExpressInstall()) { + showExpressInstall(att, par, replaceElemIdStr, callbackFn); + } + }, + + removeSWF: function(objElemIdStr) { + if (ua.w3) { + removeSWF(objElemIdStr); + } + }, + + createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) { + if (ua.w3) { + createCSS(selStr, declStr, mediaStr, newStyleBoolean); + } + }, + + addDomLoadEvent: addDomLoadEvent, + + addLoadEvent: addLoadEvent, + + getQueryParamValue: function(param) { + var q = doc.location.search || doc.location.hash; + if (q) { + if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark + if (param == null) { + return urlEncodeIfNecessary(q); + } + var pairs = q.split("&"); + for (var i = 0; i < pairs.length; i++) { + if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { + return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1))); + } + } + } + return ""; + }, + + // For internal usage only + expressInstallCallback: function() { + if (isExpressInstallActive) { + var obj = getElementById(EXPRESS_INSTALL_ID); + if (obj && storedAltContent) { + obj.parentNode.replaceChild(storedAltContent, obj); + if (storedAltContentId) { + setVisibility(storedAltContentId, true); + if (ua.ie && ua.win) { storedAltContent.style.display = "block"; } + } + if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); } + } + isExpressInstallActive = false; + } + } + }; +}(); diff --git a/web/root/ecWeb/favicon.ico b/web/root/ecWeb/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..bcf9f091444f146b69a3da4e0eeb6f35fb84baf0 Binary files /dev/null and b/web/root/ecWeb/favicon.ico differ diff --git a/web/root/ecWeb/index.ssjs b/web/root/ecWeb/index.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..d8c2fa534b7170148ad8aef4523c7584b9459973 --- /dev/null +++ b/web/root/ecWeb/index.ssjs @@ -0,0 +1,14 @@ +/* index.ssjs, from ecWeb v2 for Synchronet BBS 3.15+ + by Derek Mullin (echicken -at- bbs.electronicchicken.com) */ + +/* This placeholder file is equivalent to pages.ssjs?page=000-home.ssjs. If + you want to make changes to the 'home' page of your site, make them in + ~pages/000-home.ssjs rather than editing this file. */ + +load('webInit.ssjs'); +load(webIni.webRoot + '/themes/' + webIni.theme + "/layout.ssjs"); + +var pageTitle = "Home"; +openPage("Home"); +load(webIni.webRoot + '/pages/000-home.ssjs'); +closePage(); \ No newline at end of file diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/a.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/a.asc new file mode 100644 index 0000000000000000000000000000000000000000..39659255cb6ed8c050908718e500e21a945f4adf --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/a.asc @@ -0,0 +1,5 @@ + + __ _ +/ _` | +\__,_| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/b.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/b.asc new file mode 100644 index 0000000000000000000000000000000000000000..4b3d802b64385c22324397b0c733f957cdd3110e --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/b.asc @@ -0,0 +1,5 @@ + _ +| |__ +| '_ \ +|_.__/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/c.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/c.asc new file mode 100644 index 0000000000000000000000000000000000000000..9b60e4c3002b1c819d71339b869ec971e5b6fee2 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/c.asc @@ -0,0 +1,5 @@ + + __ +/ _| +\__| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/d.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/d.asc new file mode 100644 index 0000000000000000000000000000000000000000..07c4533906f3548150c692cac07288a531f32b73 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/d.asc @@ -0,0 +1,5 @@ + _ + __| | +/ _` | +\__,_| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/e.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/e.asc new file mode 100644 index 0000000000000000000000000000000000000000..3c27e82cfb99bde4438ed481b6eafb728a706b8d --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/e.asc @@ -0,0 +1,5 @@ + + ___ +/ -_) +\___| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/f.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/f.asc new file mode 100644 index 0000000000000000000000000000000000000000..14be978d4f3d71fac47ff97a606b580479cafbb8 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/f.asc @@ -0,0 +1,5 @@ + __ + / _| +| _| +|_| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/g.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/g.asc new file mode 100644 index 0000000000000000000000000000000000000000..159999438576666934c3a730d7ff19831afcedb4 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/g.asc @@ -0,0 +1,5 @@ + + __ _ +/ _` | +\__, | +|___/ diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/h.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/h.asc new file mode 100644 index 0000000000000000000000000000000000000000..7713959cecaecfd59e205710c60f89e880aeda07 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/h.asc @@ -0,0 +1,5 @@ + _ +| |_ +| ' \ +|_||_| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/i.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/i.asc new file mode 100644 index 0000000000000000000000000000000000000000..d0bdfaa78c1d3bee32fa5c27f300297c3a82ac00 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/i.asc @@ -0,0 +1,5 @@ + _ +(_) +| | +|_| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/j.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/j.asc new file mode 100644 index 0000000000000000000000000000000000000000..2a150e5f55f1b3b49fc0e2196e38e3d0000fdee0 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/j.asc @@ -0,0 +1,5 @@ + _ + (_) + | | + _/ | +|__/ diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/k.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/k.asc new file mode 100644 index 0000000000000000000000000000000000000000..a675f70baefa49f3d1b5967c532f77e149a50922 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/k.asc @@ -0,0 +1,5 @@ + _ +| |__ +| / / +|_\_\ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/l.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/l.asc new file mode 100644 index 0000000000000000000000000000000000000000..61dd29ecc5c16ffef961dc6751deea873bd21fc1 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/l.asc @@ -0,0 +1,5 @@ + _ +| | +| | +|_| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/m.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/m.asc new file mode 100644 index 0000000000000000000000000000000000000000..c52fdf8da83b8b9a87e23ee30df1a62657002b4f --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/m.asc @@ -0,0 +1,5 @@ + + _ __ +| ' \ +|_|_|_| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/n.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/n.asc new file mode 100644 index 0000000000000000000000000000000000000000..2e6567751aa7567fd9fb00545c7a99db80cba9c3 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/n.asc @@ -0,0 +1,5 @@ + + _ _ +| ' \ +|_||_| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/o.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/o.asc new file mode 100644 index 0000000000000000000000000000000000000000..9a82efe0a0581dd8bf68aa309f7fcb148f9b1dc3 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/o.asc @@ -0,0 +1,5 @@ + + ___ +/ _ \ +\___/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/p.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/p.asc new file mode 100644 index 0000000000000000000000000000000000000000..48a11563d78bfe468dcd9eda578d742a43382b2f --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/p.asc @@ -0,0 +1,5 @@ + + _ __ +| '_ \ +| .__/ +|_| diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/q.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/q.asc new file mode 100644 index 0000000000000000000000000000000000000000..ad7287b97dd32ea65c74d6feed2f186fb0a10f8f --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/q.asc @@ -0,0 +1,5 @@ + + __ _ +/ _` | +\__, | + |_| diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/r.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/r.asc new file mode 100644 index 0000000000000000000000000000000000000000..cc72c511bc9ba648c8a05a4db4c2ef51bed41490 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/r.asc @@ -0,0 +1,5 @@ + + _ _ +| '_| +|_| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/s.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/s.asc new file mode 100644 index 0000000000000000000000000000000000000000..e49d8b398dde19b5274959b781ab40fdffee2d1e --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/s.asc @@ -0,0 +1,5 @@ + + ___ +(_-< +/__/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/t.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/t.asc new file mode 100644 index 0000000000000000000000000000000000000000..cfbf71009294ca0fd9f3132cd90c82be54bc2e51 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/t.asc @@ -0,0 +1,5 @@ + _ +| |_ +| _| + \__| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/u.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/u.asc new file mode 100644 index 0000000000000000000000000000000000000000..fa987233d04feebeccb1cc42d2e4e2d8fe085d77 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/u.asc @@ -0,0 +1,5 @@ + + _ _ +| || | + \_,_| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/v.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/v.asc new file mode 100644 index 0000000000000000000000000000000000000000..b6d557e787f29e3483b778faefac555e4bdc7b22 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/v.asc @@ -0,0 +1,5 @@ + +__ __ +\ V / + \_/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/w.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/w.asc new file mode 100644 index 0000000000000000000000000000000000000000..a91fb81d9977fba7e4430338a4d1098af98c51d4 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/w.asc @@ -0,0 +1,5 @@ + +__ __ __ +\ V V / + \_/\_/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/x.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/x.asc new file mode 100644 index 0000000000000000000000000000000000000000..38dcd38a94ccf10cf7a27d9023be3601528e59c8 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/x.asc @@ -0,0 +1,5 @@ + +__ __ +\ \ / +/_\_\ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/y.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/y.asc new file mode 100644 index 0000000000000000000000000000000000000000..ded188655829bbb3c2017be6b754cc994396cc04 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/y.asc @@ -0,0 +1,5 @@ + + _ _ +| || | + \_, | + |__/ diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-small/z.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-small/z.asc new file mode 100644 index 0000000000000000000000000000000000000000..8ab337fae568aecde8487772ca5d7065eb7f58ce --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-small/z.asc @@ -0,0 +1,5 @@ + + ___ +|_ / +/__| + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/a.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/a.asc new file mode 100644 index 0000000000000000000000000000000000000000..d3242f316f7c0f0d974bb0e0e862d32738473b58 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/a.asc @@ -0,0 +1,5 @@ + + ___ _ +/ _ `/ +\_,_/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/b.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/b.asc new file mode 100644 index 0000000000000000000000000000000000000000..3d0ff070b0964c2a8340d9393d645bc5ce9deb9a --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/b.asc @@ -0,0 +1,5 @@ + __ + / / + / _ \ +/_.__/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/c.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/c.asc new file mode 100644 index 0000000000000000000000000000000000000000..b16bf240090831e7d3bc31edd55963db3fdbf463 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/c.asc @@ -0,0 +1,5 @@ + + ____ +/ __/ +\__/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/d.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/d.asc new file mode 100644 index 0000000000000000000000000000000000000000..509f82177ce634e811af8622bcdbd0d70d302f0f --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/d.asc @@ -0,0 +1,5 @@ + __ + ___/ / +/ _ / +\_,_/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/e.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/e.asc new file mode 100644 index 0000000000000000000000000000000000000000..139b09c0a6e3aa0a3e0d2c68dc3e609c4ee52911 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/e.asc @@ -0,0 +1,5 @@ + + ___ +/ -_) +\__/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/f.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/f.asc new file mode 100644 index 0000000000000000000000000000000000000000..9f15aa9ca3e27b9cb146528c192ef00b3468c8b4 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/f.asc @@ -0,0 +1,5 @@ + ___ + / _/ + / _/ +/_/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/g.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/g.asc new file mode 100644 index 0000000000000000000000000000000000000000..26b122fb13ff1892b4a53d7948d0452027973217 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/g.asc @@ -0,0 +1,5 @@ + + ___ _ + / _ `/ + \_, / +/___/ diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/h.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/h.asc new file mode 100644 index 0000000000000000000000000000000000000000..de560bdac8cb6c43c0823a54efa45449618e5768 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/h.asc @@ -0,0 +1,5 @@ + __ + / / + / _ \ +/_//_/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/i.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/i.asc new file mode 100644 index 0000000000000000000000000000000000000000..674d04ecb572b970a00119a4474735a26668b36e --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/i.asc @@ -0,0 +1,5 @@ + _ + (_) + / / +/_/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/j.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/j.asc new file mode 100644 index 0000000000000000000000000000000000000000..a8032a8059f2af1fbfa030073bf837904b27d63d --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/j.asc @@ -0,0 +1,5 @@ + _ + (_) + / / + __/ / +|___/ diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/k.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/k.asc new file mode 100644 index 0000000000000000000000000000000000000000..7a2f094f585d26571086fa4c657f8fc49e010c90 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/k.asc @@ -0,0 +1,5 @@ + __ + / /__ + / '_/ +/_/\_\ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/l.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/l.asc new file mode 100644 index 0000000000000000000000000000000000000000..cdb4c4779fda150878f706159336ebec0d5bd48b --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/l.asc @@ -0,0 +1,5 @@ + __ + / / + / / +/_/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/m.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/m.asc new file mode 100644 index 0000000000000000000000000000000000000000..a30b317797dfc4b88ceff24faa652f29af020a65 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/m.asc @@ -0,0 +1,5 @@ + + __ _ + / ' \ +/_/_/_/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/n.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/n.asc new file mode 100644 index 0000000000000000000000000000000000000000..500d671c1102f8fdc290d92be6952cdab9a7ee2a --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/n.asc @@ -0,0 +1,5 @@ + + ___ + / _ \ +/_//_/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/o.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/o.asc new file mode 100644 index 0000000000000000000000000000000000000000..9a82efe0a0581dd8bf68aa309f7fcb148f9b1dc3 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/o.asc @@ -0,0 +1,5 @@ + + ___ +/ _ \ +\___/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/p.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/p.asc new file mode 100644 index 0000000000000000000000000000000000000000..7110f3985b99d50041000a7724d43633c4c31e24 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/p.asc @@ -0,0 +1,5 @@ + + ___ + / _ \ + / .__/ +/_/ diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/q.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/q.asc new file mode 100644 index 0000000000000000000000000000000000000000..ee1365b69a7741d7b69773ff9f7b3897674813a8 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/q.asc @@ -0,0 +1,5 @@ + + ___ _ +/ _ `/ +\_, / + /_/ diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/r.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/r.asc new file mode 100644 index 0000000000000000000000000000000000000000..8a6a746cbfbdfc431911055a7ee3019e19715b5f --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/r.asc @@ -0,0 +1,5 @@ + + ____ + / __/ +/_/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/s.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/s.asc new file mode 100644 index 0000000000000000000000000000000000000000..057cbc2704a98dcaf7a9fd1a5dd756a24d9f7f1d --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/s.asc @@ -0,0 +1,5 @@ + + ___ + (_-< +/___/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/t.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/t.asc new file mode 100644 index 0000000000000000000000000000000000000000..a2cfa5f7b5eea8a1a766342c57aa2a436f004f27 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/t.asc @@ -0,0 +1,5 @@ + __ + / /_ +/ __/ +\__/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/u.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/u.asc new file mode 100644 index 0000000000000000000000000000000000000000..abb344ad1b0b86ad274328ba76b99a2f12344efe --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/u.asc @@ -0,0 +1,5 @@ + + __ __ +/ // / +\_,_/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/v.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/v.asc new file mode 100644 index 0000000000000000000000000000000000000000..d8f6fac90ae204709213a9f4b9e4d2596965609f --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/v.asc @@ -0,0 +1,5 @@ + + _ __ +| |/ / +|___/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/w.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/w.asc new file mode 100644 index 0000000000000000000000000000000000000000..606b337f7ea03adf140cc89c63c0e014ffdca543 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/w.asc @@ -0,0 +1,5 @@ + + _ __ +| |/|/ / +|__,__/ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/x.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/x.asc new file mode 100644 index 0000000000000000000000000000000000000000..69ce61d72a1b003dbeb97c820882be2173a386e4 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/x.asc @@ -0,0 +1,5 @@ + + __ __ + \ \ / +/_\_\ + diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/y.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/y.asc new file mode 100644 index 0000000000000000000000000000000000000000..4c639b81282340f396a7a9443a77107ff8ca919d --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/y.asc @@ -0,0 +1,5 @@ + + __ __ + / // / + \_, / +/___/ diff --git a/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/z.asc b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/z.asc new file mode 100644 index 0000000000000000000000000000000000000000..8c669106dbd0d21827a933d0364d5698e835b411 --- /dev/null +++ b/web/root/ecWeb/lib/captchaAnsis/figlet-smslant/z.asc @@ -0,0 +1,5 @@ + + ___ +/_ / +/__/ + diff --git a/web/root/ecWeb/lib/captchaLib.ssjs b/web/root/ecWeb/lib/captchaLib.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..a0b595362845056b1683a6190e36d00474a52606 --- /dev/null +++ b/web/root/ecWeb/lib/captchaLib.ssjs @@ -0,0 +1,56 @@ +/* captchaLib.ssjs, from ecWeb v2 for Synchronet BBS 3.15+ + by Derek Mullin (echicken -at- bbs.electronicchicken.com) */ + +/* A cheesy ASCII art CAPTCHA. You can add your own fonts by placing a sub- + directory full of .asc or .ans files within ~lib/captchaAnsis/ (one file + per letter of the alphabet.) + + You can use the insertCaptcha() function to add a CAPTCHA to any form. Just + call the function at some point before your closing </form> tag. It will add + two inputs to the form - one hidden, named 'letters2', which contains the + md5 sum of the letters of the CAPTCHA, and a text input named 'letters1' to + take input from the user. When the form is submitted, find the md5 sum of + 'letters1' and compare it to 'letters2' - if they match, the user passed the + test. */ + +function insertCaptcha() { + var d = directory(webIni.webRoot + "/lib/captchaAnsis/*"); + var randomFont = Math.floor(Math.random() * (d.length)); + var f = directory(d[randomFont] + "*"); + var captchaString = ""; + print("<div style=background-color:black;height:100px;float:left;>"); + for(i = 0; i < webIni.captchaLength; i++) { + var randomLetter = Math.floor(Math.random() * (f.length)); + var g = new File(f[randomLetter]); + g.open("r"); + var h = g.read(); + g.close(); + h = html_encode(h); + print("<pre style='font-face:monospace;font-family:courier new,courier,fixedsys,monospace;background-color:black;float:left;padding-right:5px;'>" + h + "</pre>"); + captchaString = captchaString + file_getname(f[randomLetter]).replace(file_getext(f[randomLetter]), "") + } + print("</div><br style=clear:both;/><br />"); + print("<input class='border font' type=text size=" + webIni.captchaLength + " name=letters1> Enter the letters shown above (<a class=link href=./lib/captchaLib.ssjs?font=" + randomFont + " target=_blank>Help</a>)<br /><br />"); + print("<input type=hidden name=letters2 value=" + md5_calc(captchaString.toUpperCase(), hex=true) + ">"); +} + +if(http_request.query.hasOwnProperty("font")) { + load('webInit.ssjs'); + load(webIni.webRoot + '/themes/' + webIni.theme + '/layout.ssjs'); + openPage("Captcha Help"); + print("<span class=headingFont>CAPTCHA Help</span><br /><br />"); + print("Having trouble reading the CAPTCHA? Compare what you see in the CAPTCHA box to the letters in the alphabet below.<br />(Note: this CAPTCHA uses letters, not numbers, and is not case sensitive.)<br /><br />"); + var d = directory(webIni.webRoot + "/lib/captchaAnsis/*"); + if(parseInt(http_request.query.font) < d.length) { + var f = directory(d[parseInt(http_request.query.font)] + "/*"); + for(g in f) { + var h = new File(f[g]); + h.open("r"); + i = h.read(); + h.close(); + i = html_encode(i); + print("<pre style='font-face:monospace;font-family:courier new,courier,fixedsys,monospace;background-color:black;height:100px;padding-right:5px;float:left;'>" + i + "</pre>"); + } + } + closePage(); +} \ No newline at end of file diff --git a/web/root/ecWeb/lib/clientLib.js b/web/root/ecWeb/lib/clientLib.js new file mode 100644 index 0000000000000000000000000000000000000000..77b0e6c59c090ab044904bbed089e587aa679bcc --- /dev/null +++ b/web/root/ecWeb/lib/clientLib.js @@ -0,0 +1,183 @@ +/* clientLib.js, from ecWeb v2 for Synchronet BBS 3.15+ + by Derek Mullin (echicken -at- bbs.electronicchicken.com) */ + +// Some client-side javascript functions, mostly used with forumLib.ssjs. + +function toggleVisibility(elementID) { + if(document.getElementById(elementID).style.display == 'none') { + document.getElementById(elementID).style.display = 'block'; + } else { + document.getElementById(elementID).style.display = 'none'; + } + return; +} + +function addClass(elementID, cn) { + document.getElementById(elementID).className += ' ' + cn; + return; +} + +function noReturn(evt) { + var theEvent = evt || window.event; + var key = theEvent.keyCode || theEvent.which; + if(key == '13') { + theEvent.returnValue = false; + theEvent.preventDefault(); + return; + } +} + +function httpPost(url, postData, divID) { + var XMLReq = new XMLHttpRequest(); + XMLReq.open('POST', url, true); + XMLReq.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); + XMLReq.setRequestHeader('Content-length', postData.length); + XMLReq.setRequestHeader('Connection', 'close'); + XMLReq.send(postData); + document.getElementById(divID).innerHTML = "Submitting your reply . . ."; + XMLReq.onreadystatechange = function() { if(XMLReq.readyState == 4 && divID != 'none') document.getElementById(divID).innerHTML = XMLReq.responseText; } +} + +/* This is really only good for message reply forms at the moment, but at this + point that's good enough for me. */ +function submitForm(formID, url, divID) { + var theForm = document.getElementById(formID); + var postData = "action=postMessage&subBoardCode=" + theForm.elements['subBoard'].value; + postData += "&irtMessage=" + theForm.elements['irtMessage'].value; + postData += "&subject=" + theForm.elements['subject'].value; + postData += "&to=" + theForm.elements['to'].value; + postData += "&from=" + theForm.elements['from'].value; + postData += "&body=" + theForm.elements['body'].value; + httpPost(url, postData, divID); + return; +} + +function updatePointer(subBoardCode, url, mg, sb) { + postData = "action=updatePointer&subBoardCode=" + subBoardCode + "&mg=" + mg + "&sb=" + sb; + httpPost(url, postData, 'none'); +} + +// This does a very basic validation of the newuser form. Could easily become more complex. +function validateNewUserForm() { + var theForm = document.getElementById('newUser'); + var sexCheck = 0; + var returnValue = true; + for(e in theForm.elements) { + if(theForm.elements[e].id == 'alias') { + if(theForm.elements[e].value.length < 1) { + theForm.elements[e].style.backgroundColor = '#FF9999'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; + returnValue = false; + } else { + theForm.elements[e].style.backgroundColor = '#CCFFCC'; + } + } + if(theForm.elements[e].id == 'password1') { + if(theForm.elements[e].value.length < 4) { + theForm.elements[e].style.backgroundColor = '#FF9999'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; + } else { + theForm.elements[e].style.backgroundColor = '#CCFFCC'; + } + } + if(theForm.elements[e].id == 'password2') { + if(theForm.elements[e].value != theForm.password1.value) { + theForm.elements[e].style.backgroundColor = '#FF9999'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Password mismatch'; + } else { + theForm.elements[e].style.backgroundColor = '#CCFFCC'; + } + } + if(theForm.elements[e].id == 'realName') { + if(theForm.elements[e].value.length < 1) { + theForm.elements[e].style.backgroundColor = '#FF9999'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; + returnValue = false; + } else { + theForm.elements[e].style.backgroundColor = '#CCFFCC'; + } + } + if(theForm.elements[e].id == 'location') { + if(theForm.elements[e].value.length < 1) { + theForm.elements[e].style.backgroundColor = '#FF9999'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; + returnValue = false; + } else { + theForm.elements[e].style.backgroundColor = '#CCFFCC'; + } + + } + if(theForm.elements[e].id == 'handle') { + if(theForm.elements[e].value.length < 1) { + theForm.elements[e].style.backgroundColor = '#FF9999'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; + returnValue = false; + } else { + theForm.elements[e].style.backgroundColor = '#CCFFCC'; + } + + } + if(theForm.elements[e].id == 'streetAddress') { + if(theForm.elements[e].value.length < 6) { + theForm.elements[e].style.backgroundColor = '#FF9999'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; + returnValue = false; + } else { + theForm.elements[e].style.backgroundColor = '#CCFFCC'; + } + } + if(theForm.elements[e].id == 'phone') { + if(theForm.elements[e].value.length < 1) { + theForm.elements[e].style.backgroundColor = '#FF9999'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; + returnValue = false; + } else { + theForm.elements[e].style.backgroundColor = '#CCFFCC'; + } + } + if(theForm.elements[e].id == 'computer') { + if(theForm.elements[e].value.length < 1) { + theForm.elements[e].style.backgroundColor = '#FF9999'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; + returnValue = false; + } else { + theForm.elements[e].style.backgroundColor = '#CCFFCC'; + } + } + if(theForm.elements[e].id == 'sex') { + if(!theForm.elements[e].checked) sexCheck++; + } + if(theForm.elements[e].id == 'birthDate') { + if(theForm.elements[e].value.match(/\d\d-\d\d-\d\d/) == null) { + theForm.elements[e].style.backgroundColor = '#FF9999'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Invalid date (DD-MM-YY)'; + returnValue = false; + } else { + theForm.elements[e].style.backgroundColor = '#CCFFCC'; + } + } + if(theForm.elements[e].id == 'company') { + if(theForm.elements[e].value.length < 1) { + theForm.elements[e].style.backgroundColor = '#FF9999'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; + returnValue = false; + } else { + theForm.elements[e].style.backgroundColor = '#CCFFCC'; + } + } + if(theForm.elements[e].id == 'netmail') { + if(theForm.elements[e].value.length < 5) { + theForm.elements[e].style.backgroundColor = '#FF9999'; + document.getElementById(theForm.elements[e].id + 'Error').innerHTML = 'Too short'; + returnValue = false; + } else { + theForm.elements[e].style.backgroundColor = '#CCFFCC'; + } + } + } + if(sexCheck == 2) { + document.getElementById('sexError').innerHTML = ' <- Sex please.'; + returnValue = false; + } + return returnValue; +} diff --git a/web/root/ecWeb/lib/forumAsync.ssjs b/web/root/ecWeb/lib/forumAsync.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..b5920809405e0ed62acf4b829fea143226ec72c4 --- /dev/null +++ b/web/root/ecWeb/lib/forumAsync.ssjs @@ -0,0 +1,30 @@ +/* forumAsync.ssjs, from ecWeb v2 for Synchronet BBS 3.15+ + by Derek Mullin (echicken -at- bbs.electronicchicken.com) */ + +/* Handlers for asynchronous posting of messages and updating of message scan + pointers. */ + +load('webInit.ssjs'); + +// With a bit of tweaking, this could be used outside of the forum for posting of messages via HTTP +if(http_request.query.hasOwnProperty('action') && http_request.query.action.toString() == 'postMessage') { + var msgBase = new MsgBase(http_request.query.subBoardCode); + if(!msgBase.open()) exit(); + if(http_request.query.subBoardCode.toString() != 'mail' && !user.compare_ars(msgBase.cfg.post_ars)) exit(); + var body = html_decode(http_request.query.body).replace(/\n/g, "\r\n"); + var header = { subject : http_request.query.subject, to : http_request.query.to, from: http_request.query.from, from_ext : user.number, from_ip_addr : client.ip_address, replyto : http_request.query.from, replyto_ext : user.number } + if(http_request.query.irtMessage != 'none') header.thread_back = http_request.query.irtMessage; + if(http_request.query.subBoardCode.toString() == 'mail') header.to_net_addr = http_request.query.to; + header.to_net_type = netaddr_type(header.to); + header.from_net_type = netaddr_type(header.to); + msgBase.save_msg(header, body_text=word_wrap(body)); + print("<div class='headingFont standardBorder standardPadding'>Your message has been posted</div>"); + msgBase.close(); +} + +if(http_request.query.hasOwnProperty('action') && http_request.query.action.toString() == 'updatePointer' && user.alias != webIni.guestUser) { + var msgBase = new MsgBase(http_request.query.subBoardCode); + if(!msgBase.open() || http_request.query.subBoardCode == 'mail') exit(); + msg_area.grp_list[http_request.query.mg].sub_list[http_request.query.sb].scan_ptr = msgBase.last_msg; + msgBase.close(); +} diff --git a/web/root/ecWeb/lib/forumLib.ssjs b/web/root/ecWeb/lib/forumLib.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..f97a5eb6185318ca0be5029b4f28009cfa6a62df --- /dev/null +++ b/web/root/ecWeb/lib/forumLib.ssjs @@ -0,0 +1,293 @@ +/* forumLib.ssjs, from ecWeb v2 for Synchronet BBS 3.15+ + by Derek Mullin (echicken -at- bbs.electronicchicken.com) */ + +/* A small library of functions that generate lists of boards, sub-boards and + messages. Much of the output style can be controlled via your theme's + stylesheet. */ + +var sig = ""; +var sigFile = user.number.toString(); +while(sigFile.length < 4) sigFile = "0" + sigFile; +sigFile += ".sig"; +if(file_exists(system.data_dir + "user/" + sigFile)) { + var f = new File(system.data_dir + "user/" + sigFile); + f.open("r"); + var sig = f.read().replace(/\n|\r\n/g, ' '); + f.close(); +} + +function stripre(stripme) { + stripme = stripme.toUpperCase().replace(/^\s*SPAM:/g, ''); + stripme = stripme.toUpperCase().replace(/^\s*RE:|^\s*RE/g, ''); + stripme = stripme.replace(/^\s*|\s*$/g, ''); + return stripme; +} + +function sortnumber(a,b) { + return b - a; +} + +// Generate a list of boards & their sub-boards, using client-side JS to toggle visibility of certain elements +function printBoards() { + for(mg in msg_area.grp_list) { + print("<div class='standardBorder standardPadding underMargin subBoardHeaderColor' onclick=toggleVisibility('grp" + msg_area.grp_list[mg].number + "')>"); + print("<div class='headingFont'>" + msg_area.grp_list[mg].name + "</div>"); + print("<div id=stats" + msg_area.grp_list[mg].number + "></div>"); + print("</div>"); + print("<div id=grp" + msg_area.grp_list[mg].number + " style=display:none;>"); + var a = 0; + var b = 0; + for(sb in msg_area.grp_list[mg].sub_list) { + a++; + var msgBase = new MsgBase(msg_area.grp_list[mg].sub_list[sb].code); + msgBase.open(); + b = b + msgBase.total_msgs; + // The onclick below is just to provide more consistent click-to-expand behavior of the boxes in the forum + print("<div class='standardBorder standardPadding underMargin treeIndent messageBoxColor' onclick=window.location='./pages.ssjs?page=" + webIni.forumPage + "&action=viewSubBoard&subBoard=" + msg_area.grp_list[mg].sub_list[sb].code + "'>"); + print("<a class=ulLink href=./pages.ssjs?page=" + webIni.forumPage + "&action=viewSubBoard&subBoard=" + msg_area.grp_list[mg].sub_list[sb].code + ">" + msg_area.grp_list[mg].sub_list[sb].name + "</a><br />"); + print(msgBase.total_msgs + " messages"); + if(msgBase.last_msg > 0) { + var header = msgBase.get_msg_header(msgBase.last_msg); + print("<br />Latest: " + header.subject + ", by: " + header.from + " on " + system.timestr(header.when_written_time)); + } + print("</div>"); + msgBase.close(); + } + print("</div>"); + print("<script language=javascript type=text/javascript>document.getElementById('stats" + msg_area.grp_list[mg].number + "').innerHTML = '" + msg_area.grp_list[mg].description + "<br />" + b + " messages in " + a + " sub-boards';</script>"); + } +} + +// Generate an index of all threads in a sub, with client side visibility toggles +/* This function is a total piece of crap IMHO, but it works (slowly.) + Believe it or not, it's an improvement on the previous version. My + goal at the moment is just to produce something functional and with + acceptable performance. This function will need to be refined in many + ways later on (printing formatted strings instead of assembling some + step-by-step; remove conditions such as the 'thread_next' block if they + prove to be unnecessary, etc.) This thing would probably be death on + a slower computer. */ +function printSubBoard(subBoardCode, threadNumber, newOnly, scanPointer, mg, sb) { + + var msgBase = new MsgBase(subBoardCode); + if(!msgBase.open() || msgBase.last_msg < 1) { + if(!newOnly) print("<br />There are no messages to show in this sub-board."); + return; + } + if(subBoardCode != 'mail' && !user.compare_ars(msgBase.cfg.ars)) return; // 'mail' does not have a .cfg. + var header, body, msg, mm = msgBase.first_msg, reply = '', messageThreads = new Object(), threadedMessages = new Object(); + print('<div id=' + subBoardCode + '-headerBox class="subBoardHeaderColor standardBorder standardMargin standardPadding headingFont">'); + + if(subBoardCode == 'mail') { + print('Private Mail'); + } else { + print(msgBase.cfg.grp_name + ': ' + msgBase.cfg.name); + } + + print('</div>'); + + if(newOnly) { + print('<script language=javascript type=text/javascript>'); + print('document.getElementById("' + subBoardCode + '-headerBox").onclick = function() { toggleVisibility("subBoardContainer-' + subBoardCode + '"); updatePointer("' + subBoardCode + '", "' + eval(webIni.webUrl) + 'lib/forumAsync.ssjs", "' + mg + '", "' + sb + '"); };'); + print('</script>'); + print('<div id=subBoardContainer-' + subBoardCode + ' style=display:none;>'); + } + + if(subBoardCode == 'mail' || user.compare_ars(msgBase.cfg.post_ars)) { + print('<div class="messageBoxColor standardBorder standardMargin standardPadding treeIndent">'); + + if(webIni.maxMessages > 0 && !http_request.query.hasOwnProperty('showAll')) { + print('Recent messages (<a class=ulLink href=' + eval(webIni.webUrl) + 'pages.ssjs?page=' + webIni.forumPage +'&action=viewSubBoard&subBoard=' + subBoardCode + '&showAll=true>Show all</a>)'); + } else { + print('All messages'); + webIni.maxMessages = 0; + } + + print(' - <a class=ulLink onclick=toggleVisibility(\'newMessage-' + subBoardCode + '\')>Post a new message</a><br />'); + print('<div style=display:none; id=newMessage-' + subBoardCode + '>'); + print('<br /><form id=newMessageForm-' + subBoardCode + ' action=none method=post>'); + print('To:<br /><input type=text name=to size=50 value="All" onkeypress=noReturn(event) /><br /><br />'); + print('From:<br /><select name=from><option value="' + user.alias + '">' + user.alias + '</option><option value="' + user.name + '">' + user.name + '</option></select><br /><br />'); + print('Subject:<br /><input type=text size=50 name=subject onkeypress=noReturn(event) /><br /><br />'); + print('<textarea class="standardBorder" name=body cols=80 rows=20>' + sig + '</textarea><br />'); + print('<input type=button value=Submit onclick=submitForm("newMessageForm-' + subBoardCode + '","' + eval(webIni.webUrl) + 'lib/forumAsync.ssjs","newMessageForm-' + subBoardCode + '") />'); + print('<input type=hidden name=subBoard value=' + subBoardCode + ' />'); + print('<input type=hidden name=irtMessage value=none />'); + print('</form></div></div>'); + } + + if(webIni.maxMessages > 0 && (msgBase.last_msg - webIni.maxMessages) > 0) mm = msgBase.last_msg - webIni.maxMessages; + + for(m = mm; m <= msgBase.last_msg; m++) { + header = msgBase.get_msg_header(m); + body = msgBase.get_msg_body(m); + if(!header || !body || threadedMessages.hasOwnProperty(header.number)) continue; + if(newOnly && header.number <= scanPointer) continue; // This message precedes our scan pointer - don't waste any more time on it. + if(subBoardCode == 'mail' && header.to != user.alias && header.to_ext != user.number && header.from != user.alias && header.from_ext != user.number) continue; // lol :| + + /* This whole msg/reply thing needs to be replaced by something + less crappy, but for now I'll just try to make the setup + legible. */ + + /* Set 'msg' to contain a formatted version of the current + message 'm' which will later be appended to the appropriate + thread (or used to create a new one.) */ + msg = '<a name=' + header.number + '></a>'; + msg += '<div id=' + subBoardCode + header.number + ' class="messageBoxColor standardBorder standardPadding underMargin subTreeIndent messageFont">'; + msg += 'From <b>' + header.from + '</b> to <b>' + header.to + '</b> on <b>' + system.timestr(header.when_written_time) + '</b>'; + msg += '<br /><br />' + html_encode(body, true, false, false, false).replace(/\r\n|\r|\n/g, "<br />").replace(/'/g, "’") + '<br />'; + + if(subBoardCode == 'mail' || user.compare_ars(msgBase.cfg.post_ars)) { + msg += '<a class=ulLink onclick=toggleVisibility("' + subBoardCode + '-reply-' + header.number + '")>Reply</a> - '; + /* Set 'reply' to contain a (non-submittable) reply form, which + will be appended to 'msg' (above) further along. The submit + button of this form is just a regular button that triggers + the submitForm() function from lib/clientLib.js which sends + the form data to the server via an XMLHttpRequest(). This + way we don't have to migrate away from the page (bad.) */ + reply = '<div style=display:none;margin-top:10px; id=' + subBoardCode + '-reply-' + header.number + '>'; + reply += '<form id=' + subBoardCode + '-replyForm-' + header.number + ' action=none method=post>'; + reply += 'To:<br /><input type=text name=to size=50 value="' + header.from + '" onkeypress=noReturn(event) /><br /><br />'; + reply += 'From:<br /><select name=from><option value="' + user.alias + '">' + user.alias + '</option><option value="' + user.name + '">' + user.name + '</option></select><br /><br />'; + reply += '<textarea class="standardBorder" name=body cols=80 rows=20>' + quote_msg(body, line_length=79, prefix="> ").replace(/\n|\r\n/g, " ").replace(/'/g, '’') + ' ' + sig + '</textarea><br />'; + reply += '<input type=button value=Submit onclick=submitForm("' + subBoardCode + '-replyForm-' + header.number + '","' + eval(webIni.webUrl) + 'lib/forumAsync.ssjs","' + subBoardCode + '-reply-' + header.number + '") />'; + reply += '<input type=hidden name=subject value="' + header.subject + '" />'; + reply += '<input type=hidden name=subBoard value=' + subBoardCode + ' />'; + reply += '<input type=hidden name=irtMessage value=' + header.number + ' />'; + reply += '</form><br /></div>'; + } + + if(header.thread_back > 0 && threadedMessages.hasOwnProperty(header.thread_back) && messageThreads.hasOwnProperty(threadedMessages[header.thread_back])) { + // This message is in reply to another one which has already been threaded + threadedMessages[header.number] = messageThreads[threadedMessages[header.thread_back]]['number']; + messageThreads[threadedMessages[header.thread_back]]['newest'] = header.when_written_time; + messageThreads[threadedMessages[header.thread_back]]['replies']++; + messageThreads[threadedMessages[header.thread_back]]['latestAuthor'] = header.from; + messageThreads[threadedMessages[header.thread_back]]['latestNumber'] = header.number; + msg += '<a class=ulLink href=./pages.ssjs?page=' + webIni.forumPage + '&action=viewSubBoard&subBoard=' + subBoardCode + '&thread=' + messageThreads[threadedMessages[header.thread_back]]["threadID"] + '>Thread URL</a>'; + msg += ' - <a class=ulLink href=./pages.ssjs?page=' + webIni.forumPage + '&action=viewSubBoard&subBoard=' + subBoardCode + '&thread=' + messageThreads[threadedMessages[header.thread_back]]["threadID"] + '#' + header.number + '>Message URL</a>'; + msg += ' - <a class=ulLink onclick=toggleVisibility("threadContainer' + messageThreads[threadedMessages[header.thread_back]]["number"]+ '")>Collapse Thread</a><br />' + reply + '</div>'; + print("<script language=javascript type=text/javascript>"); + print("threadContainer" + messageThreads[threadedMessages[header.thread_back]]['number'] + ".innerHTML += '" + msg + "';"); + print("</script>"); + } else if(header.thread_next > 0 && threadedMessages.hasOwnProperty(header.thread_next) && messageThreads.hasOwnProperty(threadedMessages[header.thread_next])) { + // A reply to this message has already been threaded (This condition may be unnecessary - test without later on) + threadedMessages[header.number] = messageThreads[threadedMessages[header.thread_next]]['number']; + messageThreads[threadedMessages[header.thread_next]]['newest'] = header.when_written_time; + messageThreads[threadedMessages[header.thread_next]]['replies']++; + messageThreads[threadedMessages[header.thread_next]]['latestAuthor'] = header.from; + messageThreads[threadedMessages[header.thread_next]]['latestNumber'] = header.number; + msg += '<a class=ulLink href=./pages.ssjs?page=' + webIni.forumPage + '&action=viewSubBoard&subBoard=' + subBoardCode + '&thread=' + messageThreads[threadedMessages[header.thread_next]]["threadID"] + '>Thread URL</a>'; + msg += ' - <a class=ulLink href=./pages.ssjs?page=' + webIni.forumPage + '&action=viewSubBoard&subBoard=' + subBoardCode + '&thread=' + messageThreads[threadedMessages[header.thread_next]]["threadID"] + '#' + header.number + '>Message URL</a>'; + msg += ' - <a class=ulLink onclick=toggleVisibility("threadContainer' + messageThreads[threadedMessages[header.thread_next]]["number"]+ '")>Collapse Thread</a>' + reply + '</div>'; + print("<script language=javascript type=text/javascript>"); + print("threadContainer" + messageThreads[threadedMessages[header.thread_next]]['number'] + ".innerHTML += '" + msg + "';"); + print("</script>"); + } else { + // SMB threading data has been exhausted, so let's make sure there are no subject line matches in the existing threads before creating a new one + + for(var t in messageThreads) { + + if((stripre(messageThreads[t]["subject"]) == stripre(header.subject)) || (stripre(messageThreads[t]["subject"]).substr(0, stripre(header.subject).length) == stripre(header.subject))) { + threadedMessages[header.number] = messageThreads[t]['number']; + messageThreads[t]['newest'] = header.when_written_time; + messageThreads[t]['replies']++; + messageThreads[t]['latestAuthor'] = header.from; + messageThreads[t]['latestNumber'] = header.number; + msg += '<a class=ulLink href=./pages.ssjs?page=' + webIni.forumPage + '&action=viewSubBoard&subBoard=' + subBoardCode + '&thread=' + messageThreads[t]["threadID"] + '>Thread URL</a>'; + msg += ' - <a class=ulLink href=./pages.ssjs?page=' + webIni.forumPage + '&action=viewSubBoard&subBoard=' + subBoardCode + '&thread=' + messageThreads[t]["threadID"] + '#' + header.number + '>Message URL</a>'; + msg += ' - <a class=ulLink onclick=toggleVisibility("threadContainer' + messageThreads[t]["number"]+ '")>Collapse Thread</a>' + reply + '</div>'; + print("<script language=javascript type=text/javascript>"); + print("threadContainer" + messageThreads[t]['number'] + ".innerHTML += '" + msg + "';"); + print("</script>"); + break; // Need not waste time on any more message threads if a match was found. + } + + } + + } + + if(!threadedMessages.hasOwnProperty(header.number)) { + // This message is not associated with any existing threads based on the above criteria - time to create a new one + messageThreads[threadNumber] = { 'number' : threadNumber, 'newest' : header.when_written_time, 'subject' : header.subject, 'replies' : 0, 'latestAuthor' : '', 'latestNumber' : header.number, 'threadID' : header.number }; + threadedMessages[header.number] = threadNumber; + print("<script language=javascript type=text/javascript>"); + print("var threadHeader" + threadNumber + " = document.createElement('div');"); + print("threadHeader" + threadNumber + ".id = 'threadHeader" + threadNumber + "';"); + print("threadHeader" + threadNumber + ".onclick = function() { toggleVisibility('threadContainer" + threadNumber + "'); };"); + print("threadHeader" + threadNumber + ".innerHTML += '<a name=" + header.number + "></a><span class=headingFont>" + html_encode(header.subject, false, false, false, false).replace(/'/g, "'") + "</span><br />Started by " + header.from + " on " + system.timestr(parseInt(header.when_written_time)) + "';"); + print("var threadContainer" + threadNumber + " = document.createElement('div');"); + print("threadContainer" + threadNumber + ".id = 'threadContainer" + threadNumber + "';"); + + if(http_request.query.hasOwnProperty('thread') && parseInt(http_request.query.thread) == header.number) { + print("threadContainer" + threadNumber + ".style.display = 'block';"); + } else { + print("threadContainer" + threadNumber + ".style.display = 'none';"); + } + + msg += '<a class=ulLink href=./pages.ssjs?page=' + webIni.forumPage + '&action=viewSubBoard&subBoard=' + subBoardCode + '&thread=' + header.number + '>Thread URL</a>'; + msg += ' - <a class=ulLink href=./pages.ssjs?page=' + webIni.forumPage + '&action=viewSubBoard&subBoard=' + subBoardCode + '&thread=' + header.number + '#' + header.number + '>Message URL</a>'; + msg += ' - <a class=ulLink onclick=toggleVisibility("threadContainer' + threadNumber + '")>Collapse Thread</a>' + reply + '</div>'; + print("threadContainer" + threadNumber + ".innerHTML += '" + msg + "';"); + print("</script>"); + threadNumber++; + } + + } + + print("<div id=threadBox-" + subBoardCode + "></div>"); + var newestDates = new Array(); + for(var t in messageThreads) newestDates.push(messageThreads[t]['newest']); + newestDates = newestDates.sort(sortnumber); + + for(var d in newestDates) { + + for(var t in messageThreads) { + if(messageThreads[t]['newest'] != newestDates[d]) continue; + if(newOnly && messageThreads[t]['latestNumber'] <= scanPointer) continue; + print("<script language=javascript type=text/javascript>"); + print("threadHeader" + t + ".className += 'messageBoxColor standardBorder standardPadding underMargin treeIndent';"); + + if(messageThreads[t]['replies'] != 1) { + print("threadHeader" + t + ".innerHTML += '<br />" + messageThreads[t]['replies'] + " replies';"); + } else { + print("threadHeader" + t + ".innerHTML += '<br />" + messageThreads[t]['replies'] + " reply';"); + } + + if(messageThreads[t]['replies'] > 0) print("threadHeader" + t + ".innerHTML += ', latest by " + messageThreads[t]['latestAuthor'] + " on " + system.timestr(messageThreads[t]['newest']) + "';"); + print("document.getElementById('threadBox-" + subBoardCode + "').appendChild(threadHeader" + t + ");"); + print("document.getElementById('threadBox-" + subBoardCode + "').appendChild(threadContainer" + t + ");"); + print("</script>"); + break; + } + + } + + if(newOnly) print("</div>"); // Close subBoardDiv-subBoardCode + msgBase.close(); + return(threadNumber); +} + +// Scan for new messages +/* This function is fairly rudimentary for now. It would probably benefit from + some kind of paging or being limited to looking at the x most recent msgs. + Any performance improvements to the above printSubBoards() function will + benefit this function, which leans on printSubBoards() quite heavily. This + function is *VERY* slow, and the more subs a user has set to scan and the + more unread messages they have, the slower it gets. With a few thousand + unread messages, it takes a couple of minutes to produce output. */ +function newMessageScan() { + var threadNumber = 0; + for(mg in msg_area.grp_list) { + for(sb in msg_area.grp_list[mg].sub_list) { + if(msg_area.grp_list[mg].sub_list[sb].scan_cfg&SCAN_CFG_NEW) { + var nsMsgBase = new MsgBase(msg_area.grp_list[mg].sub_list[sb].code); + nsMsgBase.open(); + if(nsMsgBase.last_msg <= msg_area.grp_list[mg].sub_list[sb].scan_ptr) continue; + nsMsgBase.close(); + threadShown = printSubBoard(msg_area.grp_list[mg].sub_list[sb].code, threadNumber, true, msg_area.grp_list[mg].sub_list[sb].scan_ptr, mg, sb); + } + } + } + if(threadNumber < 1) print("<br />No new messages."); +} \ No newline at end of file diff --git a/web/root/ecWeb/lightirc/changelog.txt b/web/root/ecWeb/lightirc/changelog.txt new file mode 100644 index 0000000000000000000000000000000000000000..ce436774a16e2d65e65429e8043bf4397b371d39 --- /dev/null +++ b/web/root/ecWeb/lightirc/changelog.txt @@ -0,0 +1,140 @@ +lightIRC.com - latest changes + +Developed by Valentin Manthei (contact@valentin-manthei.de) +www.lightIRC.com + + +Version 1.0 +- utf8CompatibilityMode +- showNewQueriesInBackground + +Version 0.9.9 (01 April 2010) +- Added Greek (gr), Brasilian Portuguese (br), Italian (it), Catalan (cat) and Bulgarian (bg) translations and corrected Turkish translation +- lightIRC is not accessing an authentication file at www.lightirc.com anymore. lightIRC 0.9.9 is completely independent and can even work in a local network without internet access. +- You can omit the # when typing /join channel or /j channel +- Reduced row height in the user list +- Removed proxy functionality as it is not running good enough for production environments +- Parameter nickCentral is now called showRegisterNicknameButton (for the sake of consistency) +- Parameter nickselectSuggestion is deprecated. If you have nickselect=yes, the parameter nick gets filled in +- List popup window resizes automatically if there is little space +- Webcam windows are resizable +- Code cleanup and some refactoring +- Fix: Sometimes the chat text did not properly scroll down +- Fix: Removed white as default background color (skins with background colors didn't work correctly in 0.9.8) +- Fix: User list got filled incorrectly when performing an automatic reconnect after a connection abort +- Fix: Topics in list output were not parsed properly + +Version 0.9.8 (07 February 2010) +- Support for TLS1.0 (SSL) connections (beta). Try it with ssl=yes and (e.g.) port=6697 +- lightIRC is compiled in UTF8 from now on +- Added Polish translation (pl) +- Translated channel central (more space for longer texts now) and register nickname +- Param ident (default=lightIRC) defines the ident +- Param realname (default=lightIRC.com Flash IRC Client) defines the real name +- Param quitmsg (default=powered by lightIRC.com) defines the quit message +- Param showButtonTexts (default=yes) hides all texts for the buttons in the navigation bar. This is useful if you have limited space where the buttons would overlap each other. +- Param showRegisterChannelButton (default=no) added. Shows up a panel to register a channel to ChanServ. +- Param showSubmitMessageButton (default=no) added. Shows a button to submit a typed message. +- Param showPartChannelButton (default=yes) can hide the leave channel button +- Support for who messages +- Added some more numeric replies from specific IRC servers +- Added the command /clear to remove everything from the current window +- Input field to change the nickname contains current nick +- Quit messages get displayed in queries as well +- Fix: Joining large channels is a lot faster now +- Fix: Improved regular expression to match URLs +- Fix: Setting away messages didn't work properly +- Fix: Show default ban mask in the User Central +- Fix: Hitting tab to complete a nick while typing a message does not leave the focus anymore + +Version 0.9.7 (16. January 2010) +- Added translations for French (fr) and Albanian (al) +- Added options panel to manage some local settings. Can be disabled through showOptionsButton=no +- Added SharedObject support to store options locally. lightIRC will use your old nickname and preferences if you come back +- Param policyPort lets you define on which port Flash Player should look for a crossdomain.xml (default: 843) +- Panel to select a nickname pops up again if server sends "nickname in use" (if nickselect=yes) +- Whois in the User Central looks cleaner now +- Errors are written to the active window, e.g. "No such nick" messages +- Switched order of autojoin and perform. Perform will now be executed before joining the channels +- Added support for part messages +- If your own nickname gets mentioned in a channel, you receive an acoustic signal and your nick is written bold +- Default ban bask in the User Central is now *!*@host instead of nick!*@* +- You can use the variable $me in the perform parameter. This allows things like perform="/mode $me +x" to cloak your hostmask +- Param newMessageSound is now called soundAlerts +- Param nickServPass identifies the user to NickServ with the given password +- Param showListButton lets you hide the button to list all channels on a server +- Param showJoinPartMessages hides joins, parts and quits in all channels +- Param showButtonBar=no hides server, channel and query buttons at the bottom +- Param showRichTextControls=no hides buttons for text formatting (bold, underline, color) +- Param showNickChangeButton=no hides button to change the nickname +- Param showTimestamps=no hides timestamps in front of all received messages and commands +- Param chatAreaClickOnUser has different options (select, central, query). It defines the event that should happen when you click on a nickname in front of a message in the chat area +- Fix: Old lines in the chat area get dropped if there are more than 500 messages (chat became very slow without this change on verbose channels) +- Fix: Dates were not correctly displayed in topics and whois requests +- Fix: Nickchange of your partner while having a query was not updated +- Fix: Nickchange during login process was not updated internally +- Fix: Receiving < and > and formatted text in notices were broken +- Fix: Optimized color rendering and fixed that sometimes URLs were not shown +- Fix: Special hostnames like user!user@0::ffff:127.0.0.1 were not supported +- Fix: First channel gets opened when leaving a channel or closing a query (instead of showing the server window) + +Version 0.9.6 (29 December 2009) +- Added buttons and icons for a better user experience. If you do not like it, the old lightIRC GUI can be restored with showNavigationBar = "no" and showActionsButton = "yes" +- Right-click menu for the user list offers features to ignore/kick/ban/op/query users with one click +- The commands /ignore nick, /unignore nick, /ignores make you able to mute people +- Added translations for Dutch (nl), Swedish (se), Finnish (fi), Romanian (ro), Estonian (ee), Serbian Cyrillic (sr_cyr) and Serbian Latin (sr_lat) +- Clicking a nickname in the chat area selects that user in the user list +- nickServAuth = "yes" asks for a password when having nickselect = "yes" and identifies the user with that password to NickServ +- Commands can be put into the parameter "perform" and will be executed on connect. Example: "/mode nick +x,/msg nick2 hello" +- User list does not scroll to top anymore if a user joins or parts +- Refactored user list sorting algorithm again (much faster in channels with many users and lots of joins/parts) +- User list in channels is now draggable and can therefore be resized. Initial width can be set through userListWidth to any value >= 130 or 0 to hide the user list completely +- Font color resets automatically to default if +c is set in a channel +- Parameter "fontSize" lets you adjust how large fonts in text input and chat area should be displayed. It defaults to 12px +- Changed the parameter infoLineColorCode to infoLineColor that takes now RGB values: default is #fc7f00 +- New sound for message alert +- Parameter "doubleClickForQuery" (default: "no") disables the user central and opens a query upon doubleclicking a nickname +- Fix: Topic overflows the available space +- Fix: When using /msg #channel or /msg nick the message will not be displayed to the chat area + +Version 0.9.5 +- Added more IRC commands (errors and replies) +- Clicking on a channel in the user central (whois) joins it +- Typing /query nick opens a query with nick +- Replaced the action button in channels by a ComboBox +- Passing % in nicknames (parameter "nick") will be replaced by a random number +- /j #channel joins #channel +- /hop typed in a channel parts it and joins again +- /amsg text sends a message to all open channels +- Added Hungarian (parameter language = "hu") and Turkish ("tr") +- NickServ registration popup appears in the actions box when passing parameter "nickCentral" = "yes" +- Fix: User mode (e.g. +o) gets lost when changing nickname + +Version 0.9.4 +- Activation of IRC servers not needed anymore +- A sound will be played if a new query message is received and the window is not active (can be disabled through newMessageSound = "no") +- Notices and selected errors appear in the active window (server, channel or query) +- Nickname isn't displayed as real name anymore +- Changed font size to 12px in Aeon style and cleaned text input area +- Added two more styles (www.lightirc.com/styles/bluetan.swf & www.lightirc.com/styles/moxy.swf). Demo at www.lightirc.com/iframe.php +- Fix: Sending notice through IRC command does not work +- Fix: Chat message does not appear if it contains < or > +- Fix: Replacement of URLs does not work when combined with custom font color + +Version 0.9.3 +- Added multi language support (English, Spanish, German). Parameter language = "en"/"es"/"de" +- Channel and query buttons don't overflow the window area anymore, but resize if necessary +- Query buttons appear now always behind channel buttons +- Setting topic through IRC command fixed +- Added channel central to manage channel modes, bans and topics +- Added a form to enter a server password when needed (must be enabled through a parameter (serverPassword = "yes")) +- Added remove/add half operator function to user central +- lightIRC supports now custom user prefixes set by the IRC network (owner, admin, op, halfop, voice) +- Refactored user list sorting algorithm +- Autojoin fixed (is bound to the end of motd message and wasn't called when no motd exists) +- Auto reconnect with rejoin of all open channels (default on, can be switched off through autoReconnect = "no") + +Version 0.9.2 +- Support for bold/italic/coloured messages +- User central (whois information, voice, op, kick, ban function) +- StyleSheet support \ No newline at end of file diff --git a/web/root/ecWeb/lightirc/lightIRC.swf b/web/root/ecWeb/lightirc/lightIRC.swf new file mode 100644 index 0000000000000000000000000000000000000000..360b7b47a334383499432441474e63267a912b19 Binary files /dev/null and b/web/root/ecWeb/lightirc/lightIRC.swf differ diff --git a/web/root/ecWeb/lightirc/lightIRC_SSL_TLSv1.swf b/web/root/ecWeb/lightirc/lightIRC_SSL_TLSv1.swf new file mode 100644 index 0000000000000000000000000000000000000000..f8ec3f3d70195e3a3f49cf59d3b7fc6ce6a91146 Binary files /dev/null and b/web/root/ecWeb/lightirc/lightIRC_SSL_TLSv1.swf differ diff --git a/web/root/ecWeb/lightirc/lightirc.ssjs b/web/root/ecWeb/lightirc/lightirc.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..c810bc54bd51cc0e8e91c30242482be4874b3902 --- /dev/null +++ b/web/root/ecWeb/lightirc/lightirc.ssjs @@ -0,0 +1,32 @@ +/* lightirc.ssjs, from ecWeb v2 for Synchronet BBS 3.15+ + by Derek Mullin (echicken -at- bbs.electronicchicken.com) */ + +/* Configures and embeds the lightIRC flash app. Should work for most sysops + who are running the Synchronet IRCd (or have another IRCd listening at the + same address as their BBS) and have a Flash Socket Policy server running + (and configured to allow traffic to port 6667.) */ + +/* If you're running some other socket policy server on some other port, you + could comment the following if..else block out and just set var fspPort to + whichever port you like. */ +var f = new File(system.ctrl_dir + 'services.ini'); +if(f.open("r")) { + var servicesIni = f.iniGetObject('FlashPolicy'); + f.close(); + var fspPort = servicesIni.Port; +} else { + var fspPort = 843; +} + +print("<script type=text/javascript src=" + eval(webIni.webUrl) + "lightirc/swfobject.js></script>"); +print("<div id=lightIRC></div>"); +print("<script language=javascript type=text/javascript>"); +print("var params = {};"); +print("params.host = '" + system.inet_addr + "';"); +print("params.policyPort = " + fspPort + ";"); +print("params.language = 'en';"); +print("params.nickselect = 'yes';"); +print("params.nick = '" + user.alias + "';"); +print("params.autojoin = '#bbs';"); // You could set a different default channel here. +print("swfobject.embedSWF('" + eval(webIni.webUrl) + "lightirc/lightIRC.swf', 'lightIRC', '720', '420', '9.0.0', null, params, null);"); // 720 x 420 seems to match the fTelnet embed in my browsers. YMMV; edit this line if so. +print("</script>"); diff --git a/web/root/ecWeb/lightirc/params.js b/web/root/ecWeb/lightirc/params.js new file mode 100644 index 0000000000000000000000000000000000000000..2a36cccfcec177bbe1424c43d98c1bf2c613f702 --- /dev/null +++ b/web/root/ecWeb/lightirc/params.js @@ -0,0 +1 @@ +var params = {}; params.host = 'bbs.electronicchicken.com'; params.policyPort = 843; params.language = 'en'; params.nickselect = 'yes'; params.nick = 'ecbbs-%25'; params.autojoin = '#bbs'; swfobject.embedSWF('lightIRC.swf', 'lightIRC', '100%', '100%', '9.0.0', null, params, null); \ No newline at end of file diff --git a/web/root/ecWeb/lightirc/readme.txt b/web/root/ecWeb/lightirc/readme.txt new file mode 100644 index 0000000000000000000000000000000000000000..bd1d07d582e746b1e29d0d2af4023c4e92475d2f --- /dev/null +++ b/web/root/ecWeb/lightirc/readme.txt @@ -0,0 +1,17 @@ +lightIRC.com - latest changes + +Developed by Valentin Manthei (contact@valentin-manthei.de) +www.lightIRC.com + + +Setup: +- Open index.html with a text editor and change parameters if necessary +- Upload this folder to your webspace +- Navigate your browser to index.html + +Usage with SSL module: +The SSL module is in early beta stadium. Use lightIRC_SSL_TLSv1.swf to connect to TLSv1 servers. Check your server first, most are using SSL3. +You need to pass the parameters ssl=yes and port=6697 (most likely). +There are two seperate lightIRC swf files because the SSL library makes the file larger than normal. + +More information: www.lightirc.com/faq.html or irc.lightirc.com (#lightirc) \ No newline at end of file diff --git a/web/root/ecWeb/lightirc/swfobject.js b/web/root/ecWeb/lightirc/swfobject.js new file mode 100644 index 0000000000000000000000000000000000000000..b17981f12508a5c0cb9d6d9c17bd81218e35e80b --- /dev/null +++ b/web/root/ecWeb/lightirc/swfobject.js @@ -0,0 +1,4 @@ +/* SWFObject v2.2 <http://code.google.com/p/swfobject/> + is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> +*/ +var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}(); \ No newline at end of file diff --git a/web/root/ecWeb/newUser.ssjs b/web/root/ecWeb/newUser.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..1a89e10d48e44c1eb46a9e0e255ab7297ee2e0d9 --- /dev/null +++ b/web/root/ecWeb/newUser.ssjs @@ -0,0 +1,189 @@ +/* newUser.ssjs, from ecWeb v2 for Synchronet BBS 3.15+ + by Derek Mullin (echicken -at- bbs.electronicchicken.com) */ + +/* New user registration via the web interface. Produces a form based on the + newuser question toggles, does basic validation of the form prior to + submission, validates form data after submission, creates a new user + record. */ + +load('webInit.ssjs'); +load(webIni.webRoot + '/themes/' + webIni.theme + "/layout.ssjs"); +load(webIni.webRoot + '/lib/captchaLib.ssjs'); + +openPage("New User Registration"); +print("<span class=titleFont>New User Registration</span><br /><br />"); + +if(http_request.query.hasOwnProperty('action') && http_request.query.action == 'newUser' && user.alias == webIni.guestUser) { + + /* The various 'x not provided' errors should only crop up if somebody + messed with our newuser form or posted from another form. */ + var failString = ''; + var newUserObject = new Object(); + + if(system.newuser_questions&UQ_ALIASES) { + if(!http_request.query.hasOwnProperty('alias') || http_request.query.alias.toString().length < 1) { + failString = '- Alias not provided<br />'; + } else if(system.trashcan('name', http_request.query.alias)) { + failString += '- Invalid alias supplied<br />'; + } else if(system.matchuser(http_request.query.alias.toString())) { + failString += '- Alias already in use<br />'; + } else { + newUserObject.alias = http_request.query.alias.toString(); + } + } + + if(!http_request.query.hasOwnProperty('password1') || !http_request.query.hasOwnProperty('password2') || http_request.query.password1.toString().toUpperCase() != http_request.query.password2.toString().toUpperCase() || http_request.query.password1.toString().length < 4) { + failString += '- Invalid or mismatched passwords supplied<br />'; + } else { + newUserObject.password = http_request.query.password1.toString().toUpperCase(); + } + + if(system.newuser_questions&UQ_REALNAME) { + if(!http_request.query.hasOwnProperty('realName') || http_request.query.realName.toString().length < 1) { + failString += '- Real name not provided<br />'; + } else if(system.trashcan('name', http_request.query.realName)) { + failString += '- Invalid real name supplied<br />'; + } else if(system.newuser_questions&UQ_DUPREAL && system.matchuser(http_request.query.realName.toString())) { + failString += '- Real name already in use<br />'; + } else { + newUserObject.name = http_request.query.realName.toString(); + } + } + + if(system.newuser_questions&UQ_HANDLE) { + if(!http_request.query.hasOwnProperty('handle') || http_request.query.handle.toString().length < 1) { + failString += '- Chat handle not provided<br />'; + } else if(system.trashcan('name', http_request.query.handle)) { + failString += '- Invalid chat handle supplied<br />'; + } else if(system.newuser_questions&UQ_DUPHAND && system.matchuser(http_request.query.handle.toString())) { + failString += '- Chat handle already in use<br />'; + } else { + newUserObject.handle = http_request.query.handle.toString(); + } + } + + if(system.newuser_questions&UQ_LOCATION) { + if(!http_request.query.hasOwnProperty('location') || http_request.query.location.toString().length < 1) { + failString += '- Location not provided<br />'; + } else { + newUserObject.location = http_request.query.location.toString(); + } + } + + if(system.newuser_questions&UQ_ADDRESS) { + if(!http_request.query.hasOwnProperty('streetAddress') || http_request.query.streetAddress.toString().length < 6) { + failString += '- Address not provided<br />'; + } else { + newUserObject.address = http_request.query.streetAddress.toString(); + } + } + + if(system.newuser_questions&UQ_PHONE) { + if(!http_request.query.hasOwnProperty('phone') || http_request.query.phone.length < 1) { + failString += '- Phone number not provided<br />'; + } else if(system.trashcan('phone', http_request.query.phone)) { + failString += '- Invalid phone number suplied<br />'; + } else { + newUserObject.phone = http_request.query.phone.toString(); + } + } + + if(system.newuser_questions&UQ_SEX) { + if(!http_request.query.hasOwnProperty('sex') || (http_request.query.sex.toString() != 'm' && http_request.query.sex.toString() != 'f')) { + failString += '- Sex not provided (lol)<br />'; + } else { + newUserObject.gender = http_request.query.sex.toString().toUpperCase(); + } + } + + if(system.newuser_questions&UQ_BIRTH) { + if(!http_request.query.hasOwnProperty('birthDate') || http_request.query.birthDate.toString().match(/\d\d-\d\d-\d\d/) == null) { + failString += '- Birth date not provided<br />'; + } else { + newUserObject.birthdate = http_request.query.birthDate.toString(); + } + } + + if(system.newuser_questions&UQ_COMP) { + if(!http_request.query.hasOwnProperty('computer') || http_request.query.computer.length < 1) { + failString += '- Computer type not provided<br />'; + } else { + // user.computer is AKA host_name, so I'm not sure where to stick this answer. I suspect nobody will care anyway. :| + } + } + + if(system.newuser_questions&UQ_COMPANY) { + if(!http_request.query.hasOwnProperty('company') || http_request.query.company.length < 1) { + failString += '- Company name not provided<br />'; + } else { + // I don't know where this would go, either. Probably one of the + // 'comment' properties of the user object. Probably doesn't matter. + } + } + + if(system.newuser_questions&UQ_NONETMAIL) { + } else { + if(!http_request.query.hasOwnProperty('netmail') || !http_request.query.netmail.toString().match(/\w+\@\w+/)) { + failString += '- Invalid email/netmail address provided<br />'; + } else { + newUserObject.netmail = http_request.query.netmail.toString(); + } + } + + if(!http_request.query.hasOwnProperty('letters1') || !http_request.query.hasOwnProperty('letters2')) { + failString += '- CAPTCHA missing<br />'; + } else if(md5_calc(http_request.query.letters1.toString().toUpperCase(), hex=true) != http_request.query.letters2.toString()) { + failString += '- CAPTCHA mismatch<br />'; + } + + if(system.newuser_password != "" && (!http_request.query.hasOwnProperty('nup') || http_request.query.nup.toString().toUpperCase() != system.newuser_password.toUpperCase())) { + failString += '- Incorrect or no newuser password supplied<br />'; + } + + if(failString.length > 0) { + print("Your registration failed for the following reasons:<br /><br />" + failString); + } else { + var makeNewUser = system.new_user(newUserObject.alias); + for(property in newUserObject) { + if(property == 'alias') continue; + if(property == 'password') { + makeNewUser.security.password = newUserObject.password; + continue; + } + makeNewUser[property] = newUserObject[property]; + } + print("User account created."); + } + +} else if(user.alias == webIni.guestUser) { + + print("<form name=newUser id=newUser action=./newUser.ssjs method=post onsubmit='return validateNewUserForm()'>"); + print("<input type=hidden name=action value=newUser />"); + if(system.newuser_questions&UQ_ALIASES) print("Alias:<br /><input type=text size=30 name=alias id=alias /> <span id=aliasError></span><br /><br />"); + print("Password:<br /><input type=password size=30 name=password1 id=password1 /> <span id=password1Error></span><br /><br />"); + print("Password again:<br /><input type=password size=30 name=password2 id=password2 /> <span id=password2Error></span><br /><br />"); + if(system.newuser_questions&UQ_REALNAME) print("Real Name:<br /><input type=text size=30 name=realName id=realName /> <span id=realNameError></span><br /><br />"); + if(system.newuser_questions&UQ_HANDLE) print("Chat Handle:<br /><input type=text size=30 name=handle id=handle /> <span id=handleError></span><br /><br />"); + if(system.newuser_questions&UQ_LOCATION) print("Location:<br /><input type=text size=30 name=location id=location /> <span id=locationError></span><br /><br />"); + if(system.newuser_questions&UQ_ADDRESS) print("Street Address:<br /><input type=text size=30 name=streetAddress id=streetAddress /> <span id=streetAddressError></span><br /><br />"); + if(system.newuser_questions&UQ_PHONE) print("Phone Number:<br /><input type=text size=30 name=phone id=phone /> <span id=phoneError></span><br /><br />"); + if(system.newuser_questions&UQ_SEX) print("Sex: <input type=radio name=sex id=sex value=m />M <input type=radio name=sex id=sex value=f />F <span id=sexError></span><br /><br />"); // lol + if(system.newuser_questions&UQ_BIRTH) print("Birthdate DD-MM-YY:<br /><input type=text size=8 name=birthDate id=birthDate /> <span id=birthDateError></span><br /><br />"); + if(system.newuser_questions&UQ_COMP) print("Computer:<br /><input type=text size=30 name=computer id=computer /> <span id=computerError></span><br /><br />"); + if(system.newuser_questions&UQ_COMPANY) print("Company:<br /><input type=text size=30 name=company id=company /> <span id=companyError></span><br /><br />"); + if(system.newuser_questions&UQ_NONETMAIL) { + } else { + print("Email/Netmail:<br /><input type=text size=30 name=netmail id=netmail /> <span id=netmailError></span><br /><br />"); + } + insertCaptcha(); // Draws a CAPTCHA, inserts the hidden input 'letters2' (md5 sum of the CAPTCHA string) and text input 'letters1' + if(system.newuser_password != "") print("Please supply the new user password below.<br /><input class='border font' type=password size=25 name=nup><br /><br />"); + print("<input type=submit value=Submit />"); + print("</form>"); + +} else { + + print("You're already logged in with a valid user account. At least try logging out first."); + +} + +closePage(); diff --git a/web/root/ecWeb/pages.ssjs b/web/root/ecWeb/pages.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..7645cb272bba1a0d8ea53f1acf1731d9f19c7e2a --- /dev/null +++ b/web/root/ecWeb/pages.ssjs @@ -0,0 +1,44 @@ +/* pages.ssjs, from ecWeb v2 for Synchronet BBS 3.15+ + by Derek Mullin (echicken -at- bbs.electronicchicken.com) */ + +// Handles loading and layout of static pages from the 'pages' directory. + +load('webInit.ssjs'); +load(webIni.webRoot + '/themes/' + webIni.theme + "/layout.ssjs"); + +if(!http_request.query.hasOwnProperty("page")) { + openPage("No Page Specified"); + print("No page was specified."); + closePage(); + exit(); +} + +openPage(system.name); + +var d = directory(webIni.webRoot + "/pages/*"); +for(f in d) { + if(file_getname(d[f]) != http_request.query.page.toString()) continue; + if(file_getext(d[f]).toUpperCase() == ".SSJS") { + load(d[f]); + break; + } + if(file_getext(d[f]).toUpperCase() == ".HTML") { + var g = new File(d[f]); + g.open("r"); + h = g.read(); + g.close(); + print(h); + break; + } + if(file_getext(d[f]).toUpperCase() == ".TXT") { + var g = new File(d[f]); + g.open("r"); + h = g.read(); + g.close(); +// print(h); // Uncomment this line if you'd rather not have your text files appear within <pre /> elements. + print("<pre class=textFile>" + h + "</pre>"); // Comment out this line if you don't want your text files to appear within <pre /> elements. + break; + } +} + +closePage(); \ No newline at end of file diff --git a/web/root/ecWeb/pages/000-home.ssjs b/web/root/ecWeb/pages/000-home.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..c40bfb8fc3e3ffe67d33a0808e0d1032932c330f --- /dev/null +++ b/web/root/ecWeb/pages/000-home.ssjs @@ -0,0 +1,16 @@ +// Home + +// 000-home.ssjs from ecWeb v2 for Synchronet BBS 3.15+ +// by Derek Mullin (echicken -at- bbs.electronicchicken.com) + +// This is the default 'home' page. Edit it as you see ift, but leave the file +// name the same (or, if you must change the filename, modify ../index.ssjs to +// reflect that change. + +// Embed fTelnet +print("<span class=titleFont>Telnet</span><br /><br />"); +load(webIni.webRoot + '/fTelnet/fTelnet.ssjs'); + +// Embed lightIRC +print("<br /><br /><span class=titleFont>IRC Chat</span><br /><br />"); +load(webIni.webRoot + '/lightirc/lightirc.ssjs'); diff --git a/web/root/ecWeb/pages/001-forum.ssjs b/web/root/ecWeb/pages/001-forum.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..4767c2970935c0a273f714759e14ba02b692265b --- /dev/null +++ b/web/root/ecWeb/pages/001-forum.ssjs @@ -0,0 +1,20 @@ +// Forum + +//load('webInit.ssjs'); +//load(webIni.webRoot + '/themes/' + webIni.theme + '/layout.ssjs'); +load(webIni.webRoot + '/lib/forumLib.ssjs'); + +//openPage("Message Forum"); + +if(!http_request.query.hasOwnProperty('action')) { + print('<span class=titleFont>Message Forum</span><br /><br />'); + printBoards(); +} else if(http_request.query.action.toString() == 'viewSubBoard' && http_request.query.hasOwnProperty('subBoard')) { + print('<span class=titleFont>Message Forum: Sub-Board View</span><br />'); + printSubBoard(http_request.query.subBoard.toString(), 0, false, 0); +} else if(http_request.query.action.toString() == 'newMessageScan' && user.alias != webIni.guestUser) { + print('<span class=titleFont>Message Forum: New Message Scan</span><br />'); + newMessageScan(); +} + +//closePage(); \ No newline at end of file diff --git a/web/root/ecWeb/pages/002-ssjs.ssjs b/web/root/ecWeb/pages/002-ssjs.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..3eb50a39804bd92a1a2a3136f20a37753d90a0a6 --- /dev/null +++ b/web/root/ecWeb/pages/002-ssjs.ssjs @@ -0,0 +1,3 @@ +// SSJS file + +print("You can use a server-side javascript file as a static page.<br /><br />Make the first line of the file a comment - it will be used as the title of the page.<br /><br />This file is saved at ~pages/002-ssjs.ssjs. Please delete it once you've read and understood it."); \ No newline at end of file diff --git a/web/root/ecWeb/pages/003-html.html b/web/root/ecWeb/pages/003-html.html new file mode 100644 index 0000000000000000000000000000000000000000..a793fb6fbd6a9d72abdfe950c594d3efe3f784bf --- /dev/null +++ b/web/root/ecWeb/pages/003-html.html @@ -0,0 +1,7 @@ +<!-- HTML document --> + +You can use an <b>HTML</b> file as a <i>static page</i>. +<br /><br /> +Make the first line of the file a comment - the text within the <!-- comment --> tag will be used as the title of the page. +<br /><br /> +This file is saved at ~pages/003-html.html. Please delete it once you've read and understood it. \ No newline at end of file diff --git a/web/root/ecWeb/pages/004-txt.txt b/web/root/ecWeb/pages/004-txt.txt new file mode 100644 index 0000000000000000000000000000000000000000..b3bf0eaf082c2beb448befa549529b1949838ddb --- /dev/null +++ b/web/root/ecWeb/pages/004-txt.txt @@ -0,0 +1,19 @@ +Text file + +You can use a text file as a static page. + +The first line of the file will be used as the page title. + +The contents of a text file used as a static page will be output within a set +of <pre> tags. This helps to preserve line breaks and other formatting +that relies on a monospace font. The .textFile rules in your theme's style.css +can control certain aspects of the pre's style, such as width (for wrapping.) +If you'd prefer not to output the text file's contents within a <pre> and +keep it stylistically consistent with the rest of your site, uncomment the line: + +// print(h); + +in ~pages.ssjs and comment out the line below it. + +This file is saved at ~pages/004-txt.txt. Please delete it once you've read +and understood it. \ No newline at end of file diff --git a/web/root/ecWeb/readme.txt b/web/root/ecWeb/readme.txt new file mode 100644 index 0000000000000000000000000000000000000000..463bbf074fdc94f73f41fd69cea9908e93368384 --- /dev/null +++ b/web/root/ecWeb/readme.txt @@ -0,0 +1,29 @@ +readme.txt, from ecWeb v2 for Synchronet BBS 3.15+ +by Derek Mullin (echicken -at- bbs.electronicchicken.com) +--------------------------------------------------------- + +Installating ecWeb v2: +---------------------- + +Make a backup of your Synchronet's web document root (typically /sbbs/web/root) + +Check your Synchronet installation for the following files and folders: + +/sbbs/web/root/ecWeb/ +/sbbs/ctrl/web.ini +/sbbs/exec/load/webInit.ssjs + +If any of the above are missing from your system, you can check them out from +the CVS at cvs.synchro.net. + +If you would like ecWeb to be your default web interface, you can place the +content of the ecWeb folder at the top level of your webserver's document root. +You could also change the RootDirectory value under [Web] in sbbs.ini; if so, +you'll want to copy the 'error' directory from the former docroot into the +ecWeb folder. + +Edit /sbbs/ctrl/web.ini to your liking. There are plenty of comments in the +file to help you along. + +I'm adding more comprehensive documentation to the wiki. This should be enough +to get you started. diff --git a/web/root/ecWeb/sidebar/000-pages.ssjs b/web/root/ecWeb/sidebar/000-pages.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..0b9e7c9a8694fccb0bd7e07702b4f2044c838d6d --- /dev/null +++ b/web/root/ecWeb/sidebar/000-pages.ssjs @@ -0,0 +1,18 @@ +/* pages.ssjs, from ecWeb v2 for Synchronet BBS 3.15+ + by Derek Mullin (echicken -at- bbs.electronicchicken.com) */ + +/* A sidebar widget that generates a list of links to static pages based on the + contents of the ~pages/ directory. */ + +var e = directory(webIni.webRoot + "/pages/*"); +for(var g in e) { + var h = new File(e[g]); + h.open("r"); + var i = h.readAll(); + h.close(); + if(file_getext(e[g]).toUpperCase() == ".JS" || file_getext(e[g]).toUpperCase() == ".SSJS") print("<a class='link' href=./pages.ssjs?page=" + file_getname(e[g]) + ">" + i[0].replace(/\/\//g, "") + "</a>"); + if(file_getext(e[g]).toUpperCase() == ".HTML") print("<a class='link' href=./pages.ssjs?page=" + file_getname(e[g]) + ">" + i[0].replace(/[\<\!\-+|\-+\>]/g, "") + "</a>"); + if(file_getext(e[g]).toUpperCase() == ".TXT") print("<a class='link' href=./pages.ssjs?page=" + file_getname(e[g]) + ">" + i[0] + "</a>"); + print("<br />"); +} + diff --git a/web/root/ecWeb/sidebar/001-login.ssjs b/web/root/ecWeb/sidebar/001-login.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..1b244b8dc6201332126ccfe12d2c2e7e8ed37feb --- /dev/null +++ b/web/root/ecWeb/sidebar/001-login.ssjs @@ -0,0 +1,22 @@ +/* login.ssjs, from ecWeb v2 for Synchronet BBS 3.15+ + by Derek Mullin (echicken -at- bbs.electronicchicken.com) */ + +/* A sidebar widget to generate either a login form (with a signup link) or a + list of functions for logged-in users. */ + +if(user.alias != webIni.guestUser) { + print("You are logged in as <b>" + user.alias + "</b><br />"); + print("<script language=javascript type=text/javascript>document.write('<a class=link href=./?logout=true&callback=' + location.pathname + location.search + '>Log out</a>');</script><br />"); + print("<br /><a class=link href=./pages.ssjs?page=" + webIni.forumPage + "&action=newMessageScan>Scan for new messages</a>"); + print("<br /><a class=link href=./pages.ssjs?page=" + webIni.forumPage + "&action=viewSubBoard&subBoard=mail>Check email</a>"); +} else { + print("<form action=./ method=post>"); + print("Username:<br /><input type=text name=username class=standardFont /><br /><br />"); + print("Password:<br /><input type=password name=password class=standardFont /><br /><br />"); + print("<script language=javascript type=text/javascript>document.write('<input type=hidden name=callback value=' + window.location + ' />');</script>"); + print("<input type=submit value='Log in' />"); + print("</form>"); + print("<a class=link href=./newUser.ssjs>Register</a>"); + if(http_request.query.hasOwnProperty('loginfail')) print("<i>Invalid username or password</i>"); +} + diff --git a/web/root/ecWeb/sidebar/002-whosOnline.ssjs b/web/root/ecWeb/sidebar/002-whosOnline.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..7e8ac5f8dfc2b9ffabbe4d2766f058128c33bf9a --- /dev/null +++ b/web/root/ecWeb/sidebar/002-whosOnline.ssjs @@ -0,0 +1,38 @@ +/* whosOnline.ssjs, from ecWeb v2 for Synchronet BBS 3.15+ + by Derek Mullin (echicken -at- bbs.electronicchicken.com) */ + +/* An asynchronous "Who's Online" listing that updates at a sysop-defined + interval. Written for the ecWeb sidebar, but could be used elsewhere. */ + +var update = 10000; // Milliseconds between updates + +load("nodedefs.js"); +if(http_request.query.hasOwnProperty("action") && http_request.query.action.toString() == "show") { + + print("<b>Who's online</b><br><br>"); + print("<table border=0 cellpadding=0 cellspacing=0 class='standardColor standardFont'>"); + for(n in system.node_list) { + print("<tr><td>Node " + (parseInt(n) + 1) + ": </td>"); + if(system.node_list[n].status == 3) { + print("<td>" + system.username(system.node_list[n].useron) + "</td></tr><tr><td> </td><td style=font-style:italic;>" + NodeAction[system.node_list[n].action] + "</td></tr>"); + } else { + print("<td style=font-style:italic;>" + NodeStatus[system.node_list[n].status] + "</td></tr>"); + } + } + print("</table>"); + +} else { + + print("<div id='whosonline'></div>"); + print("<script type='text/javascript'>"); + print("function xhrwo() {"); + print("\tvar XMLReq = new XMLHttpRequest();"); + print("\tXMLReq.open('GET', './sidebar/002-whosOnline.ssjs?action=show', true);"); + print("\tXMLReq.send(null);"); + print("\tXMLReq.onreadystatechange = function() { if(XMLReq.readyState == 4) { document.getElementById('whosonline').innerHTML = XMLReq.responseText; } }"); + print("}"); + print("setInterval('xhrwo()', " + update + ");"); + print("xhrwo();"); + print("</script>"); + +} diff --git a/web/root/ecWeb/sidebar/003-systemStats.ssjs b/web/root/ecWeb/sidebar/003-systemStats.ssjs new file mode 100644 index 0000000000000000000000000000000000000000..9ec9f0c64e5907c70270989f8201369c574224d5 --- /dev/null +++ b/web/root/ecWeb/sidebar/003-systemStats.ssjs @@ -0,0 +1,20 @@ +/* systemStats.ssjs, from ecWeb v2 for Synchronet BBS 3.15+ + by Derek Mullin (echicken -at- bbs.electronicchicken.com) */ + +/* A basic sidebar widget to display selected system statistics. Nothing + special, more of an example of something you can do with the sidebar. */ + +print("<table border=0 cellpadding=0 cellspacing=0 class='standardColor standardFont'>"); +print("<tr><td>Sysop:</td><td> " + system.operator + "</td></tr>"); +print("<tr><td>Location:</td><td> " + system.location + "</td></tr>"); +print("<tr><td>Users:</td><td> " + system.stats.total_users + "</td></tr>"); +print("<tr><td>Nodes:</td><td> " + system.nodes + "</td></tr>"); +print("<tr><td>Uptime:</td><td> " + system.secondstr(time() - system.uptime) + "</td></tr>"); +print("<tr><td>Calls:</td><td> " + system.stats.total_logons + "</td></tr>"); +print("<tr><td>Calls today:</td><td> " + system.stats.logons_today + "</td></tr>"); +print("<tr><td>Files:</td><td> " + system.stats.total_files + "</td></tr>"); +print("<tr><td>U/L today:</td><td> " + system.stats.files_uploaded_today + " (" + system.stats.bytes_uploaded_today + " bytes)</td></tr>"); +print("<tr><td>D/L today:</td><td> " + system.stats.bytes_downloaded_today + " (" + system.stats.bytes_downloaded_today + " bytes)</td></tr>"); +print("<tr><td>Messages:</td><td> " + system.stats.total_messages + "</td></tr>"); +print("<tr><td>Posts today:</td><td> " + system.stats.messages_posted_today + "</td></tr>"); +print("</table>"); \ No newline at end of file