Skip to content
Snippets Groups Projects
Commit b919d88d authored by echicken's avatar echicken
Browse files

Get hostname & HTTP port from sbbs.ini.

Get guest user, ecWeb root directory, appendURL hack from modopts.ini.
(web.ini settings still read for ecWeb v2, but will be removed later.)
parent 7b0bcc1c
No related branches found
No related tags found
No related merge requests found
...@@ -27,10 +27,28 @@ var webIni=(function() { ...@@ -27,10 +27,28 @@ var webIni=(function() {
login(u.alias, u.security.password); login(u.alias, u.security.password);
} }
/* web.ini will likely go away in the near future, but we'll read it in
to support ecWeb v2 systems for now. */
var f = new File(system.ctrl_dir + 'web.ini'); var f = new File(system.ctrl_dir + 'web.ini');
f.open("r",true); f.open("r");
var webIni = f.iniGetObject(); var webIni = f.iniGetObject();
f.close(); f.close();
var f = new File(system.ctrl_dir + 'sbbs.ini');
f.open("r");
var sbbsIni = f.iniGetObject("Web");
f.close();
var f = new File(system.ctrl_dir + 'modopts.ini');
f.open("r");
var modsIni = f.iniGetObject("Web");
f.close();
webIni.RootDirectory = modsIni.RootDirectory;
webIni.appendURL = modsIni.appendURL;
webIni.WebGuest = modsIni.guestUser;
webIni.HostName = sbbsIni.HostName;
webIni.HTTPPort = Number(sbbsIni.Port).toFixed();
if(http_request.query.username != undefined && http_request.query.password != undefined) { if(http_request.query.username != undefined && http_request.query.password != undefined) {
// Script was (we'll assume) called from the login form. Attempt to authenticate the user. // Script was (we'll assume) called from the login form. Attempt to authenticate the user.
...@@ -58,7 +76,7 @@ var webIni=(function() { ...@@ -58,7 +76,7 @@ var webIni=(function() {
var u = new User(cookie[0]); var u = new User(cookie[0]);
var sessionKey = false; var sessionKey = false;
var f = getSessionKeyFile(u.number); var f = getSessionKeyFile(u.number);
if(f.open("r",true)) { if(f.open("r")) {
sessionKey = f.read(); sessionKey = f.read();
f.close(); f.close();
} }
...@@ -91,5 +109,5 @@ var webIni=(function() { ...@@ -91,5 +109,5 @@ var webIni=(function() {
} }
print("<html><head><script type=text/javascript>window.location='" + loc + "'</script></head></html>"); print("<html><head><script type=text/javascript>window.location='" + loc + "'</script></head></html>");
} }
return(webIni); return webIni;
})(); })();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment