v0.9.55 (#32)
* v0.9.55 - CGI Support (eg PHP, Perl, etc) - Slight PC Admin updates - Numerous bug fixes - Security updates --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
@@ -3,6 +3,7 @@ if(!String.prototype.repeat){String.prototype.repeat=function(c){o='';for(i=0;i<
|
||||
|
||||
d=document
|
||||
rom='file://rom/'
|
||||
rmb=rom+'Borders/'
|
||||
htm=rom+'HTMLs/'
|
||||
cch=rom+'Cache/'
|
||||
|
||||
@@ -32,7 +33,7 @@ function gTC(type,itm){
|
||||
case 1://dark
|
||||
bgclr='191919'
|
||||
tclr='42bd52'
|
||||
bbif = thb+'ButtonBorder2'
|
||||
bbif = rmb+'ButtonBorder2'
|
||||
break
|
||||
case 2://red
|
||||
bgclr='6e0005'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
var minisrv_service_file = true;
|
||||
|
||||
WTVPCAdmin = require(classPath + "/WTVPCAdmin.js")
|
||||
var wtva = new WTVPCAdmin(minisrv_config, socket, service_name);
|
||||
WTVAdmin = require(classPath + "/WTVAdmin.js")
|
||||
var wtva = new WTVAdmin(minisrv_config, socket, service_name);
|
||||
var auth = wtva.isAuthorized();
|
||||
if (auth === true) {
|
||||
var password = null;
|
||||
@@ -28,154 +28,21 @@ Welcome to the zefie minisrv v${minisrv_config.version} Account Administration
|
||||
</p>
|
||||
`;
|
||||
data = htmlhead;
|
||||
if (!request_headers.query.cmd) {
|
||||
data += `Please select an option to get started:
|
||||
data += `Please select an option to get started:
|
||||
<hr>
|
||||
<a href="?cmd=list">List all SSIDs and their Primary User</a><br>
|
||||
<a href="/admin/ssid?cmd=list">List all SSIDs and their Primary User</a><br>
|
||||
</p>
|
||||
</body>
|
||||
</html >`;
|
||||
}
|
||||
else if (request_headers.query.cmd == "list") {
|
||||
data += `<hr>`;
|
||||
if (request_headers.query.msg) {
|
||||
data += decodeURI(request_headers.query.msg) + "<hr>";
|
||||
}
|
||||
data += `<table border=1>`;
|
||||
accounts = wtva.listRegisteredSSIDs();
|
||||
Object.keys(accounts).forEach(function (k) {
|
||||
data += `<tr><td><a href="?cmd=ssid&ssid=${accounts[k][0]}">${accounts[k][0]}</a></td><td>${(accounts[k][1]['username'] === undefined) ? "Unregistered SSID" : accounts[k][1]['username'] }</td></tr>`;
|
||||
});
|
||||
data += `</table>`;
|
||||
|
||||
} else if (request_headers.query.cmd == "ssid") {
|
||||
var ssid = request_headers.query.ssid;
|
||||
if (!ssid) {
|
||||
redirectmsg = `An SSID is required for the ${request_headers.query.cmd} command.`;
|
||||
} else {
|
||||
data += "<hr>";
|
||||
if (request_headers.query.msg) {
|
||||
data += decodeURI(request_headers.query.msg) + "<hr>";
|
||||
}
|
||||
data += `<script>
|
||||
function validateSelection(cmd, ssid, friendlymsg) {
|
||||
conf = confirm("Are you sure you wish to "+friendlymsg+"?\\n\\n"+ssid);
|
||||
if (conf) {
|
||||
location.href = "/admin/?cmd="+cmd+"&ssid="+ssid;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
`
|
||||
data += `<p>Management for SSID: ${ssid}</p>`;
|
||||
data += `<form action="/admin/" method="GET">`
|
||||
data += `<input type="button" value="Delete Account" onclick="validateSelection('delete', '${ssid}', 'delete all accounts associated with this SSID')">`
|
||||
if (wtva.isBanned(ssid)) {
|
||||
data += `<input type="button" value="Ban Account" onclick="validateSelection('ban', '${ssid}', 'ban this SSID')" disabled=disabled>`
|
||||
data += `<input type="button" value="Unban Account" onclick="validateSelection('unban', '${ssid}', 'unban this SSID')">`
|
||||
} else {
|
||||
data += `<input type="button" value="Ban Account" onclick="validateSelection('ban', '${ssid}', 'ban this SSID')">`
|
||||
data += `<input type="button" value="Unban Account" onclick="validateSelection('unban', '${ssid}', 'unban this SSID')" disabled=disabled>`
|
||||
}
|
||||
data += "<p><table border=1>";
|
||||
user_info = wtva.getAccountInfoBySSID(ssid.toLowerCase());
|
||||
if (user_info.account_users) {
|
||||
if (user_info.account_users['subscriber']) {
|
||||
data += `<tr><td>Primary User:</td><td>${user_info.account_users['subscriber'].subscriber_username}</td></tr>`;
|
||||
if (Object.keys(user_info.account_users).length > 1) {
|
||||
data += `<tr><td style="vertical-align: top">Additional Users:</td><td>`;
|
||||
Object.keys(user_info.account_users).forEach(function (k) {
|
||||
if (k == "subscriber") return;
|
||||
data += user_info.account_users[k].subscriber_username + "<br>";
|
||||
})
|
||||
data += `</td></tr>`
|
||||
}
|
||||
data += "</table></p>";
|
||||
} else {
|
||||
data += "The user aborted registration, so this account has no users."
|
||||
}
|
||||
} else {
|
||||
data += "The SSID does not exist in the SessionStore."
|
||||
}
|
||||
}
|
||||
} else if (request_headers.query.cmd == "delete") {
|
||||
redirectmsg = "";
|
||||
var ssid = request_headers.query.ssid;
|
||||
if (ssid) {
|
||||
var userAccount = wtva.getAccountBySSID(ssid);
|
||||
userAccount.unregisterBox();
|
||||
redirectmsg = `All data for SSID ${ssid} has been deleted. Please note that this does not include Usenet posts made by this account.`;
|
||||
} else {
|
||||
redirectmsg = `An SSID is required for the ${request_headers.query.cmd} command.`;
|
||||
}
|
||||
headers = "302 OK\nLocation: /admin/?cmd=list&msg=" + encodeURI(redirectmsg);
|
||||
} else if (request_headers.query.cmd == "ban") {
|
||||
redirectmsg = "";
|
||||
var ssid = request_headers.query.ssid;
|
||||
if (ssid) {
|
||||
var fake_config = wtvshared.getUserConfig();
|
||||
if (!fake_config.config) fake_config.config = {};
|
||||
if (!fake_config.config.ssid_block_list) fake_config.config.ssid_block_list = [];
|
||||
var entry_exists = false;
|
||||
Object.keys(fake_config.config.ssid_block_list).forEach(function (k) {
|
||||
if (fake_config.config.ssid_block_list[k] == ssid) {
|
||||
redirectmsg = "The SSID was already banned.";
|
||||
}
|
||||
});
|
||||
if (!entry_exists) {
|
||||
fake_config.config.ssid_block_list.push(ssid);
|
||||
wtvshared.writeToUserConfig(fake_config);
|
||||
reloadConfig();
|
||||
redirectmsg = "The SSID is now banned.";
|
||||
}
|
||||
} else {
|
||||
redirectmsg = `An SSID is required for the ${request_headers.query.cmd} command.`;
|
||||
}
|
||||
headers = "302 OK\nLocation: /admin/?cmd=ssid&ssid=" + encodeURI(ssid) + "&msg=" + encodeURI(redirectmsg);
|
||||
} else if (request_headers.query.cmd == "unban") {
|
||||
redirectmsg = "The SSID was not banned, so it could not be unbanned.";
|
||||
var ssid = request_headers.query.ssid;
|
||||
if (ssid) {
|
||||
var config_changed = false;
|
||||
var fake_config = wtvshared.getUserConfig();
|
||||
if (!fake_config.config) fake_config.config = {};
|
||||
if (!fake_config.config.ssid_block_list) fake_config.config.ssid_block_list = [];
|
||||
if (typeof request_headers.query.ssid === 'string') {
|
||||
Object.keys(fake_config.config.ssid_block_list).forEach(function (k) {
|
||||
if (fake_config.config.ssid_block_list[k] == request_headers.query.ssid) {
|
||||
fake_config.config.ssid_block_list.splice(k, 1);
|
||||
config_changed = true
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Object.keys(fake_config.config.ssid_block_list).forEach(function (k) {
|
||||
Object.keys(request_headers.query.ssid).forEach(function (j) {
|
||||
if (fake_config.config.ssid_block_list[k] == request_headers.query.ssid[j]) {
|
||||
fake_config.config.ssid_block_list.splice(k, 1);
|
||||
config_changed = true
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if (config_changed) {
|
||||
wtvshared.writeToUserConfig(fake_config);
|
||||
minisrv_config = reloadConfig();
|
||||
redirectmsg = "The SSID is now unbanned.";
|
||||
}
|
||||
else {
|
||||
redirectmsg = `An SSID is required for the ${request_headers.query.cmd} command.`;
|
||||
}
|
||||
}
|
||||
headers = "302 OK\nLocation: /admin/?cmd=ssid&ssid=" + encodeURI(ssid) + "&msg=" + encodeURI(redirectmsg);
|
||||
}
|
||||
|
||||
} else {
|
||||
var errpage = wtvshared.doErrorPage(401, "Please enter the administration password, you can leave the username blank.");
|
||||
headers = errpage[0];
|
||||
headers += "\nWWW-Authenticate: Basic";
|
||||
data = errpage[1];
|
||||
}
|
||||
} else {
|
||||
var errpage = wtvshared.doErrorPage(403, auth);
|
||||
var errpage = wtvshared.doErrorPage(401, "Please enter the administration password, you can leave the username blank.");
|
||||
headers = errpage[0];
|
||||
headers += "\nWWW-Authenticate: Basic";
|
||||
data = errpage[1];
|
||||
}
|
||||
} else {
|
||||
var errpage = wtvshared.doErrorPage(403, auth);
|
||||
headers = errpage[0];
|
||||
data = errpage[1];
|
||||
}
|
||||
154
zefie_wtvp_minisrv/includes/ServiceVault/http_pc/admin/ssid.js
Normal file
154
zefie_wtvp_minisrv/includes/ServiceVault/http_pc/admin/ssid.js
Normal file
@@ -0,0 +1,154 @@
|
||||
var minisrv_service_file = true;
|
||||
|
||||
WTVAdmin = require(classPath + "/WTVAdmin.js")
|
||||
var wtva = new WTVAdmin(minisrv_config, socket, service_name);
|
||||
var auth = wtva.isAuthorized();
|
||||
if (auth === true) {
|
||||
var password = null;
|
||||
if (request_headers.authorization) {
|
||||
var authheader = request_headers.authorization.split(' ');
|
||||
console.log(request_headers)
|
||||
|
||||
if (authheader[0] == "Basic") {
|
||||
password = Buffer.from(authheader[1], 'base64').toString();
|
||||
password = password.split(':')[1];
|
||||
}
|
||||
}
|
||||
if (wtva.checkPassword(password)) {
|
||||
headers = `200 OK
|
||||
Content-Type: text/html`
|
||||
|
||||
htmlhead = `<html>
|
||||
<head>
|
||||
<title>zefie minisrv v${minisrv_config.version} account administration</title>
|
||||
</head>
|
||||
<body bgcolor="#000000" text="#449944" link="gold" alink="gold" vlink="gold">
|
||||
<p>
|
||||
Welcome to the zefie minisrv v${minisrv_config.version} Account Administration
|
||||
</p>
|
||||
`;
|
||||
data = htmlhead;
|
||||
if (request_headers.query.cmd == "list") {
|
||||
data += `<hr>`;
|
||||
if (request_headers.query.msg) {
|
||||
data += decodeURI(request_headers.query.msg) + "<hr>";
|
||||
}
|
||||
data += `<table border=1>`;
|
||||
accounts = wtva.listRegisteredSSIDs();
|
||||
Object.keys(accounts).forEach(function (k) {
|
||||
data += `<tr><td><a href="?cmd=ssid&ssid=${accounts[k][0]}">${accounts[k][0]}</a></td><td>${(accounts[k][1]['username'] === undefined) ? "Unregistered SSID" : accounts[k][1]['username'] }</td></tr>`;
|
||||
});
|
||||
data += `</table>`;
|
||||
|
||||
} else if (request_headers.query.cmd == "ssid") {
|
||||
var ssid = request_headers.query.ssid;
|
||||
if (!ssid) {
|
||||
redirectmsg = `An SSID is required for the ${request_headers.query.cmd} command.`;
|
||||
} else {
|
||||
data += "<hr>";
|
||||
if (request_headers.query.msg) {
|
||||
data += decodeURI(request_headers.query.msg) + "<hr>";
|
||||
}
|
||||
data += `<script>
|
||||
function validateSelection(cmd, ssid, friendlymsg) {
|
||||
conf = confirm("Are you sure you wish to "+friendlymsg+"?\\n\\n"+ssid);
|
||||
if (conf) {
|
||||
location.href = "/admin/ssid/?cmd="+cmd+"&ssid="+ssid;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
`
|
||||
data += `<p>Management for SSID: ${ssid}</p>`;
|
||||
data += `<form action="/admin/" method="GET">`
|
||||
data += `<input type="button" value="Delete Account" onclick="validateSelection('delete', '${ssid}', 'delete all accounts associated with this SSID')">`
|
||||
if (wtva.isBanned(ssid)) {
|
||||
data += `<input type="button" value="Ban Account" onclick="validateSelection('ban', '${ssid}', 'ban this SSID')" disabled=disabled>`
|
||||
data += `<input type="button" value="Unban Account" onclick="validateSelection('unban', '${ssid}', 'unban this SSID')">`
|
||||
} else {
|
||||
data += `<input type="button" value="Ban Account" onclick="validateSelection('ban', '${ssid}', 'ban this SSID')">`
|
||||
data += `<input type="button" value="Unban Account" onclick="validateSelection('unban', '${ssid}', 'unban this SSID')" disabled=disabled>`
|
||||
}
|
||||
data += "<p><a href='?cmd=list'>Back to SSID List</a>";
|
||||
data += "<p><table border=1>";
|
||||
user_info = wtva.getAccountInfoBySSID(ssid);
|
||||
if (user_info.account_users) {
|
||||
if (user_info.account_users['subscriber']) {
|
||||
data += `<tr><td>Primary User:</td><td>${user_info.account_users['subscriber'].subscriber_username}</td></tr>`;
|
||||
if (Object.keys(user_info.account_users).length > 1) {
|
||||
data += `<tr><td style="vertical-align: top">Additional Users:</td><td>`;
|
||||
Object.keys(user_info.account_users).forEach(function (k) {
|
||||
if (k == "subscriber") return;
|
||||
data += user_info.account_users[k].subscriber_username + "<br>";
|
||||
})
|
||||
data += `</td></tr>`
|
||||
}
|
||||
data += "</table></p>";
|
||||
} else {
|
||||
data += "The user aborted registration, so this account has no users."
|
||||
}
|
||||
} else {
|
||||
data += "The SSID does not exist in the SessionStore."
|
||||
}
|
||||
}
|
||||
} else if (request_headers.query.cmd == "delete") {
|
||||
redirectmsg = "";
|
||||
var ssid = request_headers.query.ssid;
|
||||
if (ssid) {
|
||||
var userAccount = wtva.getAccountBySSID(ssid);
|
||||
userAccount.unregisterBox();
|
||||
redirectmsg = `All data for SSID ${ssid} has been deleted. Please note that this does not include Usenet posts made by this account.`;
|
||||
} else {
|
||||
redirectmsg = `An SSID is required for the ${request_headers.query.cmd} command.`;
|
||||
}
|
||||
headers = "302 OK\nLocation: /admin/?cmd=list&msg=" + encodeURI(redirectmsg);
|
||||
} else if (request_headers.query.cmd == "ban") {
|
||||
redirectmsg = "";
|
||||
var ssid = request_headers.query.ssid;
|
||||
if (ssid) {
|
||||
var result = wtva.banSSID(ssid);
|
||||
if (result === wtva.SUCCESS) {
|
||||
reloadConfig();
|
||||
redirectmsg = "The SSID is now banned.";
|
||||
} else if (result == wtva.REASON_EXISTS) {
|
||||
redirectmsg = "The SSID was already banned.";
|
||||
} else {
|
||||
redirectmsg = "Unknown response " + result.toString();
|
||||
}
|
||||
} else {
|
||||
redirectmsg = `An SSID is required for the ${request_headers.query.cmd} command.`;
|
||||
}
|
||||
headers = "302 OK\nLocation: /admin/?cmd=ssid&ssid=" + encodeURI(ssid) + "&msg=" + encodeURI(redirectmsg);
|
||||
} else if (request_headers.query.cmd == "unban") {
|
||||
redirectmsg = "The SSID was not banned, so it could not be unbanned.";
|
||||
var ssid = request_headers.query.ssid;
|
||||
if (ssid) {
|
||||
var result = wtv.unbanSSID(ssid);
|
||||
if (result === wtva.SUCCESS) {
|
||||
reloadConfig();
|
||||
redirectmsg = "The SSID is now unbanned.";
|
||||
} else if (result == wtva.REASON_EXISTS) {
|
||||
redirectmsg = "The SSID was not banned.";
|
||||
} else {
|
||||
redirectmsg = "Unknown response " + result.toString();
|
||||
}
|
||||
} else {
|
||||
redirectmsg = `An SSID is required for the ${request_headers.query.cmd} command.`;
|
||||
}
|
||||
headers = "302 OK\nLocation: /admin/?cmd=ssid&ssid=" + encodeURI(ssid) + "&msg=" + encodeURI(redirectmsg);
|
||||
} else {
|
||||
var errpage = wtvshared.doErrorPage(401, "Missing command.");
|
||||
headers = errpage[0];
|
||||
headers += "\nWWW-Authenticate: Basic";
|
||||
data = errpage[1];
|
||||
}
|
||||
} else {
|
||||
var errpage = wtvshared.doErrorPage(401, "Please enter the administration password, you can leave the username blank.");
|
||||
headers = errpage[0];
|
||||
headers += "\nWWW-Authenticate: Basic";
|
||||
data = errpage[1];
|
||||
}
|
||||
} else {
|
||||
var errpage = wtvshared.doErrorPage(403, auth);
|
||||
headers = errpage[0];
|
||||
data = errpage[1];
|
||||
}
|
||||
@@ -15,24 +15,7 @@ if (auth === true) {
|
||||
if (wtva.checkPassword(password)) {
|
||||
if (request_headers.query.ssid) {
|
||||
var ssid = request_headers.query.ssid.toLowerCase();
|
||||
if (ssid == socket.ssid) {
|
||||
var nobanself = true;
|
||||
} else {
|
||||
var fake_config = wtvshared.getUserConfig();
|
||||
if (!fake_config.config) fake_config.config = {};
|
||||
if (!fake_config.config.ssid_block_list) fake_config.config.ssid_block_list = [];
|
||||
var entry_exists = false;
|
||||
Object.keys(fake_config.config.ssid_block_list).forEach(function (k) {
|
||||
if (fake_config.config.ssid_block_list[k] == ssid) {
|
||||
entry_exists = true;
|
||||
}
|
||||
});
|
||||
if (!entry_exists) {
|
||||
fake_config.config.ssid_block_list.push(ssid);
|
||||
wtvshared.writeToUserConfig(fake_config);
|
||||
reloadConfig();
|
||||
}
|
||||
}
|
||||
var result = wtva.banSSID(ssid, socket.ssid);
|
||||
}
|
||||
headers = `200 OK
|
||||
Content-Type: text/html
|
||||
@@ -61,13 +44,16 @@ wtv-expire-all: wtv-admin:/ban`;
|
||||
<input type="submit" value="Ban SSID">
|
||||
</form><br><br>`
|
||||
if (request_headers.query.ssid) {
|
||||
if (nobanself) {
|
||||
if (result == wtva.REASON_SELF) {
|
||||
data += "<strong>Cannot ban yourself.</strong>"
|
||||
} else {
|
||||
if (entry_exists) {
|
||||
if (result == wtva.REASON_EXISTS) {
|
||||
data += "<strong>SSID " + request_headers.query.ssid + " is already in the ban list.</strong><br><br>";
|
||||
} else {
|
||||
} else if (result === wtva.SUCCESS) {
|
||||
reloadConfig();
|
||||
data += "<strong>SSID " + request_headers.query.ssid + " added to the ban list.</strong><br><br>";
|
||||
} else {
|
||||
data += "<strong>Unexpected response "+result.toString()+".</strong><br><br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,6 +95,7 @@ wtv-language-header: en-US,en
|
||||
wtv-noback-all: wtv-
|
||||
wtv-transition-override: off
|
||||
wtv-smartcard-inserted-message: Contacting service
|
||||
wtv-addresses-url: wtv-mail:/addresslist
|
||||
wtv-ssl-timeout: 240
|
||||
wtv-login-timeout: 7200
|
||||
`;
|
||||
|
||||
@@ -1,38 +1,300 @@
|
||||
var minisrv_service_file = true;
|
||||
var minisrv_service_file = true;
|
||||
var camefrom = request_headers.query.camefrom;
|
||||
var action = request_headers.query.action;
|
||||
|
||||
if (request_headers.query.action == "editfromheader") {
|
||||
|
||||
function parseAddress() {
|
||||
var nickname = request_headers.query.nickname + ":"
|
||||
var address = request_headers.query.address;
|
||||
return {
|
||||
nickname: address
|
||||
};
|
||||
}
|
||||
var addresstoadd = parseAddress()
|
||||
|
||||
if (session_data.getSessionData("address_book")) {
|
||||
session_data.setSessionData("address_book", session_data.getSessionData("address_book") + addresstoadd);
|
||||
session_data.saveSessionData();
|
||||
} else {
|
||||
session_data.setSessionData("address_book", addresstoadd);
|
||||
session_data.saveSessionData();
|
||||
}
|
||||
|
||||
|
||||
headers = `200 OK
|
||||
Content-type: text/html
|
||||
wtv-expire: wtv-mail:/addresslist`;
|
||||
} else {
|
||||
var camefrom = request_headers.query.camefrom;
|
||||
|
||||
var CommonBLIMScripts = wtvshared.unpackCompressedB64('eNrFVttuGjEQfQaJfxjtS3ZbKFCpfQhJJIiEmiptI5V8gFkPYOG1kS9QVOXf6/Ui4l1uq0hRH9eeOXPOmVnbNzpVbGWAEzG3ZI630XeyJsVidNdqzqxIDZMC5mi+2YyInyTDGDPC+JBShVonrebfhkJjlYARZ9knF/l8NHDQeAkA9SnANgjc5KsHyPoE8mtGucQPt4dijupB/1qSbRwCxgUk00PO1hgnkAxazTCZ6bFiKOh5sUw/iEemTRyNH6M2lPVWAUdcpkusjTi6jDjkXG7qIw5PIHa7sJKcpdtrYDMwCwSrUQGhVAOBmfehDRsEYo3MiGEp4XwLJK8ORFCwYppr80h5+gqVdgSJ8V/atQYMyzDgPsUCdrJg+slHH4rw7B2JiTxj8ZoowD+YWoPeDbiFyBMLkK8i+FhKdJ/RVTKIyvnPhYocYSeoJoYbzImTJ62JQypt6H/o93q95GjIrlobPu+Dyq2gEoQ0UHDaLFA4mztTS+mWiXmnAxlZOm+t2tvNNOSmexe4cyywm9a1W2Em1zhWMntHz8/49eXALief5BocNS4JjZM87OvesNeJqjSsnr6jv0RQParA3kuFp7WFHT/DzYNcHPfRBWpHjen3D6sfDnM9by4RqPa8vjdvUVEdsP+t4Qy3ev0dXjrfKdNvE/2uQ+1OqFSKNQp3nqR4DdoQZdw14ReV9s0MRPzOt++DvRMa5ApFKazMJRnAPiy/191bRT8RgTz2tBpVVlPlDkmwK38BOaDgNQCrPC+kuJCb/e4OtMTrSMFW86ZbPJPu/gEVxhrd');
|
||||
var address_book = null
|
||||
address_book = session_data.getSessionData("address_book")
|
||||
if (address_book == null) {
|
||||
session_data.setSessionData("address_book", [])
|
||||
address_book = [];
|
||||
}
|
||||
|
||||
if (!camefrom && !action) {
|
||||
headers = `200 OK`
|
||||
|
||||
data = `<html>
|
||||
<head>
|
||||
<SAVEPANEL
|
||||
message="The address book cannot be saved, because it is part of ${ minisrv_config.config.service_name }"
|
||||
>
|
||||
<SENDPANEL action="wtv-mail:/sendmail"
|
||||
message="Write a new message"
|
||||
label="Write"
|
||||
>
|
||||
<title>Addresses</title>
|
||||
</head>
|
||||
<print blackandwhite>
|
||||
<sidebar width=114 height=420 align=left>
|
||||
<table cellspacing=0 cellpadding=0 bgcolor=333b5a>
|
||||
<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 width=100%>
|
||||
<tr>
|
||||
<td abswidth=6>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1>
|
||||
<td align=center>
|
||||
<img src="wtv-mail:/ROMCache/WebTVLogoJewel.gif" width=87 height=67>
|
||||
</table>
|
||||
<td abswidth=5>
|
||||
<tr>
|
||||
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||
<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=515b84>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr>
|
||||
<td abswidth=6>
|
||||
<td abswidth=93 absheight=26>
|
||||
<table href="wtv-mail:/listmail"
|
||||
cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td abswidth=5>
|
||||
<td abswidth=90 valign=middle align=left>
|
||||
<table bgcolor=333b5a cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td absheight=1>
|
||||
<tr>
|
||||
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Mail list</font></shadow>
|
||||
</table>
|
||||
</table>
|
||||
<td abswidth=5>
|
||||
<tr>
|
||||
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||
<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=515b84>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr>
|
||||
<td abswidth=6>
|
||||
<td abswidth=93 absheight=26>
|
||||
<table id=new href="/addressbook?camefrom=inbox&action=edit&new_address=true&selected=new"
|
||||
cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td abswidth=5>
|
||||
<td abswidth=90 valign=middle align=left>
|
||||
<table bgcolor=333b5a cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td absheight=1>
|
||||
<tr>
|
||||
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Add</font></shadow>
|
||||
</table>
|
||||
</table>
|
||||
<td abswidth=5>
|
||||
<tr>
|
||||
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||
<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=515b84>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr>
|
||||
<td abswidth=6>
|
||||
<td abswidth=93 absheight=26>
|
||||
<table href="client:showalert?message=This%20feature%20is%20not%20currently%20available." transition=light cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td abswidth=5>
|
||||
<td abswidth=90 valign=middle align=left>
|
||||
<table bgcolor=333b5a cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td absheight=1>
|
||||
<tr>
|
||||
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Look up</font></shadow>
|
||||
</table>
|
||||
</table>
|
||||
<td abswidth=5>
|
||||
<tr>
|
||||
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||
<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=515b84>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr>
|
||||
<td abswidth=6>
|
||||
<td abswidth=93 absheight=26>
|
||||
<table href="wtv-guide:/quickhelp?title=AddressBook"
|
||||
cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td abswidth=5>
|
||||
<td abswidth=90 valign=middle align=left>
|
||||
<table bgcolor=333b5a 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=202434>
|
||||
<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=515b84>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr>
|
||||
<td colspan=3 height=174 valign=bottom align=right >
|
||||
<img src="wtv-mail:/ROMCache/BannerMail.gif" width=50 height=96>
|
||||
<tr><td colspan=3 absheight=36>
|
||||
</table>
|
||||
</sidebar>
|
||||
<body instructions="wtv-guide:/helpindex?title=Index_Mail"
|
||||
bgcolor="191919" text="42BD52" link="189CD6" vlink="189CD6"
|
||||
vspace=0
|
||||
hspace=0>
|
||||
<table cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td height=16 valign=top align=left>
|
||||
<tr>
|
||||
<td abswidth=8><img src="wtv-home:/ROMCache/Spacer.gif" width=8 height=1>
|
||||
<td height=39 valign=top>
|
||||
<font size=+1 color="E7CE4A">
|
||||
<blackface>
|
||||
<shadow>
|
||||
E-mail addresses for ${session_data.getSessionData("subscriber_username")}
|
||||
</shadow>
|
||||
</blackface>
|
||||
</font>
|
||||
</table>
|
||||
<table border=0 cellspacing=0 cellpadding=0>
|
||||
<tr absheight=26>
|
||||
<td rowspan=1000 abswidth=8>
|
||||
<td colspan=3>
|
||||
Your address is ${session_data.getSessionData("subscriber_username")}@${minisrv_config.config.service_name}
|
||||
<tr absheight=8>
|
||||
<td colspan=3>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=8>
|
||||
<tr>
|
||||
<td colspan=3 height=2 valign=middle align=center bgcolor="2B2B2B">
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr>
|
||||
<td colspan=3 height=1 valign=top align=left>
|
||||
<tr>
|
||||
<td colspan=3 height=2 valign=top align=left bgcolor="0D0D0D">
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr>
|
||||
<td abswidth=170 height=26 valign=middle align=left>
|
||||
<font size=-1><b>Name</b></font>
|
||||
<td abswidth=230 valign=middle align=left>
|
||||
<font size=-1><b>E-mail address</b></font>
|
||||
<td abswidth=38 valign=middle align=right>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=26>
|
||||
<tr>
|
||||
<td colspan=3 height=2 valign=middle align=center bgcolor="2B2B2B">
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr>
|
||||
<td colspan=3 height=1 valign=top align=left>
|
||||
<tr>
|
||||
<td colspan=3 height=2 valign=top align=left bgcolor="0D0D0D">
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr>
|
||||
<td colspan=3 absheight=10>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=10>
|
||||
</table>`;
|
||||
for (let i = 0; i < address_book.length; i++) {
|
||||
data += `
|
||||
<table border=0 cellspacing=0 cellpadding=0>
|
||||
<TR>
|
||||
<TD ABSWIDTH=8 valign=top>
|
||||
<TD ABSWIDTH=400>
|
||||
<TABLE cellspacing=0 cellpadding=0 HREF="/addressbook?camefrom=inbox&action=edit&id=${i}">
|
||||
<TR><TD ABSWIDTH=150 valign=top>${address_book[i].name}
|
||||
<TD ABSWIDTH=20 width=20><spacer>
|
||||
<TD ABSWIDTH=230 valign=top>${address_book[i].address}
|
||||
</TABLE>
|
||||
<TD ABSWIDTH=30>
|
||||
<TR>
|
||||
<TD colspan=4 absheight=6><spacer>
|
||||
</table>`
|
||||
}
|
||||
data += `
|
||||
</table>
|
||||
</body></html>`;
|
||||
} else {
|
||||
switch (camefrom) {
|
||||
case "messenger":
|
||||
data = `${CommonBLIMScripts}
|
||||
headers = `200 OK`;
|
||||
data = `<script language="Javascript">
|
||||
function getHumanName(emailAddress)
|
||||
{return Blim.getUmanName(emailAddress);}
|
||||
function setHumanName(emailAddress, newName)
|
||||
{return Blim.setUmanName(emailAddress, newName);}
|
||||
function MessengerIsOkay()
|
||||
{return ( Blim.isAlive() );
|
||||
}
|
||||
function isFriend(emailAddress)
|
||||
{return Blim.isInList("FL", emailAddress);
|
||||
}
|
||||
function isBlocked(emailAddress)
|
||||
{return Blim.isInList("BL", emailAddress);
|
||||
}
|
||||
function isAllowed(emailAddress)
|
||||
{return Blim.isInList("AL", emailAddress);
|
||||
}
|
||||
// policy: if the user adds a friend, we automatically allow and unblock
|
||||
// the person at the same time
|
||||
function befriendThisPerson(emailAddress)
|
||||
{Blim.addToList("FL", emailAddress);
|
||||
var executeAllow = "allowThisPerson('" + emailAddress + "');";
|
||||
var executeUnblock = "unblockThisPerson('" + emailAddress + "');";
|
||||
setTimeout(executeAllow, 1*1000);
|
||||
setTimeout(executeUnblock, 2*1000);
|
||||
}
|
||||
// policy: do not block when un-buddying-- make sure person is on allow list
|
||||
function defriendThisPerson(emailAddress)
|
||||
{Blim.removeFromList("FL", emailAddress);
|
||||
var executeAllow = "allowThisPerson('" + emailAddress + "');";
|
||||
setTimeout(executeAllow, 1*500);
|
||||
setTimeout(location.reload(), 1*600);
|
||||
}
|
||||
function blockThisPerson(emailAddress)
|
||||
{Blim.removeFromList("AL", emailAddress);
|
||||
setTimeout("blockThisPersonCore('" + emailAddress + "');", 1*1000);
|
||||
}
|
||||
function blockThisPersonCore(emailAddress)
|
||||
{Blim.addToList("BL", emailAddress);
|
||||
setTimeout(location.reload(), 1*1100);
|
||||
}
|
||||
function unblockThisPerson(emailAddress)
|
||||
{Blim.removeFromList("BL", emailAddress);
|
||||
setTimeout("allowThisPersonCore('" + emailAddress + "');", 1*1000);
|
||||
setTimeout(location.reload(), 1*1100);
|
||||
}
|
||||
function allowThisPerson(emailAddress)
|
||||
{Blim.removeFromList("BL", emailAddress);
|
||||
setTimeout("allowThisPersonCore('" + emailAddress + "');", 1*1000);
|
||||
}
|
||||
function allowThisPersonCore(emailAddress)
|
||||
{Blim.addToList("AL", emailAddress);
|
||||
}
|
||||
function disallowThisPerson(emailAddress)
|
||||
{Blim.removeFromList("AL", emailAddress);
|
||||
setTimeout("blockThisPersonCore('" + emailAddress + "');", 1*1000);
|
||||
}
|
||||
// convenience: start a conversation
|
||||
function StartConversation(emailAddress)
|
||||
{Blim.openConversation( emailAddress ); Blim.openMessagesPanel();
|
||||
}// convenience: bring up the main Messenger panel
|
||||
function ShowMessengerPanel()
|
||||
{Blim.openMessagesPanel();
|
||||
}
|
||||
</script>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Addresses</TITLE>
|
||||
@@ -51,11 +313,11 @@ label="View saved messages">
|
||||
<TD ROWSPAN=100 WIDTH=10 HEIGHT=420 VALIGN=TOP ALIGN=LEFT BGCOLOR=191919><IMG SRC="ROMCache/Shadow.gif" WIDTH=6 HEIGHT=420>
|
||||
<TR><TD ABSWIDTH=6>
|
||||
<TD ABSWIDTH=109 ABSHEIGHT=76>
|
||||
<TABLE HREF="wtv-home:/home" ABSHEIGHT=76 CELLSPACING=0 CELLPADDING=0 WIDTH=100%>
|
||||
<TR><TD ABSWIDTH=6>
|
||||
<TABLE HREF="wtv-home:/home" ABSHEIGHT=76 CELLSPACING=0 CELLPADDING=0 WIDTH=100%>
|
||||
<TR><TD ABSWIDTH=6>
|
||||
<IMG SRC="ROMCache/spacer.gif" WIDTH=1>
|
||||
<TD ALIGN=CENTER><IMG SRC="ROMCache/WebTVLogoJewel.gif" WIDTH=87 HEIGHT=67>
|
||||
</TABLE>
|
||||
</TABLE>
|
||||
<TD ABSWIDTH=5>
|
||||
|
||||
<TR><TD COLSPAN=3 ABSHEIGHT=2 VALIGN=MIDDLE ALIGN=CENTER BGCOLOR=202434><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
|
||||
@@ -63,14 +325,14 @@ label="View saved messages">
|
||||
<TR><TD COLSPAN=3 ABSHEIGHT=2 VALIGN=TOP ALIGN=LEFT BGCOLOR=515B84><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
|
||||
<TR><TD ABSWIDTH=6 >
|
||||
<TD ABSWIDTH=109 ABSHEIGHT=26>
|
||||
<TABLE HREF="wtv-mail:/listmail" CELLSPACING=0 CELLPADDING=0>
|
||||
<TR><TD ABSWIDTH=5>
|
||||
<TD ABSWIDTH=109 VALIGN=MIDDLE ALIGN=LEFT>
|
||||
<TABLE BGCOLOR=333B5A CELLSPACING=0 CELLPADDING=0>
|
||||
<TR><TD ABSHEIGHT=1>
|
||||
<TR><TD MAXLINES=1><SHADOW><FONT SIZERANGE=MEDIUM COLOR="E7CE4A">Mail List</FONT></SHADOW>
|
||||
</TABLE>
|
||||
</TABLE>
|
||||
<TABLE HREF="wtv-mail:/listmail" CELLSPACING=0 CELLPADDING=0>
|
||||
<TR><TD ABSWIDTH=5>
|
||||
<TD ABSWIDTH=109 VALIGN=MIDDLE ALIGN=LEFT>
|
||||
<TABLE BGCOLOR=333B5A CELLSPACING=0 CELLPADDING=0>
|
||||
<TR><TD ABSHEIGHT=1>
|
||||
<TR><TD MAXLINES=1><SHADOW><FONT SIZERANGE=MEDIUM COLOR="E7CE4A">Mail List</FONT></SHADOW>
|
||||
</TABLE>
|
||||
</TABLE>
|
||||
<TD ABSWIDTH=5>
|
||||
|
||||
<TR><TD COLSPAN=3 ABSHEIGHT=2 VALIGN=MIDDLE ALIGN=CENTER BGCOLOR=202434><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
|
||||
@@ -79,14 +341,14 @@ label="View saved messages">
|
||||
<TR><TD ABSWIDTH=6 >
|
||||
<TD ABSWIDTH=109 ABSHEIGHT=26 >
|
||||
|
||||
<TABLE href="/addressbook?action=edit&new_address=true&selected=new" CELLSPACING=0 CELLPADDING=0>
|
||||
<TR><TD ABSWIDTH=5>
|
||||
<TD ABSWIDTH=130 VALIGN=MIDDLE ALIGN=LEFT>
|
||||
<TABLE BGCOLOR=333B5A CELLSPACING=0 CELLPADDING=0>
|
||||
<TR><TD ABSHEIGHT=1>
|
||||
<TR><TD MAXLINES=1><SHADOW><FONT SIZERANGE=MEDIUM COLOR="E7CE4A">Add</FONT></SHADOW>
|
||||
</TABLE>
|
||||
</TABLE>
|
||||
<TABLE href="/addressbook?action=edit&new_address=true&selected=new" CELLSPACING=0 CELLPADDING=0>
|
||||
<TR><TD ABSWIDTH=5>
|
||||
<TD ABSWIDTH=130 VALIGN=MIDDLE ALIGN=LEFT>
|
||||
<TABLE BGCOLOR=333B5A CELLSPACING=0 CELLPADDING=0>
|
||||
<TR><TD ABSHEIGHT=1>
|
||||
<TR><TD MAXLINES=1><SHADOW><FONT SIZERANGE=MEDIUM COLOR="E7CE4A">Add</FONT></SHADOW>
|
||||
</TABLE>
|
||||
</TABLE>
|
||||
<TD ABSWIDTH=5>
|
||||
|
||||
<TR><TD COLSPAN=3 ABSHEIGHT=2 VALIGN=MIDDLE ALIGN=CENTER BGCOLOR=202434><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
|
||||
@@ -94,14 +356,14 @@ label="View saved messages">
|
||||
<TR><TD COLSPAN=3 ABSHEIGHT=2 VALIGN=TOP ALIGN=LEFT BGCOLOR=515B84><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
|
||||
<TR><TD ABSWIDTH=6 >
|
||||
<TD ABSWIDTH=109 ABSHEIGHT=26 >
|
||||
<TABLE href="JavaScript:alert('No idea what this goes to')" CELLSPACING=0 CELLPADDING=0>
|
||||
<TR><TD ABSWIDTH=5>
|
||||
<TD ABSWIDTH=130 VALIGN=MIDDLE ALIGN=LEFT>
|
||||
<TABLE BGCOLOR=333B5A CELLSPACING=0 CELLPADDING=0>
|
||||
<TR><TD ABSHEIGHT=1>
|
||||
<TR><TD MAXLINES=1><SHADOW><FONT SIZERANGE=MEDIUM COLOR="E7CE4A">Help</FONT></SHADOW>
|
||||
</TABLE>
|
||||
</TABLE>
|
||||
<TABLE href="JavaScript:alert('No idea what this goes to')" CELLSPACING=0 CELLPADDING=0>
|
||||
<TR><TD ABSWIDTH=5>
|
||||
<TD ABSWIDTH=130 VALIGN=MIDDLE ALIGN=LEFT>
|
||||
<TABLE BGCOLOR=333B5A 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=202434><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
|
||||
@@ -117,12 +379,14 @@ label="View saved messages">
|
||||
|
||||
<TABLE CELLSPACING=0 CELLPADDING=0>
|
||||
<TR><TD COLSPAN=3 HEIGHT=12VALIGN=TOP ALIGN=LEFT>
|
||||
<TR><TD COLSPAN=3 HEIGHT=35 VALIGN=TOP><FONT SIZE=+3 COLOR="E7CE4A"><B><SHADOW><BLACKFACE>Buddies for ${session_data.getSessionData("subscriber_username") || "You"}</BLACKFACE></SHADOW></B></FONT>
|
||||
<TR><TD COLSPAN=3 HEIGHT=35 VALIGN=TOP><FONT SIZE=+3 COLOR="E7CE4A"><B><SHADOW><BLACKFACE>Buddies for ${session_data.getSessionData("subscriber_username") || "You"
|
||||
}</BLACKFACE></SHADOW></B></FONT>
|
||||
<TR><TD COLSPAN=3 HEIGHT=25 VALIGN=TOP>
|
||||
<TABLE CELLSPACING=0 CELLPADDING=0>
|
||||
<TD WIDTH=400>Your address is ${session_data.getSessionData("messenger_email") || "unlinked"}@${session_data.getSessionData("messenger_domain") || "escargot.chat"}
|
||||
<TD ALIGN=RIGHT>
|
||||
</TABLE>
|
||||
<TABLE CELLSPACING=0 CELLPADDING=0>
|
||||
<TD WIDTH=400>Your address is ${session_data.getSessionData("messenger_email") || "unlinked"
|
||||
}@${session_data.getSessionData("messenger_domain") || "escargot.chat"}
|
||||
<TD ALIGN=RIGHT>
|
||||
</TABLE>
|
||||
</TABLE>
|
||||
|
||||
<TABLE CELLSPACING=0 CELLPADDING=0>
|
||||
@@ -145,21 +409,20 @@ var gUserHasNoFriends = (Blim.listLength("FL") < 0);
|
||||
var i;
|
||||
var listLength = Blim.listLength("FL");
|
||||
if (listLength == 0)
|
||||
{ document.write('<table border=0 cellspacing=3 cellpadding=0 ><tr>');
|
||||
document.write("<tr><td><font color=FFEFAD>You don't have any buddies yet. ");
|
||||
{document.write('<table border=0 cellspacing=3 cellpadding=0 ><tr>');
|
||||
document.write("<tr><td>You don't have any buddies yet. ");
|
||||
document.write('<p>To add a buddy or send an instant message, ');
|
||||
document.write('choose <b>Use MSN Messenger now</b>. ');
|
||||
document.write('You can also add buddies in your Address book.');
|
||||
document.write('press <b>OPTIONS</b> and choose <b>messenger</b> ');
|
||||
}
|
||||
else
|
||||
{ document.write("<table border=0 cellspacing=3 cellpadding=0><tr>");
|
||||
{document.write("<table border=0 cellspacing=3 cellpadding=0><tr>");
|
||||
var isFirst = true;
|
||||
for ( i=0 ; i < listLength; i++)
|
||||
{ var ID = Blim.listItem("FL", i);
|
||||
{var ID = Blim.listItem("FL", i);
|
||||
var humanName = Blim.getUmanName(ID);
|
||||
document.write('<tr><td maxlines=1><b><a ');
|
||||
if (isFirst)
|
||||
{ document.write(" id=firstFriend selected ");
|
||||
{document.write(" id=firstFriend selected ");
|
||||
isFirst = false;
|
||||
}
|
||||
document.write("<TD ABSWIDTH=150 HEIGHT=20 MAXLINES=1>");
|
||||
@@ -206,6 +469,336 @@ document.close();
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>`
|
||||
</HTML>`;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (action) {
|
||||
case "edit":
|
||||
case "editfromheader":
|
||||
const newaddress = request_headers.query.new_address
|
||||
headers = `200 OK`;
|
||||
data = `<html>
|
||||
<head>
|
||||
<DISPLAY fontsize=medium poweroffalert>
|
||||
<SAVEPANEL
|
||||
message="Save this address"
|
||||
action="client:submitform?name=addressform&submitname=action&submitvalue=Add"
|
||||
label="Save"
|
||||
>
|
||||
<SENDPANEL action="wtv-mail:/sendmail"
|
||||
message="Write a new message"
|
||||
label="Write"
|
||||
>
|
||||
<title>${(!newaddress) ? "Change" : "Add"} an e-mail address</title>
|
||||
</head>
|
||||
<print blackandwhite>
|
||||
<sidebar width=114 height=420 align=left>
|
||||
<table cellspacing=0 cellpadding=0 bgcolor=333b5a>
|
||||
<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 width=100%>
|
||||
<tr>
|
||||
<td abswidth=6>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1>
|
||||
<td align=center>
|
||||
<img src="wtv-mail:/ROMCache/WebTVLogoJewel.gif" width=87 height=67>
|
||||
</table>
|
||||
<td abswidth=5>
|
||||
<tr>
|
||||
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||
<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=515b84>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr>
|
||||
<td abswidth=6>
|
||||
<td abswidth=93 absheight=26>
|
||||
<table href="wtv-mail:/addressbook?camefrom=inbox"
|
||||
cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td abswidth=5>
|
||||
<td abswidth=90 valign=middle align=left>
|
||||
<table bgcolor=333b5a cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td absheight=1>
|
||||
<tr>
|
||||
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Addresses</font></shadow>
|
||||
</table>
|
||||
</table>
|
||||
`;
|
||||
if (!newaddress) {
|
||||
data += `<tr>
|
||||
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||
<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=515b84>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr>
|
||||
<td abswidth=6>
|
||||
<td abswidth=93 absheight=26>
|
||||
<table href="wtv-mail:/addressbook?camefrom=inbox&action=discard&id=${request_headers.query.id}"
|
||||
cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td abswidth=5>
|
||||
<td abswidth=90 valign=middle align=left>
|
||||
<table bgcolor=333b5a cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td absheight=1>
|
||||
<tr>
|
||||
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Discard</font></shadow>
|
||||
</table>
|
||||
</table>`;
|
||||
}
|
||||
data += `
|
||||
<td abswidth=5>
|
||||
<tr>
|
||||
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||
<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=515b84>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr>
|
||||
<td colspan=3 height=${(!newaddress) ? "236" : "267"} valign=bottom align=right >
|
||||
<img src="wtv-mail:/ROMCache/BannerMail.gif" width=50 height=96>
|
||||
<tr><td colspan=3 absheight=${(!newaddress) ? "67" : "36"}>
|
||||
</table>
|
||||
</sidebar>
|
||||
<body instructions="wtv-guide:/helpindex?title=Index_Mail"
|
||||
bgcolor="191919" text="42BD52" link="189CD6" vlink="189CD6"
|
||||
vspace=0
|
||||
hspace=0
|
||||
fontsize="medium">
|
||||
<table cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td height=16 valign=top align=left>
|
||||
<tr>
|
||||
<td height=39 valign=top>
|
||||
<font size=+1 color="E7CE4A">
|
||||
<blackface>
|
||||
<shadow>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=4>${(!newaddress) ? "Change" : "Add"} an e-mail address
|
||||
</shadow>
|
||||
</blackface>
|
||||
</font>
|
||||
</table>
|
||||
<table cellspacing=0 cellpadding=0 width=100%>
|
||||
<tr>
|
||||
<td rowspan=100 abswidth=15
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif">
|
||||
<td colspan=4 width=100%>
|
||||
`;
|
||||
if (!newaddress) {
|
||||
data += `To change the e-mail address, make your changes, then choose <b>Done</b>.<p>
|
||||
To remove the entry from your address book, choose <b>Discard</b>.`;
|
||||
} else {
|
||||
data += "Type a name and electronic mail address to add to your address book, then choose <B>Add</B>.";
|
||||
}
|
||||
data += `
|
||||
<td abswidth=10>
|
||||
<form action="/addressbook" name="addressform" method ="POST"><tr absheight=24>
|
||||
<td colspan=6><img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=24>
|
||||
<tr >
|
||||
<td>
|
||||
<td align=right valign=top>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=4><br>
|
||||
Name
|
||||
<td abswidth=10>
|
||||
<td valign=bottom colspan=3>
|
||||
<INPUT type="text" bgcolor=#202020
|
||||
cursor=#cc9933
|
||||
text="E7CE4A"
|
||||
font=proportional
|
||||
name="nickname"
|
||||
value="`;
|
||||
if (action == 'editfromheader') {
|
||||
data += request_headers.query.nickname
|
||||
} else if (action == 'edit' && request_headers.query.id) {
|
||||
data += address_book[request_headers.query.id].name
|
||||
}
|
||||
data += `"
|
||||
size=25
|
||||
maxlength=30
|
||||
autoactivate
|
||||
nosubmit>
|
||||
</tr>
|
||||
<tr absheight=12>
|
||||
<td colspan=6><img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=12>
|
||||
<tr>
|
||||
<td absheight=${(!newaddress) ? "94" : "144"}>
|
||||
<td align=right valign=top>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=4><br>
|
||||
Address
|
||||
<td abswidth=10>
|
||||
<td valign=top colspan=3>
|
||||
<TEXTAREA bgcolor=#202020
|
||||
cursor=#cc9933
|
||||
text="E7CE4A"
|
||||
font=proportional
|
||||
nosoftbreaks nohardbreaks
|
||||
name="address"
|
||||
value="`;
|
||||
if (action == 'editfromheader') {
|
||||
data += request_headers.query.address
|
||||
} else if (action == 'edit' && request_headers.query.id) {
|
||||
data += address_book[request_headers.query.id].address
|
||||
}
|
||||
data += `"
|
||||
size=25
|
||||
rows=1
|
||||
maxlength=1000
|
||||
autoactivate
|
||||
autoascii
|
||||
nosubmit
|
||||
growable></TEXTAREA>
|
||||
</tr>
|
||||
<tr absheight=25>
|
||||
<td colspan=6>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=4 height=25>
|
||||
<tr><td>
|
||||
<td colspan=4 absheight=2 align=center bgcolor=2B2B2B>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr><td>
|
||||
<td colspan=4 absheight=1 align=center>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr><td>
|
||||
<td colspan=4 absheight=2 align=center bgcolor=0D0D0D>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||
<tr absheight=5>
|
||||
<td colspan=6>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=4 height=5>
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<td colspan=2 align=right><FONT COLOR="#E7CE4A"><SHADOW>
|
||||
<INPUT TYPE=SUBMIT BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" NAME=done value="${(!newaddress) ? "Done" : "Add"}"
|
||||
USESTYLE WIDTH=103
|
||||
NOARGS>
|
||||
</SHADOW></FONT>
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=1>
|
||||
</table>
|
||||
<input type=hidden name="camefrom" value="inbox">
|
||||
<input type="hidden" name="action" value="${(!newaddress) ? "change" : "add"}">
|
||||
${(!newaddress) ? `<input type=hidden name="id" value="${request_headers.query.id}">` : ""}
|
||||
</form>
|
||||
</body></html>`;
|
||||
break;
|
||||
|
||||
case "add":
|
||||
var nameExists = false;
|
||||
var addrExists = false;
|
||||
// dumbass protection for making addresses look proper in the list
|
||||
var address = request_headers.query.address.split("@")[0];
|
||||
address += `@${minisrv_config.config.service_name}`;
|
||||
// sanity checks to make sure the user doesn't have duplicate names/addresses
|
||||
address_book.forEach(user => {
|
||||
if (user.name.includes(request_headers.query.nickname)) {
|
||||
nameExists = true;
|
||||
}
|
||||
});
|
||||
|
||||
address_book.forEach(user => {
|
||||
if (user.address.includes(address)) {
|
||||
addrExists = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (addrExists) {
|
||||
headers = `400 The address <blackface>${address}</blackface> already exists in your address book.`;
|
||||
} else if (nameExists) {
|
||||
headers = `400 The name <blackface>${request_headers.query.nickname}</blackface> already exists in your address book. Please choose a different name and try again.`;
|
||||
} else {
|
||||
const entry = {
|
||||
name: request_headers.query.nickname,
|
||||
address: address
|
||||
}
|
||||
address_book.push(entry)
|
||||
session_data.setSessionData("address_book", address_book.sort(function (a, b) { return a.name < b.name ? -1 : 1; }))
|
||||
headers = `302 Moved temporarily
|
||||
wtv-expire-all: wtv-mail:/addressbook
|
||||
wtv-expire: wtv-mail:/addresslist
|
||||
Location: wtv-mail:/addressbook`;
|
||||
}
|
||||
break;
|
||||
|
||||
case "change":
|
||||
var address = request_headers.query.address
|
||||
var nickname = request_headers.query.nickname
|
||||
if (!address) {
|
||||
address = address_book[request_headers.query.id].address
|
||||
}
|
||||
if (!nickname) {
|
||||
nickname = address_book[request_headers.query.id].nickname
|
||||
}
|
||||
// dumbass protection for making addresses look proper in the list
|
||||
address = address.split("@")[0];
|
||||
address += `@${minisrv_config.config.service_name}`;
|
||||
var nameExists = false;
|
||||
var addrExists = false;
|
||||
if (address_book.length > 1) {
|
||||
var otheraddrs = address_book.slice(0)
|
||||
otheraddrs.splice(request_headers.query.id, 1)
|
||||
// sanity checks to make sure the user doesn't have duplicate names/addresses
|
||||
otheraddrs.forEach(user => {
|
||||
if (user.name.includes(nickname)) {
|
||||
nameExists = true;
|
||||
}
|
||||
});
|
||||
|
||||
otheraddrs.forEach(user => {
|
||||
if (user.address.includes(address)) {
|
||||
addrExists = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (addrExists) {
|
||||
headers = `400 The address <blackface>${address}</blackface> already exists in your address book.`;
|
||||
} else if (nameExists) {
|
||||
headers = `400 The name <blackface>${nickname}</blackface> already exists in your address book. Please choose a different name and try again.`;
|
||||
} else {
|
||||
const entry = {
|
||||
name: nickname,
|
||||
address: address
|
||||
}
|
||||
address_book[request_headers.query.id] = entry
|
||||
session_data.setSessionData("address_book", address_book.sort(function (a, b) { return a.name < b.name ? -1 : 1; }))
|
||||
headers = `302 Moved temporarily
|
||||
wtv-expire-all: wtv-mail:/addressbook
|
||||
wtv-expire: wtv-mail:/addresslist
|
||||
Location: wtv-mail:/addressbook`;
|
||||
}
|
||||
break;
|
||||
|
||||
case "discard":
|
||||
if (address_book.length == 1) {
|
||||
address_book = []
|
||||
} else {
|
||||
address_book.splice(request_headers.query.id, 1)
|
||||
}
|
||||
session_data.setSessionData("address_book", address_book.sort(function (a, b) { return a.name < b.name ? -1 : 1; }))
|
||||
headers = `302 Moved temporarily
|
||||
wtv-expire-all: wtv-mail:/addressbook
|
||||
wtv-expire: wtv-mail:/addresslist
|
||||
Location: wtv-mail:/addressbook`;
|
||||
break;
|
||||
|
||||
default:
|
||||
headers = `302 Moved temporarily
|
||||
Location: wtv-mail:/addressbook`;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
var minisrv_service_file = true;
|
||||
|
||||
headers = `200 OK
|
||||
Content-Type: x-wtv-addresses`;
|
||||
|
||||
const address_book = session_data.getSessionData("address_book")
|
||||
|
||||
if (session_data.getSessionData("address_book") != null) {
|
||||
data = ``
|
||||
for (let i = 0; i < address_book.length; i++) {
|
||||
data += address_book[i].name + '\0' + address_book[i].address + '\0'
|
||||
}
|
||||
} else {
|
||||
session_data.setSessionData("address_book", [])
|
||||
}
|
||||
@@ -143,7 +143,7 @@ label="View saved e-mail messages">
|
||||
<tr>
|
||||
<td width=10 height=26>
|
||||
<td width=89 valign=middle>
|
||||
<table cellspacing=0 cellpadding=0 href="${notImplementedAlert}"
|
||||
<table cellspacing=0 cellpadding=0 href="wtv-mail:/addressbook"
|
||||
>
|
||||
<tr>
|
||||
<td height=1>
|
||||
@@ -282,6 +282,7 @@ ${username}@${minisrv_config.config.service_name}
|
||||
Object.keys(message_list).forEach(function (k) {
|
||||
var message = message_list[k];
|
||||
if (typeof message.subject == "object" && message.subject) message.subject = wtvshared.decodeBufferText(message.subject);
|
||||
message.known_sender = session_data.isAddressInAddressBook(message.from_addr);
|
||||
var message_font_open = "<font color=#7A9FCC>";
|
||||
var message_font_close = "</font>";
|
||||
if (message.unread) {
|
||||
|
||||
@@ -42,10 +42,13 @@ Content-type: text/html`;
|
||||
|
||||
|
||||
var message_colors = null;
|
||||
|
||||
if (message.body.indexOf("<body")) {
|
||||
var default_colors = session_data.mailstore.defaultColors;
|
||||
var message_colors = session_data.mailstore.getSignatureColors(message.body);
|
||||
if (message.body) {
|
||||
if (message.body.indexOf("<body")) {
|
||||
var default_colors = session_data.mailstore.defaultColors;
|
||||
var message_colors = session_data.mailstore.getSignatureColors(message.body);
|
||||
}
|
||||
} else {
|
||||
message_colors = session_data.mailstore.defaultColors;
|
||||
}
|
||||
if (message.signature) message_colors = session_data.mailstore.getSignatureColors(message.signature);
|
||||
|
||||
@@ -282,13 +285,14 @@ ${(message.subject) ? wtvshared.htmlEntitize(message.subject) : '(No subject)'}
|
||||
if (typeof message.body === "object" && message.body) {
|
||||
message.body = wtvshared.decodeBufferText(message.body);
|
||||
}
|
||||
if (message.body) message.body = message.body.replace(/\n/g, "<br><br>");
|
||||
if (message.body.indexOf("<html>") >= 0) {
|
||||
message.allow_html = true;
|
||||
if (message.body) {
|
||||
message.body = message.body.replace(/\n/g, "<br><br>");
|
||||
if (message.body.indexOf("<html>") >= 0) {
|
||||
message.allow_html = true;
|
||||
}
|
||||
data += `${(message.allow_html) ? wtvshared.sanitizeSignature(message.body) : wtvshared.htmlEntitize(message.body, true)}`
|
||||
}
|
||||
data += `${(message.allow_html) ? wtvshared.sanitizeSignature(message.body) : wtvshared.htmlEntitize(message.body, true)}
|
||||
<br>
|
||||
<br>`;
|
||||
data += "<br><br>";
|
||||
if (message.signature) {
|
||||
data += wtvshared.sanitizeSignature(message.signature);
|
||||
}
|
||||
@@ -296,8 +300,7 @@ ${(message.subject) ? wtvshared.htmlEntitize(message.subject) : '(No subject)'}
|
||||
`;
|
||||
if (Array.isArray(message.attachments)) {
|
||||
message.attachments.forEach((v, k) => {
|
||||
if (v) {
|
||||
console.log("*****************", v['Content-Type']);
|
||||
if (v) {
|
||||
switch (v['Content-Type']) {
|
||||
case "image/jpeg":
|
||||
data += `<img border=2 src="wtv-mail:/get-attachment?message_id=${messageid}&attachment_id=${k}&wtv-title=Video%20Snapshot" width="380" height="290"><br><br>`;
|
||||
|
||||
@@ -8,26 +8,23 @@ var wtvr = new WTVRegister(minisrv_config);
|
||||
var namerand = Math.floor(Math.random() * 100000);
|
||||
var nickname = (minisrv_config.config.service_name + '_' + namerand)
|
||||
var human_name = nickname;
|
||||
var hasJS = session_data.hasCap("client-can-do-javascript");
|
||||
if (hasJS) {
|
||||
var form_data = `<script>butt('Quick Reg','speedyreg',130,'button','action="ValidateAgreement?registering=true&subscriber_name=${human_name}&subscriber_username=${nickname}"');`;
|
||||
if (minisrv_config.config.allow_guests) form_data += `butt('Sign in as Guest', 'noreg', 170, 'button', 'action="BeMyGuest"')`;
|
||||
form_data += '</script>';
|
||||
} else {
|
||||
var form_data = `<input type=button action="ValidateAgreement?registering=true&subscriber_name=${human_name}&subscriber_username=${nickname}" text="e7ce4a" Value="Quick Reg" name="speedyreg" borderimage="file://ROM/Borders/ButtonBorder2.bif" width=130>`;
|
||||
if (minisrv_config.config.allow_guests) form_data += `<input type=button text="e7ce4a" action="BeMyGuest" Value="Sign in as Guest" name="noreg" borderimage="file://ROM/Borders/ButtonBorder2.bif" width=170 >`;
|
||||
}
|
||||
var hasJS = session_data.hasCap("client-can-do-javascript") && parseInt(session_data.get('wtv-system-version')) >= 2000;
|
||||
var form_data = "";
|
||||
var main_data = `<form action="ValidateAgreement"
|
||||
ENCTYPE="x-www-form-encoded" METHOD="POST">
|
||||
<input type=hidden name=registering value="true">
|
||||
Welcome to the ${minisrv_config.config.service_name} Mini Service, operated by ${minisrv_config.config.service_owner}.
|
||||
The next screens will lead you through a quick setup process for using this service.<p> Press the "Continue" button below to begin setup.<p>`;
|
||||
|
||||
if (hasJS) {
|
||||
form_data += `<script>butt('Continue','Continue',110)</script>`;
|
||||
form_data = `<script>butt('Quick Reg','speedyreg',130,'button','action="ValidateAgreement?registering=true&subscriber_name=${human_name}&subscriber_username=${nickname}"');`;
|
||||
if (minisrv_config.config.allow_guests) form_data += `butt('Sign in as Guest', 'noreg', 170, 'button', 'action="BeMyGuest"')`;
|
||||
form_data += `butt('Continue','Continue',110)</script>`;
|
||||
} else {
|
||||
form_data = `<input type=button action="ValidateAgreement?registering=true&subscriber_name=${human_name}&subscriber_username=${nickname}" text="e7ce4a" Value="Quick Reg" name="speedyreg" borderimage="file://ROM/Borders/ButtonBorder2.bif" width=130>`;
|
||||
if (minisrv_config.config.allow_guests) form_data += `<input type=button text="e7ce4a" action="BeMyGuest" Value="Sign in as Guest" name="noreg" borderimage="file://ROM/Borders/ButtonBorder2.bif" width=170 >`;
|
||||
form_data += `<input type=submit Value=Continue name="Continue" text="#e7ce4a" borderimage="file://ROM/Borders/ButtonBorder2.bif" width=110 selected>`;
|
||||
}
|
||||
|
||||
form_data += `</form>`;
|
||||
|
||||
data = wtvr.getHTMLTemplate("Welcome to " + minisrv_config.config.service_name, main_data, form_data, hasJS);
|
||||
@@ -24,10 +24,11 @@ if (isNaN(start_time)) {
|
||||
var image_size = fs.statSync(image_filename).size
|
||||
var image_size_kb = parseFloat(image_size / 1024).toFixed(3);
|
||||
var throughput = parseFloat((image_size / download_time) * 1024).toFixed(0);
|
||||
var throughput_bps = parseInt(throughput * 8)
|
||||
data += `
|
||||
<table>
|
||||
<tr>
|
||||
<td height=20>
|
||||
<td height=5>
|
||||
<tr>
|
||||
<td valign=top align=right width=200><shadow>POP Number:</shadow>
|
||||
<td width=10>
|
||||
@@ -61,18 +62,21 @@ if (isNaN(start_time)) {
|
||||
<tr>
|
||||
<td valign=top align=right><shadow>Throughput:</shadow>
|
||||
<td width=10>
|
||||
<td valign=top>${throughput} bytes/sec
|
||||
<td valign=top>${throughput} bytes/sec (${throughput_bps} bps)
|
||||
|
||||
|
||||
</table>
|
||||
`;
|
||||
}
|
||||
data += `
|
||||
</table>
|
||||
<p>
|
||||
<p>
|
||||
<a selected href="wtv-tricks:/benchmark">Re-Test</a>
|
||||
<table>
|
||||
<tr>
|
||||
<td width=120>
|
||||
<td><a selected href="wtv-tricks:/benchmark">Re-Test</a>
|
||||
<td width=30>
|
||||
<a href="wtv-tricks:/tricks">Back to Tricks</a>
|
||||
|
||||
<td><a href="wtv-tricks:/tricks">Back to Tricks</a>
|
||||
</table>
|
||||
</CENTER>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -21,14 +21,7 @@ tricks = [
|
||||
["client:ResetNVAndPowerOff", "Blast NVRAM"],
|
||||
["wtv-tricks:/charmap", "Character Map"],
|
||||
["wtv-tricks:/cSetup", "Connect Setup"],
|
||||
["wtv-tricks:/benchmark", "Speed Test"],
|
||||
["", ""],
|
||||
["", ""],
|
||||
["", ""],
|
||||
["", ""],
|
||||
["", ""],
|
||||
["", ""],
|
||||
["", ""],
|
||||
["wtv-tricks:/benchmark", "Speed Test"]
|
||||
]
|
||||
// add these at the bottom
|
||||
tricks.push((session_data.getSessionData("registered")) ? ["wtv-tricks:/unregister", "Unregister This Box"] : ["wtv-tricks:/register", "Register This Box"]); // reg/unreg
|
||||
@@ -39,24 +32,23 @@ data = `<html>
|
||||
<script src=/ROMCache/h.js></script><script src=/ROMCache/n.js></script><script>
|
||||
head('${minisrv_config.config.service_name} Tricks')</script>
|
||||
<table cellspacing=0 cellpadding=0><tr><td abswidth=10> <td colspan=3>
|
||||
<br>
|
||||
<table>`;
|
||||
<table><tc><td width=50> </td></tc><tc><td><table>`;
|
||||
|
||||
for (i = 0; i < tricks.length; i += 2) {
|
||||
data += `<tr>
|
||||
<td colspan=3 height=6>
|
||||
<tr>
|
||||
<td>${(tricks[i][0] != "") ? `<a href="${tricks[i][0]}">${tricks[i][1]}</a>` : `<!-- TODO --> `}
|
||||
<td>${(tricks[i][0] != "") ? `€ <a href="${tricks[i][0]}">${tricks[i][1]}</a>` : `<!-- TODO --> `}
|
||||
<td width=25>
|
||||
<td>`
|
||||
if (i + 1 < tricks.length) {
|
||||
data += (tricks[i + 1][0] != "") ? `<a href="${tricks[i + 1][0]}">${tricks[i + 1][1]}</a>` : `<!-- TODO --> `
|
||||
data += (tricks[i + 1][0] != "") ? `€ <a href="${tricks[i + 1][0]}">${tricks[i + 1][1]}</a>` : `<!-- TODO --> `
|
||||
} else {
|
||||
// require even number of tricks
|
||||
data += "<!-- TODO --> "
|
||||
}
|
||||
}
|
||||
data += `</table>
|
||||
data += `</table></td></tc></table>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user