- numerous bug fixes
 - wtv-news goodies, ready for local testing
   - custom patched nntp-server node module with support for POSTing
   - should be able to post locally
   - 4 groups are made by default
   - can override in user_config.json (look at the config.json changes but dont do them there)
   - can sync down from an upstream server with sync_nntp.js
   - sync does not push new posts to upstream yet
This commit is contained in:
zefie
2022-10-11 21:44:18 -04:00
parent 1165b245ce
commit b89e0e932c
181 changed files with 4333 additions and 688 deletions

View File

@@ -49,8 +49,8 @@ function getPatchDataType(type, invert = false) {
patch_data += "wtv-system-version: %s\r\n";
patch_data += "wtv-capability-flags: %s\r\n";
patch_data += "wtv-client-bootrom-version: %s\r\n";
patch_data += "wtv-need-upgrade: %s\n";
patch_data += "wtv-used-8675309: %s\n";
patch_data += "wtv-need-upgrade: %s\r\n";
patch_data += "wtv-used-8675309: %s\r\n";
patch_data += "wtv-client-rom-type: %s\r\n";
patch_data += "wtv-system-chipversion: %s\r\n";
patch_data += "User-Agent: %s\r\n";
@@ -192,7 +192,6 @@ function getPatchData(fname, client_data_obj, start_url = "client:GoToConn", def
var customized_patch_data = patch_data[fname];
Object.keys(customized_patch_data).forEach(function (idx) {
var val = customized_patch_data[idx];
if (typeof val === 'string') {
// start url override
if (start_url != patch_defaults.start_url && start_url.length <= patch_limits.start_url) {
@@ -209,7 +208,7 @@ function getPatchData(fname, client_data_obj, start_url = "client:GoToConn", def
if (!val.byteLength) {
// not a buffer object
var block_length = val['length'];
var patch_data = getPatchDataType(val['type'], (fname.substr(12,3) != "1.1"));
var patch_data = getPatchDataType(val['type'], (fname.substr(12, 3) != "1.1"));
if (patch_data) {
var patch_data_array = patch_data.split("\r\n");
var patch_data_string = "";
@@ -365,6 +364,7 @@ if (request_headers.query.viewer &&
data: viewer_data,
patch_data: getPatchData(viewer_file, client_data_obj)
}
if (!patchDataObject.patch_data) {
errpage = wtvshared.doErrorPage("500", null, socket.minisrv_pc_mode)
headers = errpage[0];

View File

@@ -40,13 +40,16 @@ if (socket.ssid) {
data = errpage[1];
}
if (request_headers.query.relogin && session_data.getSessionData("registered")) gourl += "relogin=true";
if (request_headers.query.relogin && session_data.getSessionData("registered")) {
gourl += "relogin=true";
session_data.setUserLoggedIn(false);
}
if (request_headers.query.reconnect && session_data.getSessionData("registered")) gourl += "reconnect=true";
if (session_data.data_store.wtvsec_login) {
var prereg_contype = "text/html";
if (request_headers.query.relogin) { // relogin
if (request_headers.query.relogin || request_headers.query.guest_login) { // relogin
session_data.data_store.wtvsec_login.ticket_b64 = null; // clear old ticket
}
@@ -55,7 +58,7 @@ if (session_data.data_store.wtvsec_login) {
var file_path = null;
var bf0app_update = false;
var romtype = session_data.get("wtv-client-rom-type");
var send_tellyscript = (minisrv_config.services[service_name].send_tellyscripts && !request_headers.query.relogin);
var send_tellyscript = (minisrv_config.services[service_name].send_tellyscripts && !request_headers.query.relogin && !request_headers.query.guest_login);
var wtv_script_id = parseInt(session_data.get("wtv-script-id"));
var bootrom = session_data.get("wtv-client-bootrom-version");
if ((request_headers.query.reconnect || request_headers.query.relogin) && wtv_script_id != 0) send_tellyscript = false;
@@ -68,7 +71,6 @@ if (session_data.data_store.wtvsec_login) {
} else {
romtype = session_data.get("wtv-client-rom-type");
}
var file_path = null;
switch (romtype) {
case "US-LC2-disk-0MB-8MB":
case "US-LC2-disk-0MB-8MB-softmodem-CPU5230":
@@ -77,9 +79,8 @@ if (session_data.data_store.wtvsec_login) {
case "US-WEBSTAR-disk-0MB-16MB-softmodem-CPU5230":
prereg_contype = "text/tellyscript";
// if wtv-open-access: true then client expects OpenISP
if (session_data.get("wtv-open-access")) file_path = __dirname + "/" +
+ "/wtv-1800/tellyscripts/LC2/LC2_OpenISP_56k.tok";
else var file_path = ServiceDeps + "/wtv-1800/tellyscripts/LC2/LC2_WTV_18006138199.tok";
if (session_data.get("wtv-open-access")) file_path = ServiceDeps + "/wtv-1800/tellyscripts/LC2/LC2_OpenISP_56k.tok";
else file_path = ServiceDeps + "/wtv-1800/tellyscripts/LC2/LC2_WTV_18006138199.tok";
break;
case "US-DTV-disk-0MB-32MB-softmodem-CPU5230":
@@ -164,7 +165,7 @@ if (session_data.data_store.wtvsec_login) {
if (bf0app_update) headers += getServiceString('wtv-star', { "no_star_word": true }) + "\n";
else headers += getServiceString('wtv-star') + "\n";
if (request_headers.query.reconnect && !session_data.getSessionData("registered") && !session_data.lockdown) headers += getServiceString('wtv-register') + "\n";
if (request_headers.query.reconnect && !session_data.isRegistered() && !session_data.lockdown) headers += getServiceString('wtv-register') + "\n";
if (!session_data.lockdown) headers += getServiceString('wtv-flashrom') + "\n";
if (bf0app_update) headers += "wtv-boot-url: " + gourl + "\n";
else {

View File

@@ -21,7 +21,7 @@ if (auth === true) {
<sidebar width=20%>
<img src="wtv-tricks:/images/Favorites_bg.jpg">
</sidebar>
<body bgcolor="#0a0a0a" text="#CC1111" link="#ff55ff" vlink="#ff55ff" vspace=0>
<body bgcolor="#101010" text="#FF3455" link="#ff55ff" vlink="#ff55ff" vspace=0>
<font size="-1">
<br>
<br>
@@ -57,19 +57,19 @@ if (auth === true) {
<tr>
<td><strike><a href="wtv-admin:/addadmin">Grant Admin to SSID</a></strike>
<td width = 10>
<td><strike><a href="wtv-admin:/modadmin">Modify Admin for SSID</a></strike>
<td><a href="wtv-admin:/polyzoot">Polyzoot a User</a>
<tr>
<td colspan=3 height=6>
<tr>
<td><a href="wtv-admin:/polyzoot">Polyzoot a User</a>
<td><strike><a href="wtv-admin:/modadmin">Modify Admin for SSID</a></strike>
<td width = 10>
<td><a href="wtv-admin:/reloadconfig">Reload Config</a>
<td><a href="wtv-admin:/operatortweaks">Edit Config</a>
<tr>
<td colspan=3 height=6>
<tr>
<td><a href="wtv-admin:/regenfavs">Restore Favs for User</a>
<td width = 10>
<td><!-- TODO -->
<td><a href="wtv-admin:/reloadconfig">Reload Config</a>
<tr>
<td colspan=3 height=6>
<tr>

View File

@@ -47,7 +47,7 @@ wtv-expire-all: wtv-admin:/ban`;
<sidebar width=20%>
<img src="wtv-admin:/images/nuke.gif">
</sidebar>
<body bgcolor="#0a0a0a" text="#CC1111" link="#ff55ff" vlink="#ff55ff" vspace=0>
<body bgcolor="#101010" text="#FF3455" link="#ff55ff" vlink="#ff55ff" vspace=0>
<br>
<br>
<h1>${minisrv_config.config.service_name} Admin Tricks</h1>

View File

@@ -39,7 +39,7 @@ wtv-noback-all: wtv-admin:/deleteaccount`;
<sidebar width=20%>
<img src="wtv-admin:/images/nuke.gif">
</sidebar>
<body bgcolor="#0a0a0a" text="#CC1111" link="#ff55ff" vlink="#ff55ff" vspace=0>
<body bgcolor="#101010" text="#FF3455" link="#ff55ff" vlink="#ff55ff" vspace=0>
<br>
<br>
<h1>${minisrv_config.config.service_name} Admin Tricks</h1>

View File

@@ -48,7 +48,7 @@ wtv-noback-all: wtv-admin:/deleteuser`;
<sidebar width=20%>
<img src="wtv-admin:/images/nuke.gif">
</sidebar>
<body bgcolor="#0a0a0a" text="#CC1111" link="#ff55ff" vlink="#ff55ff" vspace=0>
<body bgcolor="#101010" text="#FF3455" link="#ff55ff" vlink="#ff55ff" vspace=0>
<br>
<br>
<h1>${minisrv_config.config.service_name} Admin Tricks</h1>

View File

@@ -28,7 +28,7 @@ wtv-noback-all: wtv-admin:/findaccount`;
<sidebar width=20%>
<img src="wtv-tricks:/images/Favorites_bg.jpg">
</sidebar>
<body bgcolor="#0a0a0a" text="#CC1111" link="#ff55ff" vlink="#ff55ff" vspace=0>
<body bgcolor="#101010" text="#FF3455" link="#ff55ff" vlink="#ff55ff" vspace=0>
<br>
<br>
<h1>${minisrv_config.config.service_name} Admin Tricks</h1>

View File

@@ -0,0 +1,273 @@
var minisrv_service_file = true;
var WTVAdmin = require(classPath + "/WTVAdmin.js");
var wtva = new WTVAdmin(minisrv_config, session_data, service_name);
var auth = wtva.isAuthorized();
function generateFormField(type, confvar, options = null) {
if (confvar.indexOf('.') > 0) {
var confvar_split = confvar.split('.');
console.log(confvar_split)
// not operater error resistant, be mindful if you modify this page
if (user_config.config[confvar_split[0]])
var confvar_value = user_config.config[confvar_split[0]][confvar_split[1]] || minisrv_config.config[confvar_split[0]][confvar_split[1]]
else
var confvar_value = minisrv_config.config[confvar_split[0]][confvar_split[1]];
confvar = confvar.replace(".", "-");
} else
var confvar_value = user_config.config[confvar] || minisrv_config.config[confvar];
if (type == "input")
return `<input bgcolor="101010" text="ee44bb" type="text" name="${confvar}" value="${confvar_value}"${(options) ? ' '+options : ''}>`
if (type == "checkbox")
return `<input type="hidden" name="${confvar}" value="false">\n<input type=checkbox name="${confvar}" ${wtvshared.parseBool(confvar_value) ? "checked=checked" : ''}${(options) ? ' ' + options : ''}>`
if (type == "select") {
var out = `<select name="${confvar}">\n`
if (options) {
Object.keys(options).forEach((k) => {
out += `<option value="${options[k].value}"${(confvar_value == options[k].value) ? ' selected' : ''}>${options[k].name}</option>\n`
});
}
return out + "</select>";
}
}
if (auth === true) {
var password = null;
if (request_headers.Authorization) {
var authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}
}
if (wtva.checkPassword(password)) {
var user_config = wtvshared.getUserConfig();
headers = "200 OK\r\nContent-Type: text/html";
data = `<html>
<body>
<display nosave nosend>
<title>${minisrv_config.config.service_name} Operator Tweaks</title>
<script type="text/javascript">
function forceNumeric(e) {
switch (e.keyCode) {
case 8:
case 9:
case 13:
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
return true;
break;
default:
return false;
}
}
function passwordFieldToggle(check) {
document.forms[0]['passwords-min_length'].disabled = !check.checked;
document.forms[0]['passwords-min_length'].readonly = !check.checked;
document.forms[0]['passwords-max_length'].disabled = !check.checked;
document.forms[0]['passwords-max_length'].readonly = !check.checked;
document.forms[0]['passwords-form_size'].disabled = !check.checked;
document.forms[0]['passwords-form_size'].readonly = !check.checked;
}
function validateNumber(field, min, max, def) {
var num = parseInt(field.value);
if (num === NaN) num = def;
if (num < min) num = min;
if (num > max) num = max;
if (field.value != num) field.value = num;
}
</script>
<sidebar width=20%>
<img src="wtv-tricks:/images/Favorites_bg.jpg">
</sidebar>
<body bgcolor="#101010" text="#EE44bb" link="#ff55ff" vlink="#ff55ff" vspace=0>
<font size="-1">
<br>
<br>
<h1><font color=#FF3455>${minisrv_config.config.service_name} Operator Tweaks</font></h1>
<font size=-1><i>These settings can be updated without restarting minisrv</i></font>
<hr>
<table>
<tr>
<TD>
<TR>
<td>
<tr>
<td WIDTH=198 VALIGN=top ALIGN=left>
<table cellspacing=0 cellpadding=5>
<tr><td absheight=60 valign=top>
<font size=-1><b>service_owner</b><br>The name of the server
operator
<tr><td absheight=60 valign=top>
<font size=-1><b>service_owner_account</b><br>The minisrv account name of the server
operator
<tr><td absheight=90 valign=top>
<font size=-1><b>service_owner_contact</b><br>The email address or username of the
server operator where users can contact them
<tr><td absheight=100 valign=top>
<font size=-1><b>service_owner_<br>contact_method</b><br>The method by which the user can
contact the server operator (eg. email, Discord, Twitter, etc...)
<tr><td absheight=60 valign=top>
<font size=-1><b>service_name</b><br>The name of the service (eg. WebTV)
<tr><td absheight=90 valign=top>
<font size=-1><b>service_logo</b><br>The logo for the service. Filename only. Must exist in the SharedROMCache service vault.
<tr><td absheight=70 valign=top>
<font size=-1><b>service_splash_logo</b><br>The splash page logo for the service. Absolute path. Can be file:// or wtv url.
<tr><td absheight=60 valign=top>
<font size=-1><b>show_detailed_splash</b><br>Show service information and client connection speed on the splash page.
<tr><td absheight=60 valign=top>
<font size=-1><b>hide_ssid_in_logs</b><br>Filter SSIDs in console logs and log files.
<tr><td absheight=90 valign=top>
<font size=-1><b>filter_<br>passwords_in_logs</b><br>Filter passwords (if the form field contains 'pass') in console logs and log files.
<tr><td absheight=45 valign=top>
<font size=-1><b>verbosity</b><br>Console log debug level.
<tr><td absheight=60 valign=top>
<font size=-1><b>show_diskmap</b><br>Useful for debugging wtv-disk downloads.
<tr><td absheight=140 valign=top>
<font size=-1><b>allow_guests</b><br>Allows users to use the service without having to register.
Guest session data is destroyed upon logout, and some features are not available to guests.
<tr><td absheight=90 valign=top>
<font size=-1><b>enable_<br>lzpf_compression</b><br>Toggles whether LZPF compression will be considered or not
<tr><td absheight=90 valign=top>
<font size=-1><b>enable_<br>gzip_compression</b><br>Toggles whether GZIP compression will be considered or not
<tr><td absheight=45 valign=top>
<font size=-1><b>Max Users Per Account</b>
<tr><td absheight=45 valign=top>
<font size=-1><b>Min Username Length</b>
<tr><td absheight=45 valign=top>
<font size=-1><b>Max Username Length</b>
<tr><td absheight=120 valign=top>
<font size=-1><b>Enable Passwords</b><br>
When disabled, accounts will not be able to use passwords, if they had a password set prior, the account will be accessible without it.
<tr><td absheight=45 valign=top>
<font size=-1><b>Min Password Length</b>
<tr><td absheight=45 valign=top>
<font size=-1><b>Max Password Length</b>
<tr><td absheight=60 valign=top>
<font size=-1><b>Password Field Size</b>
The size of the field on the login password page
</table>
<TD WIDTH=15>
<TD WIDTH=198 absheight=1620 VALIGN=top ALIGN=left colspan=2>
<form action="wtv-admin:/validate-operator-tweaks">
<input type=hidden name=autosubmit value=true autosubmit=onleave>
<table cellspacing=0 cellpadding=5>
<tr><td valign=top>
<table>
<tr>
<td absheight=60 valign=top>
${generateFormField('input', 'service_owner')}
<tr>
<td absheight=60 valign=top>
${generateFormField('input', 'service_owner_account')}
<tr>
<td absheight=90 valign=top>
${generateFormField('input', 'service_owner_contact')}
<tr>
<td absheight=90 valign=top>
${generateFormField('input', 'service_owner_contact_method')}
<tr>
<td absheight=60 valign=top>
${generateFormField('input', 'service_name')}
<tr>
<td absheight=90 valign=top>
${generateFormField('input', 'service_logo')}
<tr>
<td absheight=70 valign=top>
${generateFormField('input', 'service_splash_logo')}
<tr>
<td absheight=60 valign=top>
${generateFormField('checkbox', 'show_detailed_splash')}
<tr>
<td absheight=60 valign=top>
${generateFormField('checkbox', 'hide_ssid_in_logs')}
<tr>
<td absheight=70 valign=top>
${generateFormField('checkbox', 'filter_passwords_in_logs')}
<tr>
<td absheight=50 valign=top>
${generateFormField('select', 'verbosity', [
{ "name": "Quiet (0)", value: 0 },
{ "name": "Show Headers (1)", value: 1 },
{ "name": "Verbose, without Headers (2)", value: 2 },
{ "name": "Verbose, with headers (3)", value: 3 },
{ "name": "Debug (4)", value: 4 },
])}
<tr>
<td absheight=60 valign=top>
${generateFormField('checkbox', 'show_diskmap')}
<tr>
<td absheight=140 valign=top>
${generateFormField('checkbox', 'allow_guests')}
<tr>
<td absheight=85 valign=top>
${generateFormField('checkbox', 'enable_lzpf_compression')}
<tr>
<td absheight=80 valign=top>
${generateFormField('checkbox', 'enable_gzip_compression')}
<tr>
<td absheight=42 valign=top>
${generateFormField('input', 'user_accounts.max_users_per_account', "size=2 onkeypress='return forceNumeric(event)' onchange='validateNumber(this,1,50,6)' maxlength=2")}
<tr>
<td absheight=42 valign=top>
${generateFormField('input', 'user_accounts.min_username_length', "size=2 onkeypress='return forceNumeric(event)' onchange='validateNumber(this,3,50,5)' maxlength=2")}
<tr>
<td absheight=50 valign=top>
${generateFormField('input', 'user_accounts.max_username_length', "size=2 onkeypress='return forceNumeric(event)' onchange='validateNumber(this,3,50,18)' maxlength=2")}
<tr>
<td absheight=113 valign=top>
${generateFormField('checkbox', 'passwords.enabled', "onchange='passwordFieldToggle(this)'")}
<tr>
<td absheight=40 valign=top>
${generateFormField('input', 'passwords.min_length', "size=2 onkeypress='return forceNumeric(event)' onchange='validateNumber(this,3,32,5)' maxlength=2")}
<tr>
<td absheight=46 valign=top>
${generateFormField('input', 'passwords.max_length', "size=2 onkeypress='return forceNumeric(event)' onchange='validateNumber(this,3,256,32)' maxlength=2")}
<tr>
<td absheight=60 valign=top>
${generateFormField('input', 'passwords.form_size', "size=2 onkeypress='return forceNumeric(event)' onchange='validateNumber(this,5,99,16)' maxlength=2")}
</table>
</table>
</form>
<tr>
<td colspan=4><hr>
<TR>
<TD>
<TD COLSPAN=2 VALIGN=top ALIGN=left>
<TD VALIGN=top ALIGN=right>
<FORM action="client:goback">
<FONT COLOR="#E7CE4A" SIZE=-1><SHADOW>
<INPUT TYPE=SUBMIT BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" Value=Done NAME="Done" USESTYLE WIDTH=103>
</SHADOW></FONT></FORM>
<TD><TD>
<tr><td>
</TABLE>
</body>
</html>
`;
} else {
var errpage = wtvshared.doErrorPage(401, "Please enter the administration password, you can leave the username blank.");
headers = errpage[0];
data = errpage[1];
}
} else {
var errpage = wtvshared.doErrorPage(403, auth);
headers = errpage[0];
data = errpage[1];
}

View File

@@ -58,7 +58,7 @@ wtv-noback-all: wtv-admin:/polyzoot`;
<sidebar width=20%>
<img src="wtv-admin:/images/polyzoot.jpg">
</sidebar>
<body bgcolor="#0a0a0a" text="#CC1111" link="#ff55ff" vlink="#ff55ff" vspace=0>
<body bgcolor="#101010" text="#FF3455" link="#ff55ff" vlink="#ff55ff" vspace=0>
<br>
<br>
<h1>${minisrv_config.config.service_name} Admin Tricks</h1>

View File

@@ -39,7 +39,7 @@ wtv-noback-all: wtv-admin:/regenfavs`;
<sidebar width=20%>
<img src="wtv-tricks:/images/Favorites_bg.jpg">
</sidebar>
<body bgcolor="#0a0a0a" text="#CC1111" link="#ff55ff" vlink="#ff55ff" vspace=0>
<body bgcolor="#101010" text="#FF3455" link="#ff55ff" vlink="#ff55ff" vspace=0>
<br>
<br>
<h1>${minisrv_config.config.service_name} Admin Tricks</h1>

View File

@@ -25,7 +25,7 @@ wtv-noback-all: wtv-admin:/reloadconfig`;
<sidebar width=20%>
<img src="wtv-tricks:/images/Favorites_bg.jpg">
</sidebar>
<body bgcolor="#0a0a0a" text="#CC1111" link="#ff55ff" vlink="#ff55ff" vspace=0>
<body bgcolor="#101010" text="#FF3455" link="#ff55ff" vlink="#ff55ff" vspace=0>
<br>
<br>
<h1>${minisrv_config.config.service_name} Admin Tricks</h1>

View File

@@ -44,7 +44,7 @@ wtv-noback-all: wtv-admin:/removeuserpasswd`;
<sidebar width=20%>
<img src="wtv-admin:/images/nuke.gif">
</sidebar>
<body bgcolor="#0a0a0a" text="#CC1111" link="#ff55ff" vlink="#ff55ff" vspace=0>
<body bgcolor="#101010" text="#FF3455" link="#ff55ff" vlink="#ff55ff" vspace=0>
<br>
<br>
<h1>${minisrv_config.config.service_name} Admin Tricks</h1>

View File

@@ -56,7 +56,7 @@ wtv-expire-all: wtv-admin:/unban`;
<sidebar width=20%>
<img src="wtv-admin:/images/nuke_inverted.gif">
</sidebar>
<body bgcolor="#0a0a0a" text="#CC1111" link="#ff55ff" vlink="#ff55ff" vspace=0>
<body bgcolor="#101010" text="#FF3455" link="#ff55ff" vlink="#ff55ff" vspace=0>
<br>
<br>
<h1>${minisrv_config.config.service_name} Admin Tricks</h1>

View File

@@ -0,0 +1,48 @@
var minisrv_service_file = true;
var WTVAdmin = require(classPath + "/WTVAdmin.js");
var wtva = new WTVAdmin(minisrv_config, session_data, service_name);
var auth = wtva.isAuthorized();
if (auth === true) {
var password = null;
if (request_headers.Authorization) {
var authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}
}
if (wtva.checkPassword(password)) {
var user_config = wtvshared.getUserConfig();
Object.keys(request_headers.query).forEach((k) => {
if (k === "autosubmit") return;
var v = request_headers.query[k];
if (!isNaN(parseInt(v))) v = parseInt(v);
if (v === "on" || v === "true" || v === "false") v = wtvshared.parseBool(v);
if (k.indexOf("-") > 0) {
var s = k.split("-");
if (!user_config.config[s[0]]) user_config.config[s[0]] = {}
user_config.config[s[0]][s[1]] = v;
} else {
user_config.config[k] = v;
}
});
var res = wtvshared.writeToUserConfig(user_config);
if (res) {
console.log(" * Configuration updated from wtv-admin, reloading")
reloadConfig();
headers = "200 OK\nwtv-expire-all: wtv-admin:/operatortweaks\nContent-Type: text/html";
} else {
err = wtvshared.doErrorPage(400, "Error writing userconfig");
headers = err[0];
data = err[1];
}
}
}
if (!headers) {
err = wtvshared.doErrorPage();
headers = err[0];
data = err[1];
}

View File

@@ -9,13 +9,12 @@ if (request_headers.query.hangup) {
Location: client:gototvhome
wtv-visit: client:hangupphone`
} else {
var user_id = (request_headers.query.user_id) ? request_headers.query.user_id : session_data.user_id;
if (socket.ssid !== null && user_id !== null) session_data.switchUserID(user_id);
if (socket.ssid !== null && !session_data.get("wtvsec_login")) {
wtvsec_login = new WTVSec(minisrv_config);
wtvsec_login = session_data.createWTVSecSession();
wtvsec_login.IssueChallenge();
wtvsec_login.set_incarnation(request_headers["wtv-incarnation"]);
session_data.set("wtvsec_login", wtvsec_login);
@@ -52,7 +51,7 @@ wtv-visit: client:hangupphone`
if (request_headers.query.skip_splash) gourl += "&skip_splash=true";
}
if (user_id != null && !request_headers.query.initial_login && !request_headers.query.user_login) {
if (user_id != null && !request_headers.query.initial_login && !request_headers.query.user_login && !request_headers.query.relogin) {
if (request_headers.query.password == "") {
headers = `403 Please enter your password and try again
minisrv-no-mail-count: true
@@ -73,9 +72,10 @@ minisrv-no-mail-count: true
if (session_data.baddisk === true) {
gourl = "wtv-head-waiter:/bad-disk?"
}
else if (session_data.getNumberOfUserAccounts() > 1 && user_id === 0 && request_headers.query.initial_login) {
else if (session_data.getNumberOfUserAccounts() > 1 && user_id === 0 && (request_headers.query.initial_login || request_headers.query.relogin)) {
gourl = "wtv-head-waiter:/choose-user?"
} else {
if (!session_data.getUserPasswordEnabled() && request_headers.query.user_login) session_data.setUserLoggedIn(true);
var limitedLogin = (!session_data.lockdown && (!session_data.get('password_valid') && session_data.getUserPasswordEnabled()));
var limitedLoginRegistered = (limitedLogin && session_data.isRegistered());
}
@@ -89,7 +89,7 @@ Content-Type: text/html`;
wtv-encrypted: true`;
if (wtvsec_login) session_data.data_store.wtvsec_login.update_ticket = true;
}
if (limitedLoginRegistered) gourl = "wtv-head-waiter:/password?";
if (limitedLoginRegistered && session_data.getUserPasswordEnabled()) gourl = "wtv-head-waiter:/password?";
headers += `
wtv-visit: ${gourl}`;

View File

@@ -1,6 +1,9 @@
var minisrv_service_file = true;
if (socket.ssid !== null) session_data.switchUserID(0);
if (socket.ssid !== null) {
session_data.switchUserID(0);
session_data.setUserLoggedIn(false);
}
headers = `200 OK
minisrv-no-mail-count: true

View File

@@ -9,6 +9,8 @@ if (gourl) {
wtv-open-isp-disabled: false
`;
if (!session_data.isRegistered() && (!request_headers.query.guest_login || !minisrv_config.config.allow_guests)) {
// fake logged in for reg
session_data.setUserLoggedIn(true);
headers += `wtv-encrypted: true
${getServiceString('wtv-register')}
${getServiceString('wtv-head-waiter')}
@@ -47,12 +49,13 @@ else {
var gourl = "wtv-home:/splash?";
}
var limitedLogin = session_data.lockdown;
var limitedLoginRegistered = (limitedLogin || (session_data.isRegistered() && !session_data.isUserLoggedIn()));
var limitedLoginRegistered = (limitedLogin || (session_data.isRegistered() && !session_data.isUserLoggedIn()) && session_data.getUserPasswordEnabled());
if (!session_data.getUserPasswordEnabled()) session_data.setUserLoggedIn(true);
var offline_user_list = null;
if (session_data.isRegistered()) {
// check for SMTP Password
if (session_data.getSessionData("subscriber_smtp_password") === null) {
session_data.setUserSMTPPassword(session_data.generatePassword(16));
session_data.setUserSMTPPassword(wtvshared.generatePassword(16));
}
if (session_data.user_id == 0) {
var accounts = session_data.listPrimaryAccountUsers();

View File

@@ -4,47 +4,47 @@ session_data.setUserLoggedIn(false);
var challenge_response, challenge_header = "";
if (socket.ssid !== null) session_data.switchUserID(0);
var gourl = "wtv-head-waiter:/ValidateLogin?initial_login=true&";
var gourl = "wtv-head-waiter:/ValidateLogin?";
if (request_headers.query.relogin) gourl += "relogin=true";
else if (request_headers.query.reconnect) gourl += "reconnect=true";
else gourl += "initial_login=true"
if (request_headers.query.guest_login) {
if (request_headers.query.relogin || request_headers.query.reconnect) gourl += "&";
if (gourl.substr(-1) != "?") gourl += "&";
gourl += "guest_login=true";
if (request_headers.query.skip_splash) gourl += "&skip_splash=true";
}
var send_to_relogin = true;
if (socket.ssid) {
if (session_data) {
if (request_headers["wtv-ticket"]) {
if (session_data.data_store.wtvsec_login.ticket_b64 == null) {
if (request_headers["wtv-ticket"].length > 8) {
session_data.data_store.wtvsec_login.DecodeTicket(request_headers["wtv-ticket"]);
session_data.data_store.wtvsec_login.ticket_b64 = request_headers["wtv-ticket"];
send_to_relogin = false;
}
if (session_data) {
if (request_headers["wtv-ticket"]) {
if (session_data.data_store.wtvsec_login.ticket_b64 == null) {
if (request_headers["wtv-ticket"].length > 8) {
session_data.data_store.wtvsec_login.DecodeTicket(request_headers["wtv-ticket"]);
session_data.data_store.wtvsec_login.ticket_b64 = request_headers["wtv-ticket"];
send_to_relogin = false;
}
} else {
if (session_data.data_store.wtvsec_login) {
var client_challenge_response = request_headers["wtv-challenge-response"] || null;
if (challenge_response && client_challenge_response) {
if (challenge_response.toString(CryptoJS.enc.Base64).substring(0, 85) == client_challenge_response.substring(0, 85)) {
console.log(" * wtv-challenge-response success for " + socket.ssid);
session_data.data_store.wtvsec_login.PrepareTicket();
send_to_relogin = false;
} else {
challenge_header = "wtv-challenge: " + session_data.data_store.wtvsec_login.IssueChallenge();
send_to_relogin = false;
}
}
} else {
if (session_data.data_store.wtvsec_login) {
var client_challenge_response = request_headers["wtv-challenge-response"] || null;
if (challenge_response && client_challenge_response) {
if (challenge_response.toString(CryptoJS.enc.Base64).substring(0, 85) == client_challenge_response.substring(0, 85)) {
console.log(" * wtv-challenge-response success for " + socket.ssid);
session_data.data_store.wtvsec_login.PrepareTicket();
send_to_relogin = false;
} else {
challenge_header = "wtv-challenge: " + session_data.data_store.wtvsec_login.IssueChallenge();
send_to_relogin = false;
}
} else {
challenge_header = "wtv-challenge: " + session_data.data_store.wtvsec_login.IssueChallenge();
send_to_relogin = false;
}
}
}
session_data.setUserLoggedIn(send_to_relogin);
}
if (!send_to_relogin) {
@@ -66,7 +66,6 @@ Content-type: text/html`;
data = '';
} else {
headers = `200 OK
Connection: Keep-Alive
Expires: Wed, 09 Oct 1991 22:00:00 GMT

View File

@@ -1,4 +1,5 @@
var minisrv_service_file = true;
session_data.setUserLoggedIn(false);
var gourl = "wtv-1800:/preregister?";

View File

@@ -38,10 +38,10 @@ Content-type: text/html`
<DISPLAY noscroll fontsize="medium">
</HEAD>
<body background="wtv-home:/images/BackgroundGradient.gif" text="44cc55" link="6977a9" vlink="6977a9" hspace=0 vspace=0 >
<body background="wtv-home:/images/BackgroundGradient_dark.gif" text="44cc55" link="36d5ff" vlink="36d5ff" hspace=0 vspace=0 >
<sidebar width=138>
<table cellspacing=0 cellpadding=0 bgcolor="30364D">
<table cellspacing=0 cellpadding=0 bgcolor="202020" gradcolor=080808>
<!-- BEGIN LOGO SPAN -->
<tr>
<td width=138 absheight=112 valign=top align=center>
@@ -57,12 +57,12 @@ Content-type: text/html`
<td absheight=5>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=138 absheight=2 valign=middle align=center bgcolor="1C1E28">
<td abswidth=138 absheight=2 valign=middle align=center bgcolor="000000">
<img src="file://rom/Images/Spacer.gif" width=1 height=1>
<tr>
<td abswidth=138 absheight=1 valign=top align=left>
<tr>
<td abswidth=138 absheight=2 valign=top align=left bgcolor="4D5573">
<td abswidth=138 absheight=2 valign=top align=left bgcolor="181818">
<img src="file://rom/Images/Spacer.gif" width=1 height=1>
</table>
<!-- END LOGO SPAN -->
@@ -93,12 +93,12 @@ Content-type: text/html`
<td absheight=5>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=138 absheight=2 valign=middle align=center bgcolor="1C1E28">
<td abswidth=138 absheight=2 valign=middle align=center bgcolor="000000">
<img src="file://rom/Images/Spacer.gif" width=1 height=1>
<tr>
<td abswidth=138 absheight=1 valign=top align=left>
<tr>
<td abswidth=138 absheight=2 valign=top align=left bgcolor="4D5573">
<td abswidth=138 absheight=2 valign=top align=left bgcolor="181818">
<img src="file://rom/Images/Spacer.gif" width=1 height=1>
</table>
<!-- END SPAN -->
@@ -131,12 +131,12 @@ Content-type: text/html`
<td absheight=5>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=138 absheight=2 valign=middle align=center bgcolor="1C1E28">
<td abswidth=138 absheight=2 valign=middle align=center bgcolor="000000">
<img src="file://rom/Images/Spacer.gif" width=1 height=1>
<tr>
<td abswidth=138 absheight=1 valign=top align=left>
<tr>
<td abswidth=138 absheight=2 valign=top align=left bgcolor="4D5573">
<td abswidth=138 absheight=2 valign=top align=left bgcolor="181818">
<img src="file://rom/Images/Spacer.gif" width=1 height=1>
</table>
<!-- END SPAN -->
@@ -152,13 +152,13 @@ Content-type: text/html`
<td abswidth=7>
<td abswidth=125>
<table cellspacing=0 cellpadding=0 href="wtv-tricks:/tricks">
<table cellspacing=0 cellpadding=0 href="wtv-news:/lobby">
<tr>
<td>
<table cellspacing=0 cellpadding=0>
<tr>
<td>
<shadow><font size=3 color=e7ce4a>Tricks</font></shadow>
<shadow><font size=3 color=e7ce4a>Discuss</font></shadow>
</table>
</table>
@@ -173,12 +173,12 @@ Content-type: text/html`
<td absheight=5>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=138 absheight=2 valign=middle align=center bgcolor="1C1E28">
<td abswidth=138 absheight=2 valign=middle align=center bgcolor="000000">
<img src="file://rom/Images/Spacer.gif" width=1 height=1>
<tr>
<td abswidth=138 absheight=1 valign=top align=left>
<tr>
<td abswidth=138 absheight=2 valign=top align=left bgcolor="4D5573">
<td abswidth=138 absheight=2 valign=top align=left bgcolor="181818">
<img src="file://rom/Images/Spacer.gif" width=1 height=1>
</table>
<!-- END SPAN -->
@@ -214,12 +214,12 @@ Content-type: text/html`
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=138 absheight=2 valign=middle align=center bgcolor="1C1E28">
<td abswidth=138 absheight=2 valign=middle align=center bgcolor="000000">
<img src="file://rom/Images/Spacer.gif" width=1 height=1>
<tr>
<td abswidth=138 absheight=1 valign=top align=left>
<tr>
<td abswidth=138 absheight=2 valign=top align=left bgcolor="4D5573">
<td abswidth=138 absheight=2 valign=top align=left bgcolor="181818">
<img src="file://rom/Images/Spacer.gif" width=1 height=1>
</table>
<!-- END SPAN -->
@@ -230,7 +230,7 @@ Content-type: text/html`
<tr>
<td align=right>
<img src="wtv-home:/images/HomeBanner.gif" width=48 height=126>
<img src="wtv-home:/images/HomeBanner_dark.gif" width=48 height=126>
<tr>
<td absheight=5>
@@ -241,7 +241,7 @@ Content-type: text/html`
<table cellspacing=0 cellpadding=0 width=100% height=383>
<tr>
<td rowspan=10 background="wtv-home:/images/BackgroundGradientEdge.gif" width=6 height=100%>
<td rowspan=10 background="wtv-home:/images/BackgroundGradientEdge_dark.gif" width=6 height=100%>
<tr>
<td valign=top absheight=113>
@@ -264,7 +264,7 @@ Content-type: text/html`
<table cellspacing=0 cellpadding=0 width=100%>
<tr>
<td align=center>
<font size=3 color=#000000>Mail</font>
<font size=3 color=#36d5ff>Mail</font>
</table>
</table>
@@ -284,7 +284,7 @@ Content-type: text/html`
<table cellspacing=0 cellpadding=0 width=100%>
<tr>
<td align=center>
<font size=3 color=#000000>Favorites</font>
<font size=3 color=#36d5ff>Favorites</font>
</table>
</table>
@@ -304,7 +304,7 @@ Content-type: text/html`
<table cellspacing=0 cellpadding=0 width=100%>
<tr>
<td align=center>
<font size=3 color=#000000>Flashroms</font>
<font size=3 color=#36d5ff>Flashroms</font>
</table>
</table>
@@ -324,7 +324,7 @@ Content-type: text/html`
<table cellspacing=0 cellpadding=0 width=100%>
<tr>
<td align=center>
<font size=3 color=#000000>Search</font>
<font size=3 color=#36d5ff>Search</font>
</table>
</table>
<td width=9%>

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

View File

@@ -10,7 +10,7 @@ data = `<html>
<head>
<display hideoptions nostatus showwhencomplete skipback clearback fontsize=medium>
<title>Engaging zefie...</title>
<meta http-equiv=Refresh content="4; url=wtv-home:/home?">
<meta http-equiv=Refresh content="${(wtvshared.parseBool(session_data.getSessionData("fast_splash"))) ? "0" : "4"}; url=wtv-home:/home?">
</head>
<body bgcolor="#000000" text="#449944">
<bgsound src="file://ROM/Sounds/Splash.mid">

View File

@@ -78,7 +78,7 @@ choose this link:
</table>
<tr>
<td valign=top height=55 align=right>
<form method="POST" action="wtv-mail:/listmail">
<form method="POST" action="${(request_headers.query['came-from']) ? request_headers.query['came-from'] : "wtv-mail:/listmail"}">
<input type="hidden" name="intro_seen" value="true">
<font color=ffcf69><shadow>
<input type=submit usestyle borderimage="file://ROM/Borders/ButtonBorder2.bif"

View File

@@ -5,12 +5,24 @@ var errpage = null;
var messageid = request_headers.query.message_id || null;
if (!messageid) {
// get user signature
data = session_data.getSessionData("subscriber_signature");
data = session_data.getSessionData("subscriber_signature");
} else {
// get message signature
var message = session_data.mailstore.getMessageByID(messageid);
if (!message) errpage = wtvshared.doErrorPage(400, "Invalid Message ID");
data = message.signature
data = message.signature;
}
if (request_headers.query.sanitize) {
if (!data) data = '';
var message_colors = session_data.mailstore.getSignatureColors(data)
if (data.indexOf("<html>") >= 0) {
data = wtvshared.sanitizeSignature(data).replace("<html>", `<html><body bgcolor=${message_colors.bgcolor} text=${message_colors.text} link=${message_colors.link} vlink=${message_colors.vlink} vspace=0 hspace=0>`);
} else {
data = `<body bgcolor=${message_colors.bgcolor} text=${message_colors.text} link=${message_colors.link} vlink=${message_colors.vlink} vspace=0 hspace=0>\n${data}`;
}
if (request_headers.query.demotext) data += "<br>" + request_headers.query.demotext;
}
if (!errpage) {
headers = `200 OK

View File

@@ -274,8 +274,8 @@ ${(message.subject) ? wtvshared.htmlEntitize(message.subject) : '(No subject)'}
if (typeof message.body === "object" && message.body) {
message.body = wtvshared.decodeBufferText(message.body);
}
data += `
${wtvshared.htmlEntitize(message.body, true)}
message.body = message.body.replace(/\n/g, "<br><br>");
data += `${(message.allow_html) ? message.body : wtvshared.htmlEntitize(message.body, true)}
<br>
<br>`;
if (message.signature) {
@@ -283,7 +283,8 @@ ${wtvshared.htmlEntitize(message.body, true)}
}
data += `<p>
`;
if (message.attachments) {
console.log(message.allow_html)
if (Array.isArray(message.attachments)) {
message.attachments.forEach((v, k) => {
if (v) {
console.log("*****************", v['Content-Type']);

View File

@@ -1,11 +1,33 @@
var minisrv_service_file = true;
var message_snapshot_data = null;
var message_voicemail_data = null;
var intro_seen = session_data.mailstore.checkMailIntroSeen();
if (!intro_seen && !request_headers.query.intro_seen) {
// user is trying to bypass the intro screen
headers = "300 OK\nLocation: wtv-mail:/DiplomaMail";
headers = "300 OK\nLocation: wtv-mail:/DiplomaMail?came-from=" + encodeURIComponent(request_headers.request_url);
} else if (request_headers.query.clear == "true") {
if (request_headers.Referer)
gourl = request_headers.Referer.replace(/[\?\&]clear\=true/, '');
else
gourl = "wtv-mail:/sendmail"
if (request_headers.query.saveoff) delete request_headers.query.saveoff;
session_data.deleteSessionData("usenet_draft");
session_data.deleteSessionData("usenet_draft_attachments");
session_data.deleteSessionData("mail_draft");
session_data.deleteSessionData("mail_draft_attachments");
if (request_headers.query.message_to) delete request_headers.query.message_to;
if (request_headers.query.message_subject) delete request_headers.query.message_subject;
if (request_headers.query.message_body) delete request_headers.query.message_body;
if (request_headers.query.message_url) delete request_headers.query.message_url;
if (request_headers.query.message_title) delete request_headers.query.message_title;
if (request_headers.query.message_reply_all_cc) delete request_headers.query.message_reply_all_cc;
if (request_headers.query['wtv-saved-message-id']) delete request_headers.query['wtv-saved-message-id'];
headers = `300 OK
wtv-expire-all: wtv-mail:/listmail
wtv-expire-all: wtv-mail:/sendmail
Location: ${gourl}`;
} else {
var doClientError = function (msg) {
var clientErrorMsg = new clientShowAlert({
@@ -19,46 +41,66 @@ if (!intro_seen && !request_headers.query.intro_seen) {
return "200 OK\nwtv-visit: " + clientErrorMsg;
}
if (request_headers.query.clear == "true") {
session_data.deleteSessionData("mail_draft");
session_data.deleteSessionData("mail_draft_attachments");
headers = `300 OK
wtv-expire: wtv-mail:/listmail
wtv-expire: wtv-mail:/sendmail
Location: wtv-mail:/sendmail`;
}
var newsgroup = null;
if (wtvshared.parseBool(request_headers.query.discuss)) {
newsgroup = request_headers.query.group || request_headers.query.message_to || null;
}
var gourl = "wtv-mail:/sendmail";
var msg_subject, to_addr, to_name;
if (newsgroup !== null) {
var to_addr = newsgroup;
var pageTitle = "Post to " + newsgroup;
var article = request_headers.query.article || null;
var gourl = gourl + "?group=" + newsgroup;
} else {
var to_addr = request_headers.query.message_to || null;
var pageTitle = "Write an e-mail message"
var pageTitle = "Write an e-mail message";
if (request_headers.query.message_reply_id) {
reply_message = session_data.mailstore.getMessageByID(request_headers.query.message_reply_id);
if (reply_message) {
msg_subject = "Re: " + reply_message.subject;
to_addr = reply_message.to_addr;
to_name = reply_message.to_name;
}
}
}
var msg_subject = request_headers.query.message_subject || null;
var msg_subject = msg_subject || request_headers.query.message_subject || null;
var msg_body = request_headers.query.message_body || null;
var to_name = request_headers.query.whatever_webtv_sends_this_as || null;
var to_name = to_name || request_headers.query.whatever_webtv_sends_this_as || null;
var msg_url = request_headers.query.message_url || null;
var msg_url_title = request_headers.query.message_title || null;
var no_signature = false;
var mail_draft_data = session_data.getSessionData("mail_draft");
var mail_draft_attachments = session_data.getSessionData("mail_draft_attachments") || {};
if (mail_draft_data) {
session_data.deleteSessionData("mail_draft");
if (mail_draft_data.to_addr) to_addr = mail_draft_data.to_addr;
if (mail_draft_data.msg_subject) msg_subject = mail_draft_data.msg_subject;
if (mail_draft_data.msg_body) msg_body = mail_draft_data.msg_body;
if (mail_draft_data.no_signature) no_signature = mail_draft_data.no_signature;
if (mail_draft_data.msg_url) msg_url = mail_draft_data.msg_url;
if (mail_draft_data.msg_url_title) msg_url_title = mail_draft_data.msg_url_title;
if (mail_draft.data.newsgroup) newsgroup = mail_draft_data.newsgroup;
mail_draft_data = {};
mail_draft_attachments = {};
if (!wtvshared.parseBool(request_headers.query.discuss)) {
mail_draft_data = session_data.getSessionData("mail_draft");
mail_draft_attachments = session_data.getSessionData("mail_draft_attachments") || {};
if (mail_draft_data && !wtvshared.parseBool(request_headers.query.discuss)) {
session_data.deleteSessionData("mail_draft");
if (mail_draft_data.to_addr) to_addr = request_headers.query.message_to || mail_draft_data.to_addr;
if (mail_draft_data.msg_subject) msg_subject = request_headers.query.message_subject || mail_draft_data.msg_subject;
if (mail_draft_data.msg_body) msg_body = request_headers.query.message_body || mail_draft_data.msg_body;
if (mail_draft_data.no_signature) no_signature = mail_draft_data.no_signature;
if (mail_draft_data.msg_url) msg_url = request_headers.query.message_url || mail_draft_data.msg_url;
if (mail_draft_data.msg_url_title) msg_url_title = request_headers.query.message_title || mail_draft_data.msg_url_title;
}
} else {
mail_draft_data = session_data.getSessionData("usenet_draft");
mail_draft_attachments = session_data.getSessionData("usenet_draft_attachments") || {};
if (mail_draft_data && !wtvshared.parseBool(request_headers.query.discuss)) {
session_data.deleteSessionData("usenet_draft");
if (mail_draft_data.to_addr) to_addr = request_headers.query.message_to || mail_draft_data.to_addr;
if (mail_draft_data.msg_subject) msg_subject = request_headers.query.message_subject || mail_draft_data.msg_subject;
if (mail_draft_data.msg_body) msg_body = request_headers.query.message_body || mail_draft_data.msg_body;
if (mail_draft_data.no_signature) no_signature = mail_draft_data.no_signature;
if (mail_draft_data.article) article = article || mail_draft_data.article;
}
}
if (request_headers.query.togglesign == "true") no_signature = false;
@@ -100,80 +142,114 @@ Content-Type: audio/wav`;
if (message_snapshot_data) {
if (typeof message_snapshot_data == "object") {
attachments.push({ 'Content-Type': 'image/jpeg', data: new Buffer.from(message_snapshot_data).toString('base64') });
} else {
attachments.push({ 'Content-Type': 'image/jpeg', data: message_snapshot_data });
var attachment = {
'Content-Type': 'image/jpeg',
'filename': 'snapshot.jpg'
}
if (typeof message_snapshot_data == "object") {
attachment.data = new Buffer.from(message_snapshot_data).toString('base64');
attachment.is_base64 = true;
} else
attachment.data = message_snapshot_data;
attachments.push(attachment);
}
if (message_voicemail_data) {
if (typeof message_voicemail_data == "object") {
attachments.push({ 'Content-Type': 'audio/wav', data: new Buffer.from(message_voicemail_data).toString('base64') });
} else {
attachments.push({ 'Content-Type': 'audio/wav', data: new message_voicemail_data });
var attachment = {
'Content-Type': 'audio/wav',
'filename': 'voicemail.wav'
}
}
if (newsgroup !== null) {
var request_is_async = true;
if (msg_body === null) {
headers = doClientError("Please type a message to send to the group.");
sendToClient(socket, headers, '');
} else {
const Client = require('newsie').default
const client = new Client({
host: minisrv_config.services[request_headers.query['discuss-prefix'] || "wtv-news"].upstream_address,
port: minisrv_config.services[request_headers.query['discuss-prefix'] || "wtv-news"].upstream_port
})
client.connect()
.then(response => {
return client.post()
})
.then(response => {
if (response.code == 340) {
var articleData = {};
articleData.headers = {
'Relay-Version': "version zefie_wtvp_minisrv " + minisrv_config.version + "; site " + minisrv_config.config.domain_name,
'Posting-Version': "version zefie_wtvp_minisrv " + minisrv_config.version + "; site " + minisrv_config.config.domain_name,
'Path': "@" + minisrv_config.config.domain_name,
'From': from_addr,
'Newsgroups': newsgroup,
'Subject': msg_subject || "(No subject)",
'Message-ID': "<"+session_data.generatePassword(16) + "@" + minisrv_config.config.domain_name+">",
'Date': strftime('%A, %d-%b-%y %k:%M:%S %z', new Date())
}
if (msg_body) {
articleData.body = msg_body.split("\n");
} else {
articleData.body = [];
}
return response.send(articleData);
} else {
headers = doClientError("Could not send post. Server returned error " + response.code);
sendToClient(socket, headers, '');
return client.quit();
}
})
.then(response => {
if (response.code !== 240) {
headers = doClientError("Could not send post. Server returned error " + response.code);
sendToClient(socket, headers, '');
} else {
headers = `300 OK
wtv-expire: wtv-news:/news?group=${newsgroup}
wtv-expire: wtv-mail:/sendmail
Location: wtv-news:/news?group=${newsgroup}`;
sendToClient(socket, headers, '');
return client.quit()
}
}).catch(e => {
console.log('usenet upstream uncaught error', e);
headers = doClientError("Could not send post. Server returned unknown error");
sendToClient(socket, headers, '');
});
if (typeof message_voicemail_data == "object") {
attachment.data = new Buffer.from(message_voicemail_data).toString('base64');
attachment.is_base64 = true;
} else
attachment.data = message_voicemail_data;
attachments.push(attachment);
}
if (newsgroup !== null) {
var request_is_async = true;
var local_service_name = request_headers.query['discuss-prefix'] || "wtv-news"
const wtvnews = new WTVNews(minisrv_config, local_service_name);
var service_config = minisrv_config.services[local_service_name];
if (wtvnewsserver) {
var tls_path = this.wtvshared.getAbsolutePath(this.minisrv_config.config.ServiceDeps + '/wtv-news');
var tls_options = {
ca: this.fs.readFileSync(tls_path + '/localserver_ca.pem'),
key: this.fs.readFileSync(tls_path + '/localserver_key.pem'),
cert: this.fs.readFileSync(tls_path + '/localserver_cert.pem'),
checkServerIdentity: () => { return null; }
}
if (wtvnewsserver.username)
wtvnews.initializeUsenet("127.0.0.1", service_config.local_nntp_port, tls_options, wtvnewsserver.username, wtvnewsserver.password);
else
wtvnews.initializeUsenet("127.0.0.1", service_config.local_nntp_port, tls_options);
} else {
if (service_config.upstream_auth)
wtvnews.initializeUsenet(service_config.upstream_address, service_config.upstream_port, service_config.upstream_tls || null, service_config.upstream_auth.username || null, service_config.upstream_auth.password || null);
else
wtvnews.initializeUsenet(service_config.upstream_address, service_configupstream_port, service_config.upstream_tls || null);
}
from_addr = userdisplayname + " <" + from_addr + ">";
news_headers = null;
if (signature && signature != "" && !no_signature) {
var signature_tuple = null;
if (signature.indexOf('<html>') >= 0) {
attachments.push({
"Content-Type": 'text/html',
"data": signature,
"use_base64": false,
"filename": "wtv_signature.html"
});
} else {
if (msg_body) msg_body += "\n" + signature;
else msg_body = signature;
}
}
if (attachments.length > 0) {
// usenet attachments
var tuples = [{
"mime": 'text/plain',
"content": msg_body || '',
"use_base64": false
}];
if (signature_tuple) tuples.push(signature_tuple);
attachments.forEach((attachment) => {
var tuple = {};
tuple.mime = attachment['Content-Type'];
tuple.content = attachment.data;
tuple.use_base64 = (typeof attachment.use_base64 === 'boolean') ? attachment.use_base64 : true;
tuple.is_base64 = (typeof attachment.is_base64 === 'boolean') ? attachment.is_base64 : false;
tuple.filename = attachment.filename || null;
tuples.push(tuple);
});
var multipart_data = wtvmime.generateMultipartMIME(tuples);
news_headers = {
"Content-Type": multipart_data.content_type,
"MIME-Version": multipart_data.mime_version,
"User-Agent": minisrv_version_string + " for WebTV",
"Content-Language": "en-US"
}
msg_body = multipart_data.content.toString();
}
wtvnews.postToGroup(newsgroup, from_addr, msg_subject, msg_body, article, news_headers).then(() => {
session_data.deleteSessionData("usenet_draft");
session_data.deleteSessionData("usenet_draft_attachments");
headers = `300 OK
wtv-expire-all: wtv-news:/news?group=${newsgroup}
wtv-expire-all wtv-mail:/sendmail
Location: wtv-news:/news?group=${newsgroup}`;
sendToClient(socket, headers, '');
}).catch((e) => {
var err = this.wtvshared.doErrorPage(500, null, e.toString())
sendToClient(socket, err[0], err[1]);
});
} else {
var messagereturn = session_data.mailstore.sendMessageToAddr(from_addr, to_addr, msg_body, msg_subject, userdisplayname, to_name, signature, attachments, msg_url, msg_url_title);
if (messagereturn !== true) {
@@ -184,8 +260,8 @@ Location: wtv-news:/news?group=${newsgroup}`;
session_data.deleteSessionData("mail_draft");
session_data.deleteSessionData("mail_draft_attachments");
headers = `300 OK
wtv-expire: wtv-mail:/listmail
wtv-expire: wtv-mail:/sendmail
wtv-expire-all: wtv-mail:/listmail
wtv-expire-all: wtv-mail:/sendmail
Location: wtv-mail:/listmail`;
}
}
@@ -198,38 +274,38 @@ Location: wtv-mail:/listmail`;
no_signature: no_signature,
msg_url: msg_url,
msg_url_title: msg_url_title,
newsgroup: newsgroup
}
session_data.setSessionData("mail_draft", mail_draft_data);
if (newsgroup) mail_draft_data.article = article;
session_data.setSessionData((newsgroup) ? "usenet_draft" : "mail_draft", mail_draft_data);
headers = `200 OK
Content-type: text/html
wtv-expire: wtv-mail:/sendmail`;
wtv-expire-all: wtv-mail:/sendmail`;
}
} else {
headers = `200 OK
Content-type: text/html`;
var mail_draft_data = session_data.getSessionData("mail_draft_attachments") || {};
var mail_draft_data = session_data.getSessionData((newsgroup) ? "usenet_draft_attachments" : "mail_draft_attachments") || {};
if (request_headers.query.snapping == "false") {
headers += "\nwtv-expire: cache:snapshot.jpg";
headers += "\nwtv-expire-all: cache:snapshot.jpg";
if (mail_draft_data.message_snapshot_data) mail_draft_data.message_snapshot_data = null;
session_data.setSessionData("mail_draft_attachments", mail_draft_data);
session_data.setSessionData((newsgroup) ? "usenet_draft_attachments" : "mail_draft_attachments", mail_draft_data);
}
if (request_headers.query.gabbing == "false") {
headers += "\nwtv-expire: cache:voicemail.wav";
headers += "\nwtv-expire-all: cache:voicemail.wav";
if (mail_draft_data.message_voicemail_data) mail_draft_data.message_voicemail_data = null;
session_data.setSessionData("mail_draft_attachments", mail_draft_data);
session_data.setSessionData((newsgroup) ? "usenet_draft_attachments" : "mail_draft_attachments", mail_draft_data);
}
if (request_headers.query.message_snapshot_data) {
mail_draft_data.message_snapshot_data = request_headers.query.message_snapshot_data
session_data.setSessionData("mail_draft_attachments", mail_draft_data);
session_data.setSessionData((newsgroup) ? "usenet_draft_attachments" : "mail_draft_attachments", mail_draft_data);
}
if (request_headers.query.message_voicemail_data) {
mail_draft_data.message_voicemail_data = request_headers.query.message_voicemail_data
session_data.setSessionData("mail_draft_attachments", mail_draft_data);
session_data.setSessionData((newsgroup) ? "usenet_draft_attachments" : "mail_draft_attachments", mail_draft_data);
}
var message_colors = null;
if (no_signature) message_colors = session_data.mailstore.getSignatureColors(null, true);
@@ -267,6 +343,10 @@ function DoneGabbing() { var myURL;
myURL = "client:submitform?name=sendform&submitname=gabbing&submitvalue=cache%3Avoicemail.wav";
location = "client:submitform?name=sendform&submitname=gabbing&submitvalue=true";
location.reload(); }
function clearDraft() {
location = "client:submitform?name=sendform&submitname=clear&submitvalue=true";
location.reload();
}
</script>
<title>
${pageTitle}
@@ -276,8 +356,9 @@ ${pageTitle}
<form action="wtv-mail:/sendmail#focus" method="post" name=sendform >
<input type=hidden name="wtv-saved-message-id" value="writemessage-outbox">
<input type=hidden name="message_reply_all_cc" value="">
${(request_headers.query.article) ? `<input type="hidden" name="article" value="${request_headers.query.article}">` : ''}
<input type=hidden name="saveoff" value="true" autosubmit="onleave">
<input type=hidden name="discuss" value="${request_headers.query.discuss ? true : false}">
<input type=hidden name="discuss" value="${wtvshared.parseBool(request_headers.query.discuss)}">
<sidebar width=109>
<table cellspacing=0 cellpadding=0>
<tr>
@@ -300,12 +381,22 @@ ${pageTitle}
<tr>
<td width=10 height=26>
<td width=89 valgn=middle>
<table cellspacing=0 cellpadding=0 href="wtv-mail:/listmail" >
<tr>
<table cellspacing=0 cellpadding=0 href="`
if (newsgroup) {
data += "wtv-news:/news?group=" + newsgroup;
} else {
data += "wtv-mail:/listmail";
}
data += `"><tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E6CD4A>Mail list</font></shadow>
</table>`;
<tr>`;
if (newsgroup) {
data += `<td><shadow><font sizerange=medium color=#E6CD4A>Group list</font></shadow>`;
} else {
data += `<td><shadow><font sizerange=medium color=#E6CD4A>Mail list</font></shadow>`;
}
data += `</table>`;
if (!newsgroup) {
data += `
<td width=5>
@@ -349,7 +440,7 @@ data += `
<tr>
<td width=10 height=26>
<td width=89 valgn=middle>
<table cellspacing=0 cellpadding=0 href="client:showalert?sound=none&message=Are%20you%20sure%20you%20want%20to%20erase%20this%20entire%20message%3F&buttonlabel2=Don't%20Erase&buttonaction2=client:donothing&buttonlabel1=Erase&buttonaction1=wtv-mail:/sendmail%3Fclear%3Dtrue%26wtv-saved-message-id%3Dwritemessage-outbox" id=addressbook>
<table cellspacing=0 cellpadding=0 href="client:showalert?sound=none&message=Are%20you%20sure%20you%20want%20to%20erase%20this%20entire%20message%3F&buttonlabel2=Don't%20Erase&buttonaction2=client:donothing&buttonlabel1=Erase&buttonaction1=javascript:clearDraft()" id=addressbook>
<tr>
<td height=1>
<tr>
@@ -600,7 +691,7 @@ USESTYLE NOARGS>
data += `
</td></tr><tr>
<td colspan="2" align="center">
<img src="${(mail_draft_attachments.message_snapshot_data) ? 'wtv-mail:/sendmail?get_snap=true' : 'cache:snapshot.jpg'}" width="380" height="290">
<img src="${(mail_draft_attachments.message_snapshot_data) ? 'wtv-mail:/sendmail?get_snap=true' : (request_headers.query.message_snapshot_url) ? request_headers.query.message_snapshot_url : 'cache:snapshot.jpg'}" width="380" height="290">
</td></tr><tr>
<td colspan="2" abswidth="386" absheight="10">
</td></tr><tr>

View File

@@ -0,0 +1,69 @@
var minisrv_service_file = true;
var request_is_async = true;
var errpage = null;
var group = request_headers.query.group;
var article = request_headers.query.article;
var attachment_id = parseInt(request_headers.query.attachment_id);
if ((!attachment_id && attachment_id != 0) || !group || !article) {
errpage = wtvshared.doErrorPage(400, "Attachment ID required.");
sendToClient(socket, errpage[0], errpage[1]);
} else {
const wtvnews = new WTVNews(minisrv_config, service_name);
var service_config = minisrv_config.services[service_name];
if (service_config.local_nntp_port && wtvnewsserver) {
var tls_path = this.wtvshared.getAbsolutePath(this.minisrv_config.config.ServiceDeps + '/wtv-news');
var tls_options = {
ca: this.fs.readFileSync(tls_path + '/localserver_ca.pem'),
key: this.fs.readFileSync(tls_path + '/localserver_key.pem'),
cert: this.fs.readFileSync(tls_path + '/localserver_cert.pem'),
checkServerIdentity: () => { return null; }
}
if (wtvnewsserver.username)
wtvnews.initializeUsenet("127.0.0.1", service_config.local_nntp_port, tls_options, wtvnewsserver.username, wtvnewsserver.password);
else
wtvnews.initializeUsenet("127.0.0.1", service_config.local_nntp_port, tls_options);
} else {
if (service_config.upstream_auth)
wtvnews.initializeUsenet(service_config.upstream_address, service_config.upstream_port, service_config.upstream_tls || null, service_config.upstream_auth.username || null, service_config.upstream_auth.password || null);
else
wtvnews.initializeUsenet(service_config.upstream_address, service_config.upstream_port, service_config.upstream_tls || null);
}
var article = parseInt(article);
wtvnews.connectUsenet().then(() => {
wtvnews.selectGroup(group).then((response) => {
wtvnews.getArticle(article).then((response) => {
wtvnews.quitUsenet();
if (response.code == 220) {
var message_data = wtvnews.parseAttachments(response);
if (message_data.attachments) {
if (attachment_id < message_data.attachments.length) {
var attachment = message_data.attachments[attachment_id];
var encoding = attachment.content_encoding.toLowerCase()
if (encoding == 'base64') {
data = Buffer.from(attachment.data, encoding);
headers = "200 OK\n"
headers += "Content-Type: " + attachment.content_type + "\n";
if (attachment.filename) headers += "Content-Disposition: attachment; filename=\"" + attachment.filename + "\"\n";
sendToClient(socket, headers, data);
} else {
errpage = wtvshared.doErrorPage(400, "Unimplemented encoding type:", encoding);
sendToClient(socket, errpage[0], errpage[1]);
}
} else {
errpage = wtvshared.doErrorPage(400, "Attachment ID exceeds available attachments");
sendToClient(socket, errpage[0], errpage[1]);
}
} else {
errpage = wtvshared.doErrorPage(400, "Article does not contain attachments.");
sendToClient(socket, errpage[0], errpage[1]);
}
} else {
errpage = wtvshared.doErrorPage(400);
sendToClient(socket, errpage[0], errpage[1]);
}
});
});
});
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,5 +1,7 @@
var minisrv_service_file = true;
// max of 6, any more will be ignored
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`
@@ -35,7 +37,7 @@ data = `<HTML>
<tr>
<td abswidth=6 >
<td abswidth=93 absheight=26 >
<table href="wtv-news:news?category=1"
<table href="wtv-news:/news?category=1"
cellspacing=0 cellpadding=0>
<tr>
<td abswidth=5>
@@ -82,7 +84,8 @@ cellspacing=0 cellpadding=0>
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td colspan=3 height=237 valign=bottom align=right >
<img src="wtv-forum:/images/BannerDiscuss.gif" width=50 height=165> <tr><td colspan=3 absheight=36>
<img src="wtv-news:/images/BannerDiscuss.gif" width=50 height=165>
<tr><td colspan=3 absheight=36>
</table>
</sidebar>
<body
@@ -103,27 +106,26 @@ Featured discussions
<td abswidth=20>
<tr>
<td>
<td WIDTH=198 HEIGHT=200 VALIGN=top ALIGN=left>
<a href="wtv-news:/news?group=webtv.users"><b>WebTV</b></a><br>
A moderated discussion with WebTV customers<br>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=18><BR>
<a href="wtv-news:/news?group=alt.discuss.webtv.hacking"><b>Hacking</b></a><br>
Not grandma friendly<br>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=18><BR>
<a href="wtv-news:/news?group=rec.autos.4x4"><b>4x4s</b></a><br>
The on and off-road four wheel drive vehicle<br>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=18><BR>
<td WIDTH=20>
<td WIDTH=198 HEIGHT=220 VALIGN=top ALIGN=left>
<a href="wtv-news:/news?group=webtv.plus"><b>WebTV Plus</b></a><br>
bf0 is for bitches and BPS is boring<br>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=18><BR>
<a href="wtv-news:/news?group=alt.discuss.midis"><b>MIDIs</b></a><br>
The best music format<br>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=18><BR>
<a href="wtv-news:/news?group=alt.discuss.html"><b>HTML</b></a><br>
Every timeline starts with HTML<br>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=18><BR>
<td WIDTH=198 HEIGHT=200 VALIGN=top ALIGN=left>`;
var featuredGroups = minisrv_config.services[service_name].featuredGroups;
var limit = 6;
while (featuredGroups.length > limit) featuredGroups.pop(); // remove anything passing our limit
function printGroup(group) {
return `<a href="wtv-news:/news?group=${group.group}"><b>${group.name}</b></a><br>${group.description}<br><IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=18><BR>`;
}
// evens
Object.keys(featuredGroups).forEach((k) => { if (k % 2 == 0) { data += printGroup(featuredGroups[k]); } });
if (featuredGroups.length > 1) data += `<td WIDTH=20><td WIDTH=198 HEIGHT=220 VALIGN=top ALIGN=left>`;
// odds
Object.keys(featuredGroups).forEach((k) => { if (k % 2 != 0) data += printGroup(featuredGroups[k]); });
data += `
</table>
<TABLE width=446 cellspacing=0 cellpadding=0>
<tr>
@@ -145,7 +147,7 @@ Every timeline starts with HTML<br>
<td abswidth=416 valign=top align=left>
Type a discussion topic<br>
<img src="/ROMCache/Spacer.gif" width=1 height=4>
<form action="wtv-news:search">
<form action="wtv-news:/news" method="GET">
<input name="search" bgcolor=#202020 cursor=#cc9933 text="E7CE4A" font=proportional value="" SIZE=28 MAXLENGTH=100>
&nbsp;
<font color=E7CE4A><shadow>

View File

@@ -1,22 +1,61 @@
var minisrv_service_file = true;
console.log('f')
const wtvnews = new WTVNews(minisrv_config, service_name);
var service_config = minisrv_config.services[service_name];
if (service_config.local_nntp_port && wtvnewsserver) {
var tls_path = this.wtvshared.getAbsolutePath(this.minisrv_config.config.ServiceDeps + '/wtv-news');
var tls_options = {
ca: this.fs.readFileSync(tls_path + '/localserver_ca.pem'),
key: this.fs.readFileSync(tls_path + '/localserver_key.pem'),
cert: this.fs.readFileSync(tls_path + '/localserver_cert.pem'),
checkServerIdentity: () => { return null; }
}
if (wtvnewsserver.username)
wtvnews.initializeUsenet("127.0.0.1", service_config.local_nntp_port, tls_options, wtvnewsserver.username, wtvnewsserver.password);
else
wtvnews.initializeUsenet("127.0.0.1", service_config.local_nntp_port, tls_options);
} else {
if (service_config.upstream_auth)
wtvnews.initializeUsenet(service_config.upstream_address, service_config.upstream_port, service_config.upstream_tls || null, service_config.upstream_auth.username || null, service_config.upstream_auth.password || null);
else
wtvnews.initializeUsenet(service_config.upstream_address, service_config.upstream_port, service_config.upstream_tls || null);
}
async function throwError(e) {
console.log(e);
var errpage = wtvshared.doErrorPage(400, null, e.toString());
sendToClient(socket, errpage[0], errpage[1]);
}
function isToday (chkdate) {
const today = new Date()
return chkdate.getDate() == today.getDate() &&
chkdate.getMonth() == today.getMonth() &&
chkdate.getFullYear() == today.getFullYear()
}
async function WebTVListGroup(group) {
var page_limit_default = 100;
wtvnews.connectUsenet().then(() => {
wtvnews.selectGroup(group).then(() => {
wtvnews.listGroup(group).then((response) => {
wtvnews.selectGroup(group).then((response) => {
var limit_per_page = (request_headers.query.limit) ? parseInt(request_headers.query.limit) : page_limit_default;
var page = (request_headers.query.chunk) ? parseInt(request_headers.query.chunk) : 0;
console.log(response);
var page_start = (limit_per_page * page) + 1;
var page_end = (page + 1) * limit_per_page;
if (page_end > response.group.high) {
page_end = response.group.high;
limit_per_page = (page_end - (limit_per_page / (page + 1))) + limit_per_page;
}
wtvnews.listGroup(group, page, limit_per_page).then((response) => {
if (response.code == 211) {
NGCount = response.group.number;
NGArticles = response.group.articleNumbers;
page_start = (limit_per_page * page) + 1;
page_end = (page + 1) * limit_per_page;
wtvnews.getHeaderObj(NGArticles).then((messages) => {
messages = wtvnews.sortByResponse(messages);
wtvnews.quitUsenet();
headers = `200 OK
Connection: Keep-Alive
@@ -30,6 +69,7 @@ top.location="news:${request_headers.query.group}";
</script>
<TITLE>${request_headers.query.group}</TITLE>
</HEAD>
<body bgcolor="191919" text="42BD52" link="1bb0f1" vlink="826f7e" hspace=0 vspace=0 logo="wtv-news:/images/news_logo.gif">
<sidebar width=114 height=420 align=left>
<table cellspacing=0 cellpadding=0 bgcolor=3d2f3a>
<tr>
@@ -56,7 +96,31 @@ top.location="news:${request_headers.query.group}";
<tr>
<td abswidth=6 >
<td abswidth=93 absheight=26 >
<table href="wtv-mail:/sendmail?discuss=true&group=${request_headers.query.group}&discuss-prefix=wtv-news"
<table href="wtv-news:/lobby"
cellspacing=0 cellpadding=0>
<tr>
<td abswidth=5>
<td abswidth=90 valign=middle align=left>
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
<tr>
<td absheight=1>
<tr>
<td maxlines=1>
<shadow><font sizerange=medium color="E7CE4A">Lobby</font></shadow></table>
</table>
<td abswidth=5>
<tr>
<td colspan=3 absheight=2 valign=middle align=center bgcolor=231d22>
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td colspan=3 absheight=1 valign=top align=left <img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td abswidth=6 >
<td abswidth=93 absheight=26 >
<table href="wtv-mail:/sendmail?discuss=true&group=${request_headers.query.group}&discuss-prefix=${service_name}"
cellspacing=0 cellpadding=0>
<tr>
<td abswidth=5>
@@ -102,16 +166,10 @@ cellspacing=0 cellpadding=0>
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td colspan=3 height=237 valign=bottom align=right >
<img src="wtv-forum:/images/BannerDiscuss.gif" width=50 height=165> <tr><td colspan=3 absheight=36>
<td colspan=3 height=207 valign=bottom align=right >
<img src="wtv-news:/images/BannerDiscuss.gif" width=50 height=165> <tr><td colspan=3 absheight=36>
</table>
</sidebar>
<body
bgcolor="191919" text="42BD52" link="1bb0f1"
vlink="826f7e"
hspace=0
vspace=0
logo="wtv-forum:/images/news_logo.gif">
<table cellspacing=0 cellpadding=0>
<tr>
@@ -148,9 +206,40 @@ Group: ${request_headers.query.group}
</font>
<br>
<img src="wtv-home:/ROMCache/Spacer.gif" width=0 height=8>
`;
if (NGCount > 0) {
data += `
<td width=180 valign=bottom align=right>
<table cellspacing=0 cellpadding=0>
<td rowspan=4 height=26 width=30>
${(page > 0) ? `<a href="wtv-news:/news?group=${group}&chunk=${page - 1}${(limit_per_page != page_limit_default) ? `&limit=${limit_per_page}` : ''}"><img src="wtv-news:/images/ListPrevious.gif"></a>` : `<img src="wtv-news:/images/ListPrevious_D.gif">`}
<td rowspan=4 height=26 width=11>
<img src="wtv-news:/images/ListLeftEdge.gif">
<td height=2 valign=top align=left bgcolor="2b2b2b">
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<td rowspan=4 height=26 width=11>
<img src="wtv-news:/images/ListRightEdge.gif">
<td rowspan=4 height=26 width=30>
${(page_end < NGCount) ? `<a href="wtv-news:/news?group=${group}&chunk=${page + 1}${(limit_per_page != page_limit_default) ? `&limit=${limit_per_page}` : ''}"><img src="wtv-news:/images/ListNext.gif"></a>` : `<img src="wtv-news:/images/ListNext_D.gif">`}
<td rowspan=4 width=5>
<tr>
<td height=2 valign=top align=left>
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td height=20 valign=middle align=center>
${page_start}-${page_end}
<tr>
<td height=2 valign=top align=left bgcolor="000000">
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td colspan=5 height=3>
</table> `;
}
data += `</table>
<TABLE width=446 cellspacing=0 cellpadding=0>
<tr>
<td rowspan=4 width=10 height=1>
<td rowspan=4>
<tr>
<img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=1>
<td height=2 width=436 bgcolor="2B2B2B">
<img src="wtv-home:/ROMCache/Spacer.gif" width=436 height=1>
@@ -165,8 +254,10 @@ Group: ${request_headers.query.group}
if (NGCount > 0) {
Object.keys(messages).forEach(function (k) {
var message = messages[k]
var message_date = message.headers.DATE;
var message = messages[k].article;
var has_relation = (messages[k].relation !== null) ? true : false;
var date_obj = new Date(Date.parse(message.headers.DATE));
var date = (isToday(date_obj)) ? strftime("%I:%M %p", date_obj) : strftime("%b %d", date_obj)
data += `
<table cellspacing=0 cellpadding=0>
<tr>
@@ -174,13 +265,13 @@ Group: ${request_headers.query.group}
<td abswidth=426 height=42 valign=bottom>
<table cellspacing=0 cellpadding=0 href="wtv-news:/news?group=${request_headers.query.group}&article=${message.articleNumber}" id="${message.messageId}" nocolor selected>
<tr>
${(has_relation) ? `<td abswidth=20 rowspan=2 valign=top><font size="+2">&#149;` : ''}
<td abswidth=426 maxlines=1>
<font color=1bb0f1>${(message.headers.SUBJECT) ? message.headers.SUBJECT : "(No Subject)"}
<tr>
<td maxlines=1>
<font size="-1" color=544f53><b>
${message.headers.FROM}, ${message.headers.DATE}
</b>
${(message.headers.FROM.indexOf(' ') > 0) ? message.headers.FROM.split(' ')[0] : message.headers.FROM}, ${date}
</table>
<td abswidth=10>
</table>`;
@@ -191,8 +282,6 @@ ${message.headers.FROM}, ${message.headers.DATE}
<TABLE width=446 cellspacing=0 cellpadding=0>
<tr>
<td rowspan=4 width=10 height=1>
<img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=1>
<td height=2 width=436 bgcolor="2B2B2B">
<img src="wtv-home:/ROMCache/Spacer.gif" width=436 height=1>
<tr>
<td height=1>
@@ -211,25 +300,55 @@ ${message.headers.FROM}, ${message.headers.DATE}
</HTML>`;
sendToClient(socket, headers, data);
}).catch((e) => { throwError(e) });;
}).catch((e) => {
// getHeaderObj err
throwError(e)
});;
}
}).catch((e) => { throwError(e) });;
}).catch((e) => { throwError(e) });;
}).catch((e) => { throwError(e) });
}).catch((e) => {
// listGroup error
throwError(e)
});;
}).catch((e) => {
// selectGroup error
throwError(e)
});
}).catch((e) => {
// connect error
throwError(e)
});
}
async function WebTVShowMessage(client, group, article) {
var connected = await clientConnect(client)
if (connected) {
response = await selectGroup(client, group);
if (response) {
response = await getArticle(client, article);
console.log(response);
if (response.code == 220) {
async function WebTVShowMessage(group, article) {
var article = parseInt(article);
wtvnews.connectUsenet().then(() => {
wtvnews.selectGroup(group).then((response) => {
wtvnews.getArticle(article).then((response) => {
wtvnews.quitUsenet();
headers = `200 OK
Content-type: text/html`;
Content-type: text/html
wtv-expire-all: wtv-news:/news?group=${group}&article=`;
var signature = null;
var message_colors = session_data.mailstore.defaultColors;
var display_signature = true; // todo make a toggle
var message = wtvnews.parseAttachments(response);
var message_body = message.text;
var attachments = null;
var signature_index = null;
if (message.attachments) attachments = message.attachments;
if (attachments) {
if (Object.keys(attachments).length > 0) {
Object.keys(attachments).forEach((k) => {
if (attachments[k].filename == "wtv_signature.html" && attachments[k].content_type.match(/text\/html/)) {
signature = attachments[k].data;
signature_index = k;
return false;
}
});
attachments.splice(signature_index, 1);
}
}
if (signature) message_colors = session_data.mailstore.getSignatureColors(signature);
data = `<head>
<sendpanel
@@ -295,11 +414,11 @@ cellspacing=0 cellpadding=0>
<tr>
<td abswidth=6 >
<td abswidth=93 absheight=26 >
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0${(response.prev_article) ? ` href="wtv-news:/news?group=${request_headers.query.group}&article=${response.prev_article}"` : ''}>
<tr>
<td abswidth=5>
<td abswidth=88 valign=middle align=left >
<table cellspacing=0 cellpadding=0><tr><td><shadow><font color=5b4b58 sizerange=medium>Previous</font></shadow></table>
<table cellspacing=0 cellpadding=0><tr><td><shadow><font color="${(response.prev_article) ? "#E7CE4A" : "#5b4b58"}" sizerange=medium>Previous</font></shadow></table>
</table>
<td abswidth=5>
<tr>
@@ -314,11 +433,11 @@ cellspacing=0 cellpadding=0>
<tr>
<td abswidth=6 >
<td abswidth=93 absheight=26 >
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0${(response.next_article) ? ` href="wtv-news:/news?group=${request_headers.query.group}&article=${response.next_article}"` : ''}>
<tr>
<td abswidth=5>
<td abswidth=88 valign=middle align=left >
<table cellspacing=0 cellpadding=0><tr><td><shadow><font color=5b4b58 sizerange=medium>Next</font></shadow></table>
<table cellspacing=0 cellpadding=0><tr><td><shadow><font color="${(response.next_article) ? "#E7CE4A" : "#5b4b58"}" sizerange=medium>Next</font></shadow></table>
</table>
<td abswidth=5>
<tr>
@@ -384,7 +503,7 @@ cellspacing=0 cellpadding=0>
<tr>
<td abswidth=6>
<td abswidth=93 absheight=26>
<table href="wtv-mail:/sendmail?discuss=true&message_subject=${("Re: " + response.article.headers.SUBJECT)}&group=${response.article.headers.NEWSGROUPS}"
<table href="wtv-mail:/sendmail?discuss=true&message_subject=${encodeURIComponent("Re: " + response.article.headers.SUBJECT)}&group=${response.article.headers.NEWSGROUPS}&discuss-prefix=${service_name}&article=${request_headers.query.article}"
cellspacing=0 cellpadding=0>
<tr>
<td abswidth=5>
@@ -461,8 +580,7 @@ ${wtvshared.htmlEntitize(response.article.headers.NEWSGROUPS)}
<tr>
<td valign=top>
Date: <td>
${console.log(Date.parse(response.article.headers.DATE))}
${strftime("%a, %b %e, %Y, %I:%M%P", new Date(Date.parse(response.article.headers.DATE) / 1000))}
${strftime("%a, %b %e, %Y, %I:%M%P", new Date(Date.parse(response.article.headers.DATE)))}
<font size=-1> </font>
<tr>
<td valign=top>
@@ -487,67 +605,257 @@ ${(response.article.headers.SUBJECT) ? wtvshared.htmlEntitize(response.article.h
<td abswidth=20 rowspan=99>
<tr>
<td>
`;
var message_body = response.article.body.join("\n");
`
data += `
${wtvshared.htmlEntitize(message_body, true)}
<br>
<br>`;
data += `<p>
`;
/*
if (message.attachments) {
message.attachments.forEach((v, k) => {
if (v) {
console.log("*****************", v['Content-Type']);
switch (v['Content-Type']) {
case "image/jpeg":
data += `<img border=2 src="wtv-news:/get-attachment?message_id=${messageid}&attachment_id=${k}&group=${(message.to_group)}&wtv-title=Video%20Snapshot" width="380" height="290"><br><br>`;
break;
case "audio/wav":
data += `<table href="wtv-news:/get-attachment?message_id=${messageid}&attachment_id=${k}&group=${(message.to_group)}&wtv-title=Voice%20Mail" width=386 cellspacing=0 cellpadding=0>
<td align=left valign=middle><img src="wtv-mail:/ROMCache/FileSound.gif" align=absmiddle><font color="#189CD6">&nbsp;&nbsp;recording.wav (wav attachment)</font>
<td align=right valign=middle>
</table><br><br>
`;
break;
}
if (signature) data += wtvshared.sanitizeSignature(signature);
data += "<p>";
if (attachments) {
var supported_images = /image\/(jpe?g|png|gif|x-wtv-bitmap)/;
var supported_audio = /audio\/(mp[eg|2|3]|midi?|wav|x-wav|mod|x-mod)/;
attachments.forEach((v, k) => {
if (v.content_type) {
if (v.content_type.match(supported_images))
data += `<img border=2 src="wtv-news:/get-attachment?group=${group}&article=${article}&attachment_id=${k}&wtv-title=Video%20Snapshot"><br><br>`;
else if (v.content_type.match(supported_audio))
data += `<table href="wtv-news:/get-attachment?group=${group}&article=${article}&attachment_id=${k}&wtv-title=${(v.filename) ? encodeURIComponent(v.filename) : "Audio%20file"}" width=386 cellspacing=0 cellpadding=0>
<td align=left valign=middle><img src="wtv-news:/ROMCache/FileSound.gif" align=absmiddle><font color="#189CD6">&nbsp;&nbsp;${(v.filename) ? (v.filename) : "Audio file"} (${v.content_type.split('/')[1]} attachment)</font>
<td align=right valign=middle>
</table><br><br>`;
else
data += `<table width=386><td><td align=left valign=middle><font color="#565656"><i>A file ${(v.filename) ? `(${v.filename}) ` : ''}that WebTV cannot use, with type ${v.content_type} is attached to this message.</i></font>`
}
});
}
/*
if (message.url) {
data += `Included Page: <a href="${(message.url)}">${wtvshared.htmlEntitize(message.url_title).replace(/&apos;/gi, "'")}`;
}
*/
data += `
</table>
</body>
</html>
`;
data += "</table></body></html>";
sendToClient(socket, headers, data);
} else {
var errpage = wtvshared.doErrorPage(400, null, "No such article in group <b>"+group+"</b>");
sendToClient(socket, errpage[0], errpage[1]);
}
} else {
var errpage = wtvshared.doErrorPage(400, null, "No such group: <b>"+group+"</b>");
sendToClient(socket, errpage[0], errpage[1]);
}
}
}).catch((e) => {
// no such article
var post_unavailable_file = this.wtvshared.getAbsolutePath(this.minisrv_config.config.ServiceDeps + '/wtv-news/post-unavailable.html');
console.log(e);
if (fs.existsSync(post_unavailable_file)) {
headers = "200 OK\nContent-type: text/html";
data = fs.readFileSync(post_unavailable_file).toString('ascii').replace("${group}", group).replace("${minisrv_config.config.service_logo}", minisrv_config.config.service_logo).replace("${message_colors.bgcolor}",session_data.mailstore.defaultColors.bgcolor);
sendToClient(socket, headers, data);
} else {
throwError(e);
}
});
}).catch((e) => {
// no such group
throwError(e);
});
}).catch((e) => {
//no connection
throwError(e);
});
}
if (!minisrv_config.services[service_name].upstream_address || !minisrv_config.services[service_name].upstream_port) {
function WebTVSearchGroups(search) {
wtvnews.connectUsenet().then(() => {
wtvnews.listGroups(search).then((response) => {
wtvnews.quitUsenet();
headers = `200 OK
Content-type: text/html
wtv-expire-all: wtv-news:/news?search=`;
data = `<HTML>
<HEAD>
<DISPLAY fontsize=medium>
<TITLE>${(response.length == 0) ? "No " : ""}Discussion groups found</TITLE>
</HEAD>
<sidebar width=114 height=420 align=left>
<table cellspacing=0 cellpadding=0 bgcolor=3d2f3a>
<tr>
<td colspan=3 width=104 absheight=4>
<td rowspan=100 width=10 height=420 valign=top align=left bgcolor=191919>
<img src="wtv-mail:/ROMCache/Shadow.gif" width=6 height=420>
<tr>
<td abswidth=6>
<td abswidth=93 absheight=76>
<table href="wtv-home:/home" absheight=76 cellspacing=0 cellpadding=0>
<tr>
<td align=right>
<img src="${minisrv_config.config.service_logo}" width=87 height=67>
</table>
<td abswidth=5>
<tr>
<td colspan=3 absheight=2 valign=middle align=center bgcolor=231d22>
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td colspan=3 absheight=1 valign=top align=left <img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td abswidth=6 >
<td abswidth=93 absheight=26 >
<table href="wtv-news:/news?category=1"
cellspacing=0 cellpadding=0>
<tr>
<td abswidth=5>
<td abswidth=90 valign=middle align=left>
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
<tr>
<td absheight=1>
<tr>
<td maxlines=1>
<shadow><font sizerange=medium color="E7CE4A">All groups</font></shadow></table>
</table>
<td abswidth=5>
<tr>
<td colspan=3 absheight=2 valign=middle align=center bgcolor=231d22>
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td colspan=3 absheight=1 valign=top align=left <img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td abswidth=6 >
<td abswidth=93 absheight=26 >
<table href="wtv-guide:/help?topic=Discuss&subtopic=Index&appName=Discuss"
cellspacing=0 cellpadding=0>
<tr>
<td abswidth=5>
<td abswidth=90 valign=middle align=left>
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
<tr>
<td absheight=1>
<tr>
<td maxlines=1>
<shadow><font sizerange=medium color="E7CE4A">Help</font></shadow></table>
</table>
<td abswidth=5>
<tr>
<td colspan=3 absheight=2 valign=middle align=center bgcolor=231d22>
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td colspan=3 absheight=1 valign=top align=left <img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr>
<td colspan=3 height=237 valign=bottom align=right >
<img src="wtv-news:/images/BannerDiscuss.gif" width=50 height=165>
<tr><td colspan=3 absheight=36>
</table>
</sidebar>
<body
bgcolor="191919" text="42BD52" link="189CD6"
vlink="189CD6"
hspace=0
vspace=0>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=10>
<td colspan=3>
<table cellspacing=0 cellpadding=0>
<tr>
<td valign=center absheight=80>
<font size="+2" color="E7CE4A"><blackface><shadow>
${(response.length == 0) ? "No " : ""}Discussion groups found
</table>
<td abswidth=20>
<tr>
<td>
<td WIDTH=198 HEIGHT=200 VALIGN=top ALIGN=left>`;
if (response.length == 0) {
data += `There are no discussion groups that match your request. Do you want to look for something else?`;
} else {
response.forEach((group) => {
data += `<hr width=436>
<IMG src="wtv-home:/ROMCache/Spacer.gif" width=1 height=6><br>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=10>
<td width=426> <table href="wtv-news:/news?group=${group.name}" selected cellspacing=0 cellpadding=0>
<tr>
<td abswidth=401 height=19 valign=top>
<shadow><b>${group.name}</table>
<td width=10>
`
if (group.description) {
data += `<tr><td colspan=3 width=10 height=6><tr><td width=10><td colspan=99><i><font color=828282>${group.description}</font></i>`
}
data += "</table>";
});
}
data += `
</table>
<TABLE width=446 cellspacing=0 cellpadding=0>
<tr>
<td rowspan=3 width=10 height=1>
<img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=1>
<td height=2 width=436 bgcolor="2B2B2B">
<img src="wtv-home:/ROMCache/Spacer.gif" width=436 height=1>
<tr>
<td height=1>
<tr>
<td height=2 bgcolor="0D0D0D">
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
</TABLE>
<table cellspacing=0 cellpadding=0>
<tr>
<td rowspan=2 abswidth=10>
<td absheight=10>
<tr>
<td abswidth=416 valign=top align=left>
Do you want to look for something else?<br>
<img src="/ROMCache/Spacer.gif" width=1 height=4>
<form action="wtv-news:/news">
<input name="search" bgcolor=#202020 cursor=#cc9933 text="E7CE4A" font=proportional value="${request_headers.query.search}" SIZE=28 MAXLENGTH=100>
&nbsp;
<font color=E7CE4A><shadow>
<input type=submit borderimage="file://ROM/Borders/ButtonBorder2.bif" value="Look for" usestyle>
</shadow></font>
</form>
</table>
</BODY>
</HTML>`;
sendToClient(socket, headers, data);
}).catch((e) => {
// listGroups error
throwError(e);
});
}).catch((e) => {
// no connection
throwError(e);
});
}
if (!wtvnews.client) {
var errpage = doErrorPage();
headers = errpage[0];
data = errpage[1];
} else {
var request_is_async = true;
if (request_headers.query.group) {
if (request_headers.query.search) {
WebTVSearchGroups(request_headers.query.search)
} else if (request_headers.query.group) {
if (request_headers.query.article) {
WebTVShowMessage(request_headers.query.group, request_headers.query.article);
} else {
WebTVListGroup(request_headers.query.group);
}
} else {
// redirect to lobby if no understandable queries passed
headers = "300 OK\nLocation: wtv-news:/lobby";
sendToClient(socket, headers, null);
}
}

View File

@@ -61,7 +61,7 @@ correct an item, press <b>Back</b>.<p>`;
<table cellspacing=0 cellpadding=0 border=0> <TR><TD>
<img src="images/arrow.gif"><font size=-2>&nbsp;&nbsp;<b>USERNAME</b></font><br>
<tr><td maxlines=1 >
<tt><font color=#d1d3d3><spacer type=horizontal size=17>${request_headers.query.subscriber_name}</font></tt></a>
<tt><font color=#d1d3d3><spacer type=horizontal size=17>${request_headers.query.subscriber_username}</font></tt></a>
</table>
<p>
<table cellspacing=0 cellpadding=0 border=0>

View File

@@ -98,6 +98,8 @@ Display name<br>
bgcolor=#444444 text=#ffdd33 cursor=#cc9933
TYPE="text" ASCIIONLY
SIZE="18"
selected
autoactivate
MAXLENGTH="18">
</a>
</table>

View File

@@ -123,7 +123,7 @@ MAXLENGTH="${minisrv_config.config.passwords.max_length}">
<tr>
<td colspan=3 align=left>
<br>Type again to confirm<br>
<INPUT noSubmit name="verify" id="verify" Value=""
<INPUT noSubmit name="password_verify" id="password_verify" Value=""
bgcolor=#444444 text=#ffdd33 cursor=#cc9933
TYPE="password" ASCIIONLY
SIZE="${minisrv_config.config.passwords.form_size}"

View File

@@ -2,10 +2,24 @@ var minisrv_service_file = true;
headers = `200 OK
Connection: Keep-Alive
wtv-expire-all: wtv-
wtv-noback-all: wtv-setup:/mail-signature
wtv-expire-all: wtv-setup:/mail-signature
wtv-expire-all: wtv-mail:/get-signature
wtv-expire-all: wtv-mail:/sendmail
wtv-expire-all: http
Content-Type: text/html`
var signature = session_data.getSessionData("subscriber_signature");
if (request_headers.query.mail_signature) {
if (signature != request_headers.query.mail_signature) {
session_data.setSessionData("subscriber_signature", (request_headers.query.mail_signature) ? request_headers.query.mail_signature : "");
session_data.saveSessionData();
signature = request_headers.query.mail_signature;
}
}
var message_colors = session_data.mailstore.getSignatureColors(signature)
data = `<HTML>
<HEAD>
<TITLE>
@@ -67,13 +81,16 @@ Mail signature
<td abswidth=20>
<TR>
<td>
<td colspan=3 WIDTH=416 HEIGHT=98 VALIGN=top ALIGN=left>
<td colspan=3 WIDTH=416 HEIGHT=68 VALIGN=top ALIGN=left>
<spacer type=block height=24 width=1>
Type a short text <B>signature</B> here and it will be added to the end of each mail message you send.
Type a short text <B>signature</B> here and it will be added to the end of each mail message you send.<br>
If you wish to use HTML, the first line of your signature should be <b>&lt;html&gt;</b>.
<TR>
<TD absheight=6>
<TR>
<TD>
<TD colspan=3 WIDTH=416 HEIGHT=118 VALIGN=top ALIGN=left>
<FORM method="POST" action="/validate-mail-signature">
<FORM method="POST" name="sig" action="/validate-mail-signature">
<INPUT type=hidden autosubmit=onleave>
<TEXTAREA name="mail_signature"
action="/validate-mail-signature"
@@ -84,7 +101,7 @@ cols=45 rows=5
autoactivate
nosoftbreaks
maxlength=4096
font=proportional>${session_data.getSessionData("subscriber_signature") || ""}</TEXTAREA></FORM></TD>
font=proportional>${signature || ""}</TEXTAREA></FORM></TD>
</FORM>
<TR>
<TD>
@@ -96,16 +113,26 @@ font=proportional>${session_data.getSessionData("subscriber_signature") || ""}</
<tr>
<TD>
<td colspan=4 height=1 valign=top align=left>
${(request_headers.query.preview) ? "<tr><td><td colspan=3><b>Signature Preview:</b>" : ""}
<tr>
<TD>
<td colspan=3 height=2 valign=top align=left bgcolor="0D0D0D">
<img src="wtv-home:/ROMCache/Spacer.gif" width=436 height=1>
<td colspan=3 valign=top align=left bgcolor="${(request_headers.query.preview) ? message_colors.bgcolor : "0D0D0D"}">
${(request_headers.query.preview) ? `<embed src="wtv-mail:/get-signature?sanitize=true&demotext=${encodeURIComponent(`<hr>This is a preview of your signature. The text below the line will not appear in your outgoing messages. It is provided to demonstrate what a message composed with this signature may look like. <a href="client:donothing">This is what a link looks like</a>.`)}" height=40></embed><br><br>` : ''}
<tr>
<td>
<td colspan=3 height=2 valign=top align=left>
<img src="wtv-home:/ROMCache/Spacer.gif" width=436 height=6>
<TR>
<TD>
<TD COLSPAN=4 HEIGHT=4 VALIGN=top ALIGN=left>
<TR>
<TD VALIGN=top ALIGN=left>
<FORM action="/mail-signature" METHOD="POST" onsubmit="this.mail_signature.value = document.forms[0].mail_signature.value">
<INPUT type=hidden name="mail_signature">
<FONT COLOR="#E7CE4A" SIZE=-1><SHADOW>
<INPUT TYPE=SUBMIT BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" Value=Preview NAME="preview" USESTYLE WIDTH=103>
</SHADOW></FONT></FORM>
<TD>
<TD COLSPAN=3 VALIGN=top ALIGN=right>
<TD VALIGN=top ALIGN=right>
<FORM action="client:goback">
<FONT COLOR="#E7CE4A" SIZE=-1><SHADOW>
<INPUT TYPE=SUBMIT BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" Value=Done NAME="Done" USESTYLE WIDTH=103>

View File

@@ -128,7 +128,9 @@ data += `
<spacer type=block width=1 height=5><BR>
<img src="ROMCache/BulletArrow.gif" width=6 height=13 valign=absmiddle><spacer type=block width=6 height=1>
<a href="wtv-setup:/phone">Dialing</a><BR>
<spacer type=block width=1 height=5><BR>
<img src="ROMCache/BulletArrow.gif" width=6 height=13 valign=absmiddle><spacer type=block width=6 height=1>
<a href="wtv-setup:/tweaks">Tweaks</a><BR>
<TD WIDTH=20>
<TD WIDTH=300 VALIGN=top ALIGN=left>
<spacer type=block width=6 height=14><font size="2"><br>
@@ -157,7 +159,8 @@ Configure Messenger<BR>`;
data += `<spacer type=block width=6 height=6><font size="2"><br>
Connecting to WebTV<BR>
<spacer type=block width=6 height=6><font size="2"><br>
minisrv specific settings<BR>
<tr>
<td colspan=4 height=2>

View File

@@ -0,0 +1,124 @@
var minisrv_service_file = true;
headers = `200 OK
Connection: Keep-Alive
wtv-expire-all: wtv-setup:/tweaks
Content-Type: text/html`
data = `<!--- *=* Copyright 1996, 1997 WebTV Networks, Inc. All rights reserved. --->
<HTML>
<HEAD>
<TITLE>
Tweaks and extra configuration
</TITLE>
<DISPLAY noscroll nologo>
</HEAD>
<sidebar width=110> <table cellspacing=0 cellpadding=0 BGCOLOR=452a36>
<tr>
<td colspan=3 abswidth=104 absheight=4>
<td rowspan=99 width=6 absheight=420 valign=top align=left>
<img src="file://ROM/Cache/Shadow.gif" width=6 height=420>
<tr>
<td abswidth=6>
<td abswidth=92 absheight=76>
<table href="wtv-home:/home" absheight=76 cellspacing=0 cellpadding=0>
<tr>
<td align=right>
<img src="${minisrv_config.config.service_logo}" width=87 height=67>
</table>
<td abswidth=6>
<tr><td absheight=5 colspan=3>
<table cellspacing=0 cellpadding=0>
<tr><td abswidth=104 absheight=2 valign=middle align=center bgcolor=2e1e26>
<spacer>
<tr><td abswidth=104 absheight=1 valign=top align=left>
<tr><td abswidth=104 absheight=2 valign=top align=left bgcolor=6b4657>
<spacer>
</table>
<tr><td absheight=132>
<tr><td absheight=166 align=right colspan=3>
<img src="ROMCache/SettingsBanner.gif" width=54 height=166>
<tr><td absheight=41>
</table>
</sidebar>
<BODY BGCOLOR="#191919" TEXT="#42CC55" LINK="189CD6" VLINK="189CD6" HSPACE=0 VSPACE=0 FONTSIZE="large"
>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=14>
<td colspan=3>
<table cellspacing=0 cellpadding=0>
<tr>
<td valign=center absheight=80>
<font size="+2" color="E7CE4A"><blackface><shadow>
Tweaks and extra config
</table>
<td abswidth=20>
<tr>
<TD>
<td colspan=3 height=2 abswidth=300 valign=middle align=center bgcolor="2B2B2B">
<spacer type=block width=436 height=1>
<tr>
<TD>
<td colspan=3 height=1 valign=top align=left>
<tr>
<TD>
<td colspan=3 height=2 valign=top align=left bgcolor="0D0D0D">
<spacer type=block width=436 height=1>
<td abswidth=20>
<tr><td colspan=4 height=10></td></tr>
<TR>
<td>
<td WIDTH=198 HEIGHT=236 VALIGN=top ALIGN=left>
<table cellspacing=0 cellpadding=0>
<tr><td absheight=110 valign=top>
<font size=-1>Speeds up the splash logo page
by not waiting for the splash music to finish.
</table>
<TD WIDTH=20>
<TD WIDTH=198 VALIGN=top ALIGN=left>
<form action="wtv-setup:/validate-tweaks">
<input type=hidden name=autosubmit value=true autosubmit=onleave>
<table cellspacing=0 cellpadding=0>
<tr><td absheight=70 valign=top>
<table>
<tr>
<td valign=top>
<input type=checkbox name=fast_splash ${(wtvshared.parseBool(session_data.getSessionData("fast_splash"))) ? "checked=checked" : ''}>
<td valign=top>
FastSplash&trade;
</table>
</table>
</form>
<TR>
<TD>
<TD COLSPAN=4 HEIGHT=0 VALIGN=top ALIGN=left>
<tr>
<TD>
<td colspan=3 height=2 valign=middle align=center bgcolor="2B2B2B">
<spacer type=block width=436 height=1>
<tr>
<TD>
<td colspan=4 height=1 valign=top align=left>
<tr>
<TD>
<td colspan=3 height=2 valign=top align=left bgcolor="0D0D0D">
<spacer type=block width=436 height=1>
<TR>
<TD>
<TD COLSPAN=4 HEIGHT=4 VALIGN=top ALIGN=left>
<TR>
<TD>
<TD COLSPAN=2 VALIGN=top ALIGN=left>
<TD VALIGN=top ALIGN=right>
<FORM action="client:goback">
<FONT COLOR="#E7CE4A" SIZE=-1><SHADOW>
<INPUT TYPE=SUBMIT BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" Value=Done NAME="Done" USESTYLE WIDTH=103>
</SHADOW></FONT></FORM>
<TD>
</TABLE>
</BODY>
</HTML>
`;

View File

@@ -36,7 +36,7 @@ Content-Type: text/html`
data = errpage[1];
}
else {
if (request_headers.query.password.length == 0 && request_headers.query.verify.length == 0) {
if (request_headers.query.password.length == 0 && request_headers.query.password_verify.length == 0) {
userSession.disableUserPassword();
headers = `300 OK
Content-type: text/html
@@ -50,7 +50,7 @@ Location: ${request_headers.query.return_to}`;
}
else if (request_headers.query.password.length < minisrv_config.config.passwords.min_length) errpage = wtvshared.doErrorPage(400, "Your password must contain at least " + minisrv_config.config.passwords.min_length + " characters.");
else if (request_headers.query.password.length > minisrv_config.config.passwords.max_length) errpage = wtvshared.doErrorPage(400, "Your password must contain no more than than " + minisrv_config.config.passwords.max_length + " characters.");
else if (request_headers.query.password !== request_headers.query.verify) errpage = wtvshared.doErrorPage(400, "The passwords you entered did not match. Please check them and try again.");
else if (request_headers.query.password !== request_headers.query.password_verify) errpage = wtvshared.doErrorPage(400, "The passwords you entered did not match. Please check them and try again.");
else {
if (errpage) {
headers = errpage[0];

View File

@@ -1,8 +1,11 @@
var minisrv_service_file = true;
if (request_headers.query && session_data) {
session_data.setSessionData("subscriber_signature", (request_headers.query.mail_signature) ? request_headers.query.mail_signature : "");
session_data.saveSessionData();
var signature = session_data.getSessionData("subscriber_signature");
if (request_headers.query.mail_signature != signature) {
session_data.setSessionData("subscriber_signature", (request_headers.query.mail_signature) ? request_headers.query.mail_signature : "");
session_data.saveSessionData();
}
headers = `200 OK
Content-type: text/html`
} else {

View File

@@ -54,7 +54,6 @@ Connection: Keep-Alive
Content-Type: text/html
wtv-expire-all: wtv-setup:/remove-users
wtv-expire-all: wtv-setup:/accounts
wtv-visit: ${confirmAlert}
Location: ${confirmAlert}`
} else {
Object.keys(usersToRemove).forEach(function (k) {
@@ -69,7 +68,6 @@ Connection: Keep-Alive
Content-Type: text/html
wtv-expire-all: wtv-setup:/remove-users
wtv-expire-all: wtv-setup:/accounts
wtv-visit: ${gourl}
Location: ${gourl}`
}
}

View File

@@ -0,0 +1,12 @@
var minisrv_service_file = true;
var fast_splash = wtvshared.parseBool(request_headers.query.fast_splash);
session_data.setSessionData("fast_splash", fast_splash);
session_data.saveSessionData();
headers = `200 OK
Connection: Keep-Alive
wtv-expire-all: wtv-
wtv-expire-all: http
Content-Type: text/html`