- numerous bug fixes
 - wtv-mail system
 - user account updates
 - viewergen alpha (experimental webtv viewer patcher on pc_service)
 - implement wtv-favorites with huge help from @JarHead4
 - add wtv-ticket store api
 - Bump vm2 from 3.9.5 to 3.9.7 in /zefie_wtvp_minisrv
 - fix bf0app default rom
 - Add wtv-1800 service to wtv-1800:/noflash
 - handle webtvism:
   - allow get/post variables to be the same name multiple times
   - rather than overwrite, the server will now change the variable from a string to an array.
 - Rewrite script processing a bit
   - Instead of using eval() we now use a proper VM Context
   - As a result, any scripting errors will now give a more useful filename and line number.
   - However, some things may break, if they are dependant on variables we are not allowing in the context.
 - BREAKING CHANGES:
   - `ssid_sessions[socket.ssid]` is now `session_data`
   - `require` is no longer allowed in user scripts
 - add star service
 - change how we handle modules for services in the VM
 - fixed wtv-disk:/sync always failed the first time
 - implement production-like wtv-star handling (when a service port becomes unavailable, it requests the url over the wtv-star port to show an error page)
 - renamed WTVDownloadList.js to WTVDisk.js
 - a bit more work on WTVNews (created class)
 - probably more stuff I can't remember
This commit is contained in:
zefie
2021-11-10 23:38:15 -05:00
parent 4544e815cb
commit 1165b245ce
1411 changed files with 31570 additions and 2198 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -0,0 +1,135 @@
var minisrv_service_file = true;
session_data.loadSessionData();
if (session_data.user_id != 0) {
var errpage = doErrorPage(400, "You are not authorized to edit the primary account.");
headers = errpage[0];
data = errpage[1];
} else {
headers = `200 OK
Connection: Keep-Alive
wtv-expire-all: wtv-setup:/accounts
Content-Type: text/html`
data = `<HTML>
<HTML>
<HEAD>
<TITLE>
Users setup
</TITLE>
<DISPLAY >
</HEAD>
<sidebar width=110> <table cellspacing=0 cellpadding=0 BGCOLOR="30364D">
<tr>
<td colspan=3 abswidth=104 absheight=4>
<td rowspan=99 width=6 absheight=420 valign=top align=left>
<img src="ROMCache/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="1C1E28">
<img src="ROMCache/Spacer.gif" width=1 height=1>
<tr><td abswidth=104 absheight=1 valign=top align=left>
<tr><td abswidth=104 absheight=2 valign=top align=left bgcolor="4D5573">
<img src="ROMCache/Spacer.gif" width=1 height=1>
</table>
<tr><td absheight=37>
<tr><td absheight=263 align=right colspan=3>
<img src="ROMCache/AccountBanner.gif" width=53 height=263>
<tr><td absheight=41>
</table>
</sidebar>
<BODY NOHTILEBG BGCOLOR="#191919" TEXT="#42CC55" LINK="36d5ff" VLINK="36d5ff" 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>
${minisrv_config.config.service_name} users
</table>
<td abswidth=20>
<TR>
<td>
<td WIDTH=198 HEIGHT=244 VALIGN=top ALIGN=left>
<FONT COLOR="44cc55"><B>
Subscriber:
<P>`;
var accounts = session_data.listPrimaryAccountUsers();
var num_accounts = session_data.getNumberOfUserAccounts();
if (num_accounts > 1) data += "Additional users:</B></FONT>";
data += "<TD WIDTH=20><TD WIDTH=198 VALIGN=top ALIGN=left>";
data += `<FORM>
<FONT COLOR="189CD6"><B>
<A HREF="wtv-setup:/edit-user-begin?user_id=0">${accounts.subscriber.subscriber_username}</A>
</B></FONT>
<P>`;
if (num_accounts > 1) {
delete accounts.subscriber;
for (const [key, value] of Object.entries(accounts)) {
data += `<FONT COLOR="189CD6"><B>
<A HREF="wtv-setup:/edit-user-begin?user_id=${key.replace("user", '')}">${value.subscriber_username}</A>
</B></FONT><BR>
`;
};
}
data += `
<TR>
<TD>
<TD COLSPAN=4 HEIGHT=4 VALIGN=top ALIGN=left>
<tr>
<TD>
<td colspan=4 height=2 valign=middle align=center bgcolor="2B2B2B">
<img src="ROMCache/Spacer.gif" width=436 height=1>
<tr>
<TD>
<td colspan=4 height=1 valign=top align=left>
<tr>
<TD>
<td colspan=4 height=2 valign=top align=left bgcolor="0D0D0D">
<img src="ROMCache/Spacer.gif" width=436 height=1>
<TR>
<TD>
<TD COLSPAN=4 HEIGHT=4 VALIGN=top ALIGN=left>
<TR>
<TD>
<TD COLSPAN=3 VALIGN=top ALIGN=right>
<FONT COLOR="#E7CE4A" SIZE=-1><SHADOW>
<INPUT action="/remove-users?user-count=x"
name="RemoveUser" value="Remove User" WIDTH=140 ${(num_accounts > 1) ? 'USESTYLE' : 'disabled="disabled" text=gray' }
TYPE=SUBMIT BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" NAME="Button1" WIDTH=103>
<IMG SRC="ROMCache/Spacer.gif" WIDTH=4 HEIGHT=1>
<INPUT action="/add-user?user_count=${num_accounts}"
name="AddUser" value="Add User" WIDTH=120 ${(num_accounts >= minisrv_config.config.user_accounts.max_users_per_account) ? 'disabled="disabled" text=gray' : 'USESTYLE'}
TYPE=SUBMIT BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" NAME="Button2" WIDTH=103>
<IMG SRC="ROMCache/Spacer.gif" WIDTH=4 HEIGHT=1>
<INPUT action="wtv-setup:/serve-billing-overview?"
name="Done"
value="Done"
WIDTH=120
selected
TYPE=SUBMIT BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" NAME="Button3" USESTYLE WIDTH=103>
</SHADOW></FONT></FORM>
<TD>
</TABLE>
</BODY>
</HTML>
`;
}

View File

@@ -0,0 +1,137 @@
var minisrv_service_file = true;
var errpage;
if (session_data.user_id != 0) errpage = wtvshared.doErrorPage(400, "You are not authorized to add users to this account.");
else if (session_data.getNumberOfUserAccounts() > minisrv_config.config.user_accounts.max_users_per_account) errpage = wtvshared.doErrorPage(400, "You are not authorized to add more than " + minisrv_config.config.user_accounts.max_users_per_account + ` account${minisrv_config.config.user_accounts.max_users_per_account > 1 ? 's' : ''}.`);
if (errpage) {
headers = errpage[0];
data = errpage[1];
} else {
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`
data = `<HTML>
<HTML>
<HEAD>
<TITLE>
Adding a User
</TITLE>
<DISPLAY nosave
noscroll>
</HEAD>
<sidebar width=110> <table cellspacing=0 cellpadding=0 BGCOLOR="30364D">
<tr>
<td colspan=3 abswidth=104 absheight=4>
<td rowspan=99 width=6 absheight=420 valign=top align=left>
<img src="wtv-home:/ROMCache/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="1C1E28">
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr><td abswidth=104 absheight=1 valign=top align=left>
<tr><td abswidth=104 absheight=2 valign=top align=left bgcolor="4D5573">
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
</table>
<tr><td absheight=37>
<tr><td absheight=263 align=right colspan=3>
<img src="ROMCache/AccountBanner.gif" width=53 height=263>
<tr><td absheight=41>
</table>
</sidebar>
<BODY BGCOLOR="#191919" TEXT="#44cc55" LINK="189CD6" VLINK="189CD6" HSPACE=0 VSPACE=0 FONTSIZE="large"
>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=14>
<td abswidth=416 absheight=80 valign=center>
<font size="+2" color="E7CE4A"><blackface><shadow>
User's Internet name
<td abswidth=20>
<tr>
<td>
<td absheight=244 valign=top align=left>
<form action="wtv-setup:/add-user-password">
<INPUT TYPE="hidden" NAME="display_name" VALUE="${request_headers.query.display_name || ''}">
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td align=left valign=top abswidth=198>
<table cellspacing=0 cellpadding=0>
<tr>
<td align=left>
Type an Internet<br>
name`;
if (request_headers.query.display_name) {
data += ` for <b>${request_headers.query.display_name}</b>.`
} else {
data += "."
} data += `
<p>Internet names can<br>
contain letters and<br>
numbers, but no<br>
spaces.
</a>
</table>
</td>
<td align=left valign=top width=6>
</td>
<td align=left valign=top abswidth=210>
<table cellspacing=0 cellpadding=0>
<tr>
<td colspan=3 align=left>
Internet name<br>
<INPUT noSubmit name="user_name" id="user_name" Value="${request_headers.query.display_name || ''}"
bgcolor=#444444 text=#ffdd33 cursor=#cc9933
TYPE="text" ASCIIONLY
SIZE="18"
MAXLENGTH="18">
<tr>
<td height=6>
<tr>
<td colspan=3 align=left>
</a>
</table>
</table>
<td>
<tr>
<td absheight=7>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="2B2B2B">
<img src="wtv-home:/ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=1>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="0D0D0D">
<img src="wtv-home:/ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=4>
</table>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=430 valign=top align=right>
<font color="#E7CE4A" size=-1><shadow>
<input
selected
type=submit borderimage="file://ROM/Borders/ButtonBorder2.bif"
value=Continue name="Continue" usestyle width=103>
</shadow></font></form>
<td abswidth=20>
</table>
</body>
</html>
`;
}

View File

@@ -0,0 +1,150 @@
var minisrv_service_file = true;
var errpage = null;
const WTVRegister = require(classPath + "/WTVRegister.js")
const wtvr = new WTVRegister(minisrv_config, SessionStore);
if (session_data.user_id != 0) errpage = wtvshared.doErrorPage(400, "You are not authorized to add users to this account.");
else if (!request_headers.query.user_name) errpage = doErrorPage(400, "Please enter a username.");
else if (request_headers.query.user_name.length < minisrv_config.config.user_accounts.min_username_length) errpage = wtvshared.doErrorPage(400, "Please choose a username with <b>" + minisrv_config.config.user_accounts.min_username_length + "</b> or more characters.");
else if (request_headers.query.user_name.length > minisrv_config.config.user_accounts.max_username_length) errpage = wtvshared.doErrorPage(400, "Please choose a username with <b>" + minisrv_config.config.user_accounts.max_username_length + "</b> or less characters.");
else if (!wtvr.checkUsernameSanity(request_headers.query.user_name)) errpage = wtvshared.doErrorPage(400, "The username you have chosen contains invalid characters. Please choose a username with only <b>letters</b>, <b>numbers</b>, <b>_</b> or <b>-</b>. Also, please be sure your username begins with a letter.");
else if (!wtvr.checkUsernameAvailable(request_headers.query.user_name)) errpage = wtvshared.doErrorPage(400, "The username you have selected is already in use. Please select another username.");
else if (session_data.getNumberOfUserAccounts() > minisrv_config.config.user_accounts.max_users_per_account) errpage = wtvshared.doErrorPage(400, "You are not authorized to add more than " + minisrv_config.config.user_accounts.max_users_per_account + ` account${minisrv_config.config.user_accounts.max_users_per_account > 1 ? 's' : ''}.`);
if (errpage) {
headers = errpage[0];
data = errpage[1];
} else {
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`
data = `<HTML>
<HTML>
<HEAD>
<TITLE>
Adding a User
</TITLE>
<DISPLAY nosave
noscroll>
</HEAD>
<sidebar width=110> <table cellspacing=0 cellpadding=0 BGCOLOR="30364D">
<tr>
<td colspan=3 abswidth=104 absheight=4>
<td rowspan=99 width=6 absheight=420 valign=top align=left>
<img src="ROMCache/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="1C1E28">
<img src="ROMCache/Spacer.gif" width=1 height=1>
<tr><td abswidth=104 absheight=1 valign=top align=left>
<tr><td abswidth=104 absheight=2 valign=top align=left bgcolor="4D5573">
<img src="ROMCache/Spacer.gif" width=1 height=1>
</table>
<tr><td absheight=37>
<tr><td absheight=263 align=right colspan=3>
<img src="ROMCache/AccountBanner.gif" width=53 height=263>
<tr><td absheight=41>
</table>
</sidebar>
<BODY BGCOLOR="#191919" TEXT="#44cc55" LINK="189CD6" VLINK="189CD6" HSPACE=0 VSPACE=0 FONTSIZE="large"
>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=14>
<td abswidth=416 absheight=80 valign=center>
<font size="+2" color="E7CE4A"><blackface><shadow>
Optional password
<td abswidth=20>
<tr>
<td>
<td absheight=244 valign=top align=left>
<form action="wtv-setup:/validate-add-user">
<INPUT TYPE="hidden" NAME="display_name" VALUE="${request_headers.query.display_name}">
<INPUT TYPE="hidden" NAME="user_name" VALUE="${request_headers.query.user_name}">
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td align=left valign=top abswidth=198>
<table cellspacing=0 cellpadding=0>
<tr>
<td align=left>
Type an optional<br>
password from ${minisrv_config.config.passwords.min_length} to
<br>${minisrv_config.config.passwords.max_length} characters long.
<p>You'll need to type<br>
the password<br>
Whenever you switch to <b>${request_headers.query.user_name}</b>.<br>
<p>Leave the spaces<br>
blank if you don't<br>
want a password.
</a>
</table>
</td>
<td align=left valign=top width=6>
</td>
<td align=left valign=top abswidth=210>
<table cellspacing=0 cellpadding=0>
<tr>
<td colspan=3 align=left>
Password<br>
<INPUT noSubmit name="user_password" id="user_password" Value=""
bgcolor=#444444 text=#ffdd33 cursor=#cc9933
TYPE="password" ASCIIONLY
SIZE="${minisrv_config.config.passwords.form_size}"
MAXLENGTH="${minisrv_config.config.passwords.max_length}">
<tr>
<td height=6>
<tr>
<td colspan=3 align=left>
<br>Type again to confirm<br>
<INPUT noSubmit name="user_password2" id="user_password2" Value=""
bgcolor=#444444 text=#ffdd33 cursor=#cc9933
TYPE="password" ASCIIONLY
SIZE="${minisrv_config.config.passwords.form_size}"
MAXLENGTH="${minisrv_config.config.passwords.max_length}">
</table>
</table>
<td>
<tr>
<td absheight=7>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="2B2B2B">
<img src="ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=1>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="0D0D0D">
<img src="ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=4>
</table>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=430 valign=top align=right>
<font color="#E7CE4A" size=-1><shadow>
<input
selected
type=submit borderimage="file://ROM/Borders/ButtonBorder2.bif"
value=Continue name="Continue" usestyle width=103>
</shadow></font></form>
<td abswidth=20>
</table>
</body>
</html>
`;
}

View File

@@ -0,0 +1,135 @@
var minisrv_service_file = true;
var errpage;
if (Object.keys(session_data.listPrimaryAccountUsers()).length >= minisrv_config.config.user_accounts.max_users_per_account) {
errpage = wtvshared.doErrorPage(400, "You are not authorized to add more than " + minisrv_config.config.user_accounts.max_users_per_account + ` account${minisrv_config.config.user_accounts.max_users_per_account > 1 ? 's' : ''}.`);
}
else if (session_data.user_id != 0) errpage = wtvshared.doErrorPage(400, "You are not authorized to add users to this account.");
if (errpage) {
headers = errpage[0];
data = errpage[1];
} else {
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`
data = `<HTML>
<HTML>
<HEAD>
<TITLE>
Adding person's name
</TITLE>
<DISPLAY nosave
noscroll>
</HEAD>
<sidebar width=110> <table cellspacing=0 cellpadding=0 BGCOLOR="30364D">
<tr>
<td colspan=3 abswidth=104 absheight=4>
<td rowspan=99 width=6 absheight=420 valign=top align=left>
<img src="wtv-home:/ROMCache/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="1C1E28">
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr><td abswidth=104 absheight=1 valign=top align=left>
<tr><td abswidth=104 absheight=2 valign=top align=left bgcolor="4D5573">
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
</table>
<tr><td absheight=37>
<tr><td absheight=263 align=right colspan=3>
<img src="ROMCache/AccountBanner.gif" width=53 height=263>
<tr><td absheight=41>
</table>
</sidebar>
<BODY BGCOLOR="#191919" TEXT="#44cc55" LINK="189CD6" VLINK="189CD6" HSPACE=0 VSPACE=0 FONTSIZE="large"
>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=14>
<td abswidth=416 absheight=80 valign=center>
<font size="+2" color="E7CE4A"><blackface><shadow>
User's name
<td abswidth=20>
<tr>
<td>
<td absheight=244 valign=top align=left>
<form
action="wtv-setup:/add-user-name"
>
<P>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td align=left valign=top abswidth=198>
<table cellspacing=0 cellpadding=0>
<tr>
<td align=left>
Type the person's<br>
display name<br>
here. They are<br>
included when the<br>
user sends mail.
<p>Leave the space<br>
blank if you don't<br>
want to type this<br>
person's name.
</a>
</table>
</td>
<td align=left valign=top width=6>
</td>
<td align=left valign=top abswidth=210>
<table cellspacing=0 cellpadding=0>
<tr>
<td colspan=3 align=left>
Display name<br>
<INPUT noSubmit name="display_name" id="display_name" Value=""
bgcolor=#444444 text=#ffdd33 cursor=#cc9933
TYPE="text" ASCIIONLY
SIZE="18"
MAXLENGTH="18">
</a>
</table>
</table>
<td>
<tr>
<td absheight=7>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="2B2B2B">
<img src="wtv-home:/ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=1>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="0D0D0D">
<img src="wtv-home:/ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=4>
</table>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=430 valign=top align=right>
<font color="#E7CE4A" size=-1><shadow>
<input
selected
type=submit borderimage="file://ROM/Borders/ButtonBorder2.bif"
value=Continue name="Continue" usestyle width=103>
</shadow></font></form>
<td abswidth=20>
</table>
</body>
</html>
`;
}

View File

@@ -1,7 +1,6 @@
var minisrv_service_file = true;
var WTVBGMusic = require("./WTVBGMusic.js");
var wtvbgm = new WTVBGMusic(minisrv_config, ssid_sessions[socket.ssid])
const wtvbgm = new WTVBGMusic(minisrv_config, session_data);
var catsListed = 0;
var categories = wtvbgm.getCategoryList();

View File

@@ -0,0 +1,166 @@
var minisrv_service_file = true;
session_data.loadSessionData();
var user_id = (request_headers.query.user_id) ? request_headers.query.user_id : session_data.user_id;
// security
if (session_data.user_id != 0 && session_data.user_id != user_id) {
user_id = null; // force unset
var errpage = wtvshared.doErrorPage(400, "You are not authorized to change the selected user's password.");
headers = errpage[0];
data = errpage[1];
}
if (user_id != null) {
var userSession = null;
if (session_data.user_id == request_headers.query.user_id) userSession = session_data;
else {
userSession = new WTVClientSessionData(minisrv_config, socket.ssid);
userSession.user_id = user_id;
}
if (!userSession.loadSessionData()) {
var errpage = wtvshared.doErrorPage(400, "Invalid user ID.");
headers = errpage[0];
data = errpage[1];
}
else {
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`;
data = `
<HTML>
<HEAD>
<TITLE>
Change ${(user_id == session_data.user_id) ? 'your' : 'user'} password
</TITLE>
<DISPLAY nosave
noscroll>
</HEAD>
<sidebar width=110> <table cellspacing=0 cellpadding=0 BGCOLOR="30364D">
<tr>
<td colspan=3 abswidth=104 absheight=4>
<td rowspan=99 width=6 absheight=420 valign=top align=left>
<img src="wtv-home:/ROMCache/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="1C1E28">
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr><td abswidth=104 absheight=1 valign=top align=left>
<tr><td abswidth=104 absheight=2 valign=top align=left bgcolor="4D5573">
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
</table>
<tr><td absheight=37>
<tr><td absheight=263 align=right colspan=3>
<img src="ROMCache/AccountBanner.gif" width=53 height=263>
<tr><td absheight=41>
</table>
</sidebar>
<BODY BGCOLOR="#191919" TEXT="#44cc55" LINK="189CD6" VLINK="189CD6" HSPACE=0 VSPACE=0 FONTSIZE="large"
>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=14>
<td abswidth=416 absheight=80 valign=center>
<font size="+2" color="E7CE4A"><blackface><shadow>
Change ${(user_id == session_data.user_id) ? 'your' : 'user'} password
<td abswidth=20>
<tr>
<td>
<td absheight=244 valign=top align=left>
<form
action="wtv-setup:/validate-change-password"
>
<P>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td align=left valign=top abswidth=198>
<table cellspacing=0 cellpadding=0>
<tr>
<td align=left>
Type a password<br>
from ${minisrv_config.config.passwords.min_length} to ${minisrv_config.config.passwords.max_length} <br>
characters long.
<p>This password will be<br>
required to access<br>
this account. If you<br>
don't want this<br>
account to have a<br>
password, leave<br>
these spaces blank.
</a>
</table>
</td>
<td align=left valign=top width=6>
</td>
<td align=left valign=top abswidth=210>
<table cellspacing=0 cellpadding=0>
<tr>
<td colspan=3 align=left>
Password<br>
<INPUT type="hidden" name="user_id" value="${user_id}">`;
if (request_headers.Referer) data += `
<INPUT type="hidden" name="return_to" value="${request_headers.Referer}">`;
data += `<INPUT noSubmit name="password" id="password" Value=""
bgcolor=#444444 text=#ffdd33 cursor=#cc9933
TYPE="password" ASCIIONLY
SIZE="${minisrv_config.config.passwords.form_size}"
MAXLENGTH="${minisrv_config.config.passwords.max_length}">
<tr>
<td height=6>
<tr>
<td colspan=3 align=left>
<br>Type again to confirm<br>
<INPUT noSubmit name="verify" id="verify" Value=""
bgcolor=#444444 text=#ffdd33 cursor=#cc9933
TYPE="password" ASCIIONLY
SIZE="${minisrv_config.config.passwords.form_size}"
MAXLENGTH="${minisrv_config.config.passwords.max_length}">
</a>
</table>
</table>
<td>
<tr>
<td absheight=7>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="2B2B2B">
<img src="wtv-home:/ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=1>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="0D0D0D">
<img src="wtv-home:/ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=4>
</table>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=430 valign=top align=right>
<font color="#E7CE4A" size=-1><shadow>
<input
selected
type=submit borderimage="file://ROM/Borders/ButtonBorder2.bif"
value=Done name="Done" usestyle width=103>
</shadow></font></form>
<td abswidth=20>
</table>
</body>
</html>
`;
}
}
if (userSession) userSession = null;

View File

@@ -0,0 +1,163 @@
var minisrv_service_file = true;
session_data.loadSessionData();
var user_id = null;
if (request_headers.query.user_id) {
user_id = request_headers.query.user_id;
} else {
user_id = session_data.user_id;
}
// security
if (session_data.user_id != 0 && session_data.user_id != request_headers.query.user_id) {
user_id = null; // force unset
var errpage = doErrorPage(400, "You are not authorized to edit the selected user.");
headers = errpage[0];
data = errpage[1];
}
if (user_id != null) {
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`
var userSession = null;
if (session_data.user_id == request_headers.query.user_id) userSession = session_data;
else {
userSession = new WTVClientSessionData(minisrv_config, socket.ssid);
userSession.user_id = user_id;
}
if (!userSession.loadSessionData()) {
var errpage = doErrorPage(400, "Invalid user ID.");
headers = errpage[0];
data = errpage[1];
} else {
data = `
<HTML>
<HEAD>
<TITLE>
Changing ${(user_id == 0) ? 'subscriber' : 'user'} information
</TITLE>
<DISPLAY nosave
noscroll>
</HEAD>
<sidebar width=110> <table cellspacing=0 cellpadding=0 BGCOLOR="30364D">
<tr>
<td colspan=3 abswidth=104 absheight=4>
<td rowspan=99 width=6 absheight=420 valign=top align=left>
<img src="wtv-home:/ROMCache/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="1C1E28">
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr><td abswidth=104 absheight=1 valign=top align=left>
<tr><td abswidth=104 absheight=2 valign=top align=left bgcolor="4D5573">
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
</table>
<tr><td absheight=37>
<tr><td absheight=263 align=right colspan=3>
<img src="ROMCache/AccountBanner.gif" width=53 height=263>
<tr><td absheight=41>
</table>
</sidebar>
<BODY BGCOLOR="#191919" TEXT="#44cc55" LINK="189CD6" VLINK="189CD6" HSPACE=0 VSPACE=0 FONTSIZE="large"
>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=14>
<td abswidth=416 absheight=80 valign=center>
<font size="+2" color="E7CE4A"><blackface><shadow>
${(user_id == 0) ? 'Subscriber' : 'User'} information
<td abswidth=20>
<tr>
<td>
<td absheight=244 valign=top align=left>
<form
action="wtv-setup:/serve-billing-overview"
>
<P>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td align=left valign=top abswidth=198>
<table cellspacing=0 cellpadding=0>
<tr>
<td align=left>
Choose any item to
change the
information.
<p>Choose <b>Done</b> when
you're finished.
</a>
</table>
</td>
<td align=left valign=top width=6>
</td>
<td align=left valign=top abswidth=210>
<table cellspacing=0 cellpadding=0>
<tr>
<td colspan=3 align=left>
<b>Username:</b><br>
${userSession.getSessionData("subscriber_username")}
</a>
<tr>
<td height=6>
<tr>
<td colspan=3 align=left>
<b>Display Name:</b><br>
<a href="wtv-setup:/edit-user-name?user_id=${user_id}">
${userSession.getSessionData("subscriber_name")}
</a>
<tr>
<td height=6>
<tr>
<td colspan=3 align=left>
<b>Password:</b>
<br>
<a href="wtv-setup:/edit-password?user_id=${user_id}">
${(userSession.getUserPasswordEnabled()) ? "Change Password" : "Set Password"}
</a>
</table>
</table>
<td>
<tr>
<td absheight=7>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="2B2B2B">
<img src="wtv-home:/ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=1>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="0D0D0D">
<img src="wtv-home:/ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=4>
</table>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=430 valign=top align=right>
<font color="#E7CE4A" size=-1><shadow>
<input
selected
type=submit borderimage="file://ROM/Borders/ButtonBorder2.bif"
value=Done name="Done" usestyle width=103>
</shadow></font></form>
<td abswidth=20>
</table>
</body>
</html>
`;
}
}
if (userSession) userSession = null;

View File

@@ -0,0 +1,151 @@
var minisrv_service_file = true;
session_data.loadSessionData();
var user_id = (request_headers.query.user_id) ? request_headers.query.user_id : session_data.user_id;
// security
if (session_data.user_id != 0 && session_data.user_id != request_headers.query.user_id) {
user_id = null; // force unset
var errpage = wtvshared.doErrorPage(400, "You are not authorized to change the selected user's password.");
headers = errpage[0];
data = errpage[1];
}
if (user_id != null) {
var userSession = null;
if (session_data.user_id == request_headers.query.user_id) userSession = session_data;
else {
userSession = new WTVClientSessionData(minisrv_config, socket.ssid);
userSession.user_id = user_id;
}
if (!userSession.loadSessionData()) {
var errpage = wtvshared.doErrorPage(400, "Invalid user ID.");
headers = errpage[0];
data = errpage[1];
}
else {
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`;
data = `
<HTML>
<HEAD>
<TITLE>
Changing your name
</TITLE>
<DISPLAY nosave
noscroll>
</HEAD>
<sidebar width=110> <table cellspacing=0 cellpadding=0 BGCOLOR="30364D">
<tr>
<td colspan=3 abswidth=104 absheight=4>
<td rowspan=99 width=6 absheight=420 valign=top align=left>
<img src="wtv-home:/ROMCache/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="1C1E28">
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr><td abswidth=104 absheight=1 valign=top align=left>
<tr><td abswidth=104 absheight=2 valign=top align=left bgcolor="4D5573">
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
</table>
<tr><td absheight=37>
<tr><td absheight=263 align=right colspan=3>
<img src="ROMCache/AccountBanner.gif" width=53 height=263>
<tr><td absheight=41>
</table>
</sidebar>
<BODY BGCOLOR="#191919" TEXT="#44cc55" LINK="189CD6" VLINK="189CD6" HSPACE=0 VSPACE=0 FONTSIZE="large"
>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=14>
<td abswidth=416 absheight=80 valign=center>
<font size="+2" color="E7CE4A"><blackface><shadow>
Your name
<td abswidth=20>
<tr>
<td>
<td absheight=244 valign=top align=left>
<form
action="wtv-setup:/validate-change-name"
>
<P>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td align=left valign=top abswidth=198>
<table cellspacing=0 cellpadding=0>
<tr>
<td align=left>
Change your display<br>
name here.
<p>Your name is<br>
included on your<br>
mail and news posts.<br>
<br>
Leave the field blank<br>
to set your display name to<br>
<b>${userSession.getSessionData('subscriber_username')}</b>.
</a>
</table>
</td>
<td align=left valign=top width=6>
</td>
<td align=left valign=top abswidth=210>
<table cellspacing=0 cellpadding=0>
<tr>
<td colspan=3 align=left>
Display name<br>
<INPUT noSubmit name="display_name" id="display_name" Value="${userSession.getSessionData('subscriber_name')}"
bgcolor=#444444 text=#ffdd33 cursor=#cc9933
TYPE="text" ASCIIONLY
SIZE="18"
MAXLENGTH="18">
<INPUT type="hidden" name="user_id" value="${user_id}">
</table>
</table>
<td>
<tr>
<td absheight=7>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="2B2B2B">
<img src="wtv-home:/ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=1>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="0D0D0D">
<img src="wtv-home:/ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=4>
</table>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=430 valign=top align=right>
<font color="#E7CE4A" size=-1><shadow>
<input
selected
type=submit borderimage="file://ROM/Borders/ButtonBorder2.bif"
value=Done name="Done" usestyle width=103>
</shadow></font></form>
<td abswidth=20>
</table>
</body>
</html>
`;
}
}
if (userSession) userSession = null;

View File

@@ -1,5 +1,6 @@
var WTVBGMusic = require("./WTVBGMusic.js");
var wtvbgm = new WTVBGMusic(minisrv_config, ssid_sessions[socket.ssid])
var minisrv_service_file = true;
const wtvbgm = new WTVBGMusic(minisrv_config, session_data);
var music_obj = wtvbgm.getMusicObj();
headers = `

View File

@@ -1,31 +1,41 @@
var minisrv_service_file = true;
var settings_obj = ssid_sessions[socket.ssid].getSessionData("wtv-setup");
if (settings_obj === null) settings_obj = {};
if (session_data.lockdown) {
headers = `200 OK
wtv-printer-model: -1,-1
wtv-printer-pen: 0,0,1,0
wtv-printer-setup: 0,0,1,0
wtv-language-header: en-US,en
Content-Type: text/html`;
data = "";
} else {
settings_obj["from-server"] = 1;
var settings_obj = session_data.getSessionData("wtv-setup");
if (settings_obj === null) settings_obj = {};
// defaults
if (!settings_obj["setup-advanced-options"]) settings_obj["setup-advanced-options"] = 0;
if (!settings_obj["setup-play-bgm"]) settings_obj["setup-play-bgm"] = 0;
if (!settings_obj["setup-bgm-tempo"]) settings_obj["setup-bgm-tempo"] = -1;
if (!settings_obj["setup-bgm-volume"]) settings_obj["setup-bgm-volume"] = 100;
if (!settings_obj["setup-background-color"]) settings_obj["setup-background-color"] = "c6c6c6";
if (!settings_obj["setup-font-sizes"]) settings_obj["setup-font-sizes"] = "medium";
if (!settings_obj["setup-in-stereo"]) settings_obj["setup-in-stereo"] = 1;
if (!settings_obj["setup-keyboard"]) settings_obj["setup-keyboard"] = "alphabetical";
if (!settings_obj["setup-link-color"]) settings_obj["setup-link-color"] = "2222bb";
if (!settings_obj["setup-play-songs"]) settings_obj["setup-play-songs"] = 1;
if (!settings_obj["setup-play-sounds"]) settings_obj["setup-play-sounds"] = 1;
if (!settings_obj["setup-text-color"]) settings_obj["setup-text-color"] = 0;
if (!settings_obj["setup-visited-color"]) settings_obj["setup-visited-color"] = "8822bb";
if (!settings_obj["setup-japan-keyboard"]) settings_obj["setup-japan-keyboard"] = "roman";
if (!settings_obj["setup-japan-softkeyboard"]) settings_obj["setup-japan-softkeyboard"] = "roman"
if (!settings_obj["setup-chat-access-level"]) settings_obj["setup-chat-access-level"] = 0;
if (!settings_obj["setup-chat-on-nontrusted-pages"]) settings_obj["setup-chat-on-nontrusted-pages"] = 1;
if (!settings_obj["setup-tv-chat-level"]) settings_obj["setup-tv-chat-level"] = 2;
settings_obj["from-server"] = 1;
headers = `200 OK
// defaults
if (!settings_obj["setup-advanced-options"]) settings_obj["setup-advanced-options"] = 0;
if (!settings_obj["setup-play-bgm"]) settings_obj["setup-play-bgm"] = 0;
if (!settings_obj["setup-bgm-tempo"]) settings_obj["setup-bgm-tempo"] = -1;
if (!settings_obj["setup-bgm-volume"]) settings_obj["setup-bgm-volume"] = 100;
if (!settings_obj["setup-background-color"]) settings_obj["setup-background-color"] = "c6c6c6";
if (!settings_obj["setup-font-sizes"]) settings_obj["setup-font-sizes"] = "medium";
if (!settings_obj["setup-in-stereo"]) settings_obj["setup-in-stereo"] = 1;
if (!settings_obj["setup-keyboard"]) settings_obj["setup-keyboard"] = "alphabetical";
if (!settings_obj["setup-link-color"]) settings_obj["setup-link-color"] = "2222bb";
if (!settings_obj["setup-play-songs"]) settings_obj["setup-play-songs"] = 1;
if (!settings_obj["setup-play-sounds"]) settings_obj["setup-play-sounds"] = 1;
if (!settings_obj["setup-text-color"]) settings_obj["setup-text-color"] = 0;
if (!settings_obj["setup-visited-color"]) settings_obj["setup-visited-color"] = "8822bb";
if (!settings_obj["setup-japan-keyboard"]) settings_obj["setup-japan-keyboard"] = "roman";
if (!settings_obj["setup-japan-softkeyboard"]) settings_obj["setup-japan-softkeyboard"] = "roman"
if (!settings_obj["setup-chat-access-level"]) settings_obj["setup-chat-access-level"] = 0;
if (!settings_obj["setup-chat-on-nontrusted-pages"]) settings_obj["setup-chat-on-nontrusted-pages"] = 1;
if (!settings_obj["setup-tv-chat-level"]) settings_obj["setup-tv-chat-level"] = 2;
headers = `200 OK
wtv-backgroundmusic-load-playlist: wtv-setup:/get-playlist
wtv-printer-model: -1,-1
wtv-printer-pen: 0,0,1,0
@@ -33,10 +43,11 @@ wtv-printer-setup: 0,0,1,0
wtv-language-header: en-US,en
Content-Type: text/html`;
data = "";
data = "";
Object.keys(settings_obj).forEach(function (k, v) {
data += k + "=" + escape(settings_obj[k]) + "&";
});
Object.keys(settings_obj).forEach(function (k, v) {
data += k + "=" + escape(settings_obj[k]) + "&";
});
data = data.substring(0, (data.length - 1));
data = data.substring(0, (data.length - 1));
}

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -1,5 +1,6 @@
var minisrv_service_file = true;
var settings_obj = ssid_sessions[socket.ssid].getSessionData("wtv-setup");
var settings_obj = session_data.getSessionData("wtv-setup");
if (settings_obj === null) settings_obj = {};
headers = `200 OK

View File

@@ -84,7 +84,7 @@ cols=45 rows=5
autoactivate
nosoftbreaks
maxlength=4096
font=proportional>${ssid_sessions[socket.ssid].getSessionData("subscriber_signature") || ""}</TEXTAREA></FORM></TD>
font=proportional>${session_data.getSessionData("subscriber_signature") || ""}</TEXTAREA></FORM></TD>
</FORM>
<TR>
<TD>

View File

@@ -22,7 +22,7 @@ Mail settings
<tr>
<td abswidth=6>
<td abswidth=92 absheight=76>
<table absheight=76 cellspacing=0 cellpadding=0>
<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>

View File

@@ -0,0 +1,126 @@
var minisrv_service_file = true;
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`
data = `<!--- *=* Copyright 1996, 1997 WebTV Networks, Inc. All rights reserved. --->
<HTML>
<HEAD>
<TITLE>
Messenger account
</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 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>
Messenger account
</table>
<td abswidth=20>
<TR>
<td>
<td WIDTH=205 HEIGHT=250 VALIGN=top ALIGN=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td absheight=195 valign=top>
Type your Messenger account details here.
<p>The settings will take effect
the next time you connect to WebTV.
</table>
<TD WIDTH=20>
<TD WIDTH=198 VALIGN=top ALIGN=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td align=left>
User Name<form action=validate-messenger-account>
<INPUT noSubmit name="email" id="email" Value="${session_data.getSessionData("messenger_email")}"
bgcolor=#444444 text=#ffdd33 cursor=#cc9933
TYPE="input" ASCIIONLY
SIZE="16"
MAXLENGTH="16"></FONT>
<p>
<input type="hidden" autosubmit="onLeave">
<select name="domain">
<option value="escargot.chat">@escargot.chat
</option><option value="escargot.live">@escargot.live
</option></select>
<p>
Password
<INPUT noSubmit name="password" id="password" Value=""
bgcolor=#444444 text=#ffdd33 cursor=#cc9933
TYPE="password" ASCIIONLY
SIZE="16"
MAXLENGTH="20"></input>
<br><br>
Type again to verify
<INPUT noSubmit name="password_verify" id="password_verify" Value=""
bgcolor=#444444 text=#ffdd33 cursor=#cc9933
TYPE="password" ASCIIONLY
SIZE="16"
MAXLENGTH="20">
</table>
<TR>
<TD>
<TD COLSPAN=4 HEIGHT=0 VALIGN=top ALIGN=left>
<tr>
<TD>
<td colspan=4 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=4 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>
<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

@@ -0,0 +1,238 @@
var minisrv_service_file = true;
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`
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(refreshFriendList, 1*600);
}
function blockThisPerson(emailAddress)
{ Blim.removeFromList("AL", emailAddress);
setTimeout("blockThisPersonCore('" + emailAddress + "');", 1*1000);
setTimeout(refreshFriendList, 1*1100);
}
function blockThisPersonCore(emailAddress)
{ Blim.addToList("BL", emailAddress);
}
function unblockThisPerson(emailAddress)
{ Blim.removeFromList("BL", emailAddress);
setTimeout("allowThisPersonCore('" + emailAddress + "');", 1*1000);
setTimeout(refreshFriendList, 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>
<script language="Javascript">
var gTheList = "FL";
var gUserHasNoFriends = (Blim.listLength("FL") < 0);
function scrollFriendList()
{ var scrawlHere = document.friendList.document;
// handle scrolling here when we get art and some scroll position client javascript
}
function refreshFriendList()
{ var i;
var scrawlHere = document.friendList.document;
scrawlHere.open("text/html", "replace");
var atLeastOneConnected = false;
if (! Blim.isAlive() )
{ scrawlHere.write("<table border=0 cellspacing=3 cellpadding=0><tr>");
scrawlHere.write("<tr><td><font color=#FFEFAD>");
scrawlHere.write("MSN Messenger is currently turned off. To send and receive instant ");
scrawlHere.write("messages again, choose <b>Turn MSN Messenger on</b>.");
scrawlHere.write("</font>");
scrawlHere.write("</table>");
scrawlHere.close();
return;
}
var listLength = Blim.listLength("FL");
if (listLength == 0)
{ scrawlHere.write('<table border=0 cellspacing=3 cellpadding=0 ><tr>');
scrawlHere.write("<tr><td><font color=FFEFAD size=-1>You don't have any buddies yet. ");
scrawlHere.write('<p>To add a buddy or send an instant message, ');
scrawlHere.write('choose <b>Use MSN Messenger now</b>. ');
scrawlHere.write('You can also add buddies in your Address book.');
}
else
{ scrawlHere.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 humanName = Blim.getUmanName(ID);
scrawlHere.write('<tr><td maxlines=1><b><a ');
if (isFirst)
{ scrawlHere.write(" id=firstFriend selected ");
isFirst = false;
}
scrawlHere.write('href="javascript:void(StartConversation(');
scrawlHere.write("'");
scrawlHere.write(ID);
scrawlHere.write("'");
scrawlHere.write('))">');
scrawlHere.write("<font color=FFEFAD>"); scrawlHere.write(escapeHTML(humanName));
scrawlHere.write('</a><font color=FFEFAD> - ');
scrawlHere.write('<a href="javascript:void(defriendThisPerson(');
scrawlHere.write("'");
scrawlHere.write(ID);
scrawlHere.write("'");
scrawlHere.write('))">');
scrawlHere.write("<font color=FFEFAD>"); scrawlHere.write('Remove');
scrawlHere.write('</a><font color=FFEFAD> - ');
if (isBlocked(ID)) {
scrawlHere.write('<a href="javascript:void(unblockThisPerson(');
scrawlHere.write("'");
scrawlHere.write(ID);
scrawlHere.write("'");
scrawlHere.write('))">');
scrawlHere.write("<font color=FFEFAD>");
scrawlHere.write('Unblock');
} else {
scrawlHere.write('<a href="javascript:void(blockThisPerson(');
scrawlHere.write("'");
scrawlHere.write(ID);
scrawlHere.write("'");
scrawlHere.write('))">');
scrawlHere.write("<font color=FFEFAD>");
scrawlHere.write('Block');
}
}
}
scrawlHere.write("</font>");
scrawlHere.write("</table>");
scrawlHere.close();
}
</script>
<script language="Javascript">
</script>
<HTML>
<head>
<title> Choose who can send messages
</title>
</head>
<display nosave>
<body bgcolor="#2E2E2A" text="#CBCBCB" link="#FFE99B" vlink="#FFE99B" hspace=0 vspace=0 fontsize="medium">
<table cellspacing=0 cellpadding=0 border=0 bgcolor=#645D5F>
<tr>
<td height=7 colspan=4>
<tr>
<td width=7>
<td width=87 href="wtv-home:/home">
<img src="/ROMCache/WebTVLogoJewel.gif" width=87 height=67>
<td width=7>
<td width=459 valign=bottom>
<img src="wtv-setup:/images/Settings.gif" width=197 height=58>
<tr>
<td height=5 colspan=4>
</table>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td width=15 height=25 bgcolor=#645D5F>
<td width=545 height=25 bgcolor=#2E2E2A gradcolor=#23231F gradangle=90>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td width=8 height=25 valign=top>
<img src="wtv-setup:/images/CornerTop.gif" width=8 height=8>
<td width=78>
<td abswidth=392 valign=middle maxlines=1>
<blackface><font color=#D6D6D6> Choose who can send messages
</font></blackface>
<td width=21>
<img src="wtv-setup:/images/widget.gif" width=16 height=16>
<td width=34>
<spacer type=vertical size=1><br>
<a href="wtv-guide:/help?topic=Messenger&subtopic=Index"><font sizerange=small color=#E7CE4A><b>Help</b></font></a>
<td width=12>
<img width=1 height=1 src="wtv-mail:/update-light-wtv-token-2295058104-7A30D06D2B14D07410FB5D0C4FABA9FF">
</table>
</table>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=15 rowspan=2 bgcolor=#645D5F>
<td width=48 rowspan=2>
<td width=497 height=237 valign=top>
<form action="wtv-setup:/messenger-validate-list" name="editListForm">
<table cellspacing=0 cellpadding=0>
<tr>
<td height=12 colspan=3>
<tr>
<td abswidth=420 valign=top>
<embed SCROLLTARGET name=friendList usestyle nobackground src="file://ROM/HTMLs/Empty.html" height=208></embed>
<script language="Javascript">
refreshFriendList();
</script>
<table border=0 cellspacing=10 cellpadding=0>
<tr>
<td width=10></td>
<td>
</td>
<td width=10>
</tr>
</table>
</table>
<tr>
<td align=right>
<table cellspacing=0 cellpadding=0>
<tr>
<td>
<spacer type=horizontal size=12>
<font color="#E7CE4A" size=-1><shadow>
<input
type=submit selected
value=Done name="Done" usestyle selected
borderimage="file://ROM/Borders/ButtonBorder2.bif"
width=103>
</shadow></font></form>
<td abswidth=12>
<tr>
<td height=12 colspan=2>
</table>
</table>
</body>
</HTML>
`;

View File

@@ -0,0 +1,20 @@
var minisrv_service_file = true;
if (!session_data.getSessionData("messenger_enabled") == 1) {
session_data.setSessionData("messenger_enabled", 1);
session_data.saveSessionData;
var justenabled = "true"
var enablestatus = "1"
} else {
session_data.setSessionData("messenger_enabled", 0);
session_data.saveSessionData;
var justenabled = "false"
var enablestatus = "0"
}
headers = `300 OK
Content-type: text/html
wtv-expire: wtv-setup:/messenger
Location: wtv-setup:/messenger?just_enabled=${justenabled}
wtv-messenger-enable: ${enablestatus}
`;

View File

@@ -0,0 +1,195 @@
var minisrv_service_file = true;
headers = `200 OK`
data = `<html>
<!--MattMan 2020--/>
<head>
<TITLE>
Messenger status
</TITLE>
<script language="JavaScript">
function atLoad()
{ Blim.onProtocolTranscriptChange("refreshTranscript()");
Blim.onProtocolStatusChange("refreshStatus()");
refreshTranscript();
refreshStatus();
}
function refreshTranscript()
{ var doc = document.transcript.document;
doc.open("text/html", "replace");
doc.write("<font size=-1 bgcolor=#000000 color=#ffdd33>");
doc.write("<table cellspacing=0 cellpadding=0>");
doc.write("<tr>");
doc.write("<td width=540 valign=bottom>");
doc.write(Blim.getDebugTranscript());
doc.write("</table>");
doc.write("</font>");
doc.close();
}
function refreshStatus()
{ document.forms[0].status.value = Blim.getConnectionState();
}
function removeOne()
{ var list = "FL";
if(Blim.listLength(list) == 0)
list = "AL";
if(Blim.listLength(list) == 0)
list = "BL";
if (Blim.listLength(list) > 0)
{ var toRemove = Blim.listItem(list, 0);
Blim.removeFromList(list, toRemove);
}
}
function clearAllLists()
{ if(Blim.listLength("FL") == 0 && Blim.listLength("AL") == 0 && Blim.listLength("BL") == 0 )
message("Your lists are already clear.");
else
{ removeOne();
setTimeout("clearAllLists();", 2*1000);
}
}
</script>
<DISPLAY nosave
>
</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="/ROMCache/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>
<img src="/ROMCache/Spacer.gif" width=1 height=1>
<tr><td abswidth=104 absheight=1 valign=top align=left>
<tr><td abswidth=104 absheight=2 valign=top align=left bgcolor=6b4657>
<img src="/ROMCache/Spacer.gif" width=1 height=1>
</table>
<tr>
<td height=31 colspan=3>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=5 height=26>
<td width=93>
<table width=93 cellspacing=0 cellpadding=0 href=wtv-guide:/help?topic=Messenger&subtopic=Index>
<tr>
<td>
<table cellspacing=0 cellpadding=0>
<tr>
<td>
<shadow><font color=e7ce4a size=-1>&nbsp;Help
</table>
</table>
<td width=6>
<tr>
<td colspan=3 width=104 height=2 bgcolor=000000 transparency=64>
<spacer>
<tr>
<td height=1>
<tr>
<td colspan=3 width=104 height=2 bgcolor=ffffff transparency=88>
<spacer>
</table>
<tr><td absheight=101>
<tr><td absheight=166 align=right colspan=3>
<img src="wtv-setup:/ROMCache/SettingsBanner.gif" width=54 height=166>
<tr><td absheight=41>
</table>
</sidebar>
<BODY NOHTILEBG BGCOLOR="#191919" TEXT="#42CC55" LINK="36d5ff" VLINK="36d5ff" HSPACE=0 VSPACE=0 FONTSIZE="large"
>
<table cellspacing=0 cellpadding=0 height=340>
<tr>
<td abswidth=14>
<td abswidth=416 absheight=80 valign=center>
<font size="+2" color="E7CE4A"><blackface><shadow>
Messenger status
<td abswidth=20>
<tr>
<td>
<td valign=top align=left>
<form
action="client:goback"
>
<form>
<input type=button value ="Open Messenger Panel" name="msgr" onclick="javascript:void(Blim.openMessagesPanel());">
</form>
<p>
<script language="JavaScript">
document.write("User: ");
document.write(Blim.getServiceParameter("MSN", "UNAM"));
document.write("<br>");
document.write(Blim.getServiceParameter ("MSN","UPW" ));
document.write("<br>");
document.write("Server: ");
document.write(Blim.getServiceParameter("MSN", "SNAM"));
document.write("<br>");
document.write("Enabled: ");
document.write("True<br>");
document.write("Passport: ");
document.write(Blim.getServiceParameter("MSN", "PPOR"));
document.write("<br>");
document.write("Alive: ");
if(Blim.isAlive())
document.write("True<br>");
else
document.write("False<br>");
document.write("Status: ");
document.write(Blim.getConnectionState());
</script>
<p>
<form>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td valign=top>
<input type=button value ="Clear" name="goofy" onclick="(clearAllLists());">
<td width=5><spacer type=horizontal width=5>
<td valign=top>Clear your allow, block, and buddy lists in one swell foop!
</table> </form>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=450 > <embed height=1 name=transcript border=0 src="file://ROM/HTMLs/Empty.html">
</table>
<td>
<tr>
<td absheight=7>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="2B2B2B">
<img src="wtv-home:/ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=1>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="0D0D0D">
<img src="wtv-home:/ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=4>
</table>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=430 valign=top align=right>
<font color="#E7CE4A" size=-1><shadow>
<input
selected
type=submit borderimage="file://ROM/Borders/ButtonBorder2.bif"
value=Done name="Done" usestyle width=103>
</shadow></font></form>
<td abswidth=20>
<tr><td height=10>
</table>
</body>
</html>`

View File

@@ -0,0 +1,127 @@
var minisrv_service_file = true;
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`
data = `<HTML>
<head>
<title> MSN Messenger settings
</title>
<script language="Javascript">
function setupSettings()
{ var theForm = document.modeForm;
var goOpenMode = theForm.theListRadio[0];
var goClosedMode = theForm.theListRadio[1];
goOpenMode.checked = ! Blim.isClosedMode();
goClosedMode.checked = Blim.isClosedMode();
}
function makeChanges()
{ var theForm = document.modeForm;
var goOpenMode = theForm.theListRadio[0];
var goClosedMode = theForm.theListRadio[1];
if (goOpenMode.checked)
Blim.setClosedMode(false);
else if (goClosedMode.checked)
Blim.setClosedMode(true);
// window.location = "client:goback";
}
</script>
</head>
<display nosave>
<body bgcolor="#2E2E2A" text="#CBCBCB" link="#FFE99B" vlink="#FFE99B" hspace=0 vspace=0 fontsize="medium">
<table cellspacing=0 cellpadding=0 border=0 bgcolor=#645D5F>
<tr>
<td height=7 colspan=4>
<tr>
<td width=7>
<td width=87 href="wtv-home:/home">
<img src="/ROMCache/WebTVLogoJewel.gif" width=87 height=67>
<td width=7>
<td width=459 valign=bottom>
<img src="wtv-setup:/images/Settings.gif" width=197 height=58>
<tr>
<td height=5 colspan=4>
</table>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td width=15 height=25 bgcolor=#645D5F>
<td width=545 height=25 bgcolor=#2E2E2A gradcolor=#23231F gradangle=90>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td width=8 height=25 valign=top>
<img src="wtv-setup:/images/CornerTop.gif" width=8 height=8>
<td width=78>
<td abswidth=392 valign=middle maxlines=1>
<blackface><font color=#D6D6D6> MSN Messenger settings
</font></blackface>
<td width=21>
<img src="wtv-setup:/images/widget.gif" width=16 height=16>
<td width=34>
<spacer type=vertical size=1><br>
<a href="wtv-guide:/help?topic=Messenger&subtopic=Index"><font sizerange=small color=#E7CE4A><b>Help</b></font></a>
<td width=12>
<img width=1 height=1 src="wtv-mail:/update-light-wtv-token-745586897-D8457537A2A3153CC59CCCE37A3A93EA">
</table>
</table>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=15 rowspan=2 bgcolor=#645D5F>
<td width=48 rowspan=2>
<td width=497 height=237 valign=top>
<form action="client:goback" ID="modeForm">
<table cellspacing=0 cellpadding=0>
<tr>
<td height=12 colspan=3>
<tr>
<td abswidth=200 valign=top>
You can decide how available you'd like to be with MSN Messenger. <p>
<script language="Javascript">
if (Blim.isClosedMode())
document.write("You currently allow only people on your allow list to send you messages.");
else
document.write("You currently allow everyone except people you've blocked to send you messages.");
</script>
<td abswidth=40>
<spacer type=horizontal size=40>
<td abswidth=220 valign=top>
<table>
<tr>
<td valign=top align=right>
<input type="radio" name="theListRadio" value="chooseOpenMode" onChange="makeChanges()">
<spacer type=horizontal width=2></td>
<td>Allow everyone except people you've blocked to contact you</td>
<tr>
<td height=5>
</tr><tr>
<td valign=top align=right>
<input type="radio" name="theListRadio" value="chooseClosedMode" onChange="makeChanges()">
<spacer type=horizontal width=2></td>
<td>Allow only people on your list to contact you</td>
</tr>
</table>
<script language="Javascript">
setupSettings();
</script>
</table>
<tr>
<td align=right>
<table cellspacing=0 cellpadding=0>
<tr>
<td>
<spacer type=horizontal size=12>
<font color="#E7CE4A" size=-1><shadow>
<input
type=submit selected
value=Done name="Done" usestyle selected
borderimage="file://ROM/Borders/ButtonBorder2.bif"
width=103>
</shadow></font></form>
<td abswidth=12>
<tr>
<td height=12 colspan=2>
</table>
</table>
</body>
</HTML>
`;

View File

@@ -0,0 +1,124 @@
var minisrv_service_file = true;
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`
data = `<!--- *=* Copyright 1996, 1997 WebTV Networks, Inc. All rights reserved. --->
<HTML>
<HEAD>
<TITLE>
Messenger
</TITLE>
<DISPLAY noscroll nologo>
</HEAD>
<script language="Javascript">
// convenience: bring up the main Messenger panel
function ShowMessengerPanel()
{ Blim.openMessagesPanel();
}
</script>
<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 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"`;
if (request_headers.query.just_enabled == "true") {
data += "onload=ShowMessengerPanel()"
} data += `
>
<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>
Messenger
</table>
<td abswidth=20>
<TR>
<td>
<td WIDTH=205 HEIGHT=250 VALIGN=top ALIGN=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td absheight=195 valign=top>
Messenger is currently <b>`;
if (session_data.getSessionData("messenger_enabled") == 1) {
data += "on"
} else {
data += "off"
} data += `</b>.
</table>
<TD WIDTH=20>
<TD WIDTH=198 VALIGN=top ALIGN=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td align=left>
<a href="messenger-enable">Turn messenger `;
if (!session_data.getSessionData("messenger_enabled") == 1) {
data += "on"
} else {
data += "off"
} data += `</a></FONT>
<p>
<a href="messenger-account">Change your account</a>
<p>
<a href="messenger-info">Advanced Info</a>
</table>
</form>
<TR>
<TD>
<TD COLSPAN=4 HEIGHT=0 VALIGN=top ALIGN=left>
<tr>
<TD>
<td colspan=4 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=4 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="wtv-setup:/setup">
<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

@@ -82,7 +82,7 @@ Dialing options
<A HREF="wtv-setup:/phone-call-waiting"><BLACKFACE>Call waiting</BLACKFACE></A><BR>
<FONT SIZE="-1">Call waiting can be turned off automatically</FONT><BR>
<spacer type=block WIDTH=1 HEIGHT=12><BR>
<A HREF="${ssid_sessions[socket.ssid].get("wtv-open-access") ? 'file://rom/HTMLs/ConfigureBYOISP.html' : 'client:GoToBYOISPIntro'}"><BLACKFACE>Use an ISP</BLACKFACE></A><BR>
<A HREF="${session_data.get("wtv-open-access") ? 'file://rom/HTMLs/ConfigureBYOISP.html' : 'client:GoToBYOISPIntro'}"><BLACKFACE>Use an ISP</BLACKFACE></A><BR>
<FONT SIZE="-1">Save money if you dial long distance to WebTV</FONT><BR>
<TD WIDTH=20>

View File

@@ -0,0 +1,165 @@
var minisrv_service_file = true;
var errpage;
if (Object.keys(session_data.listPrimaryAccountUsers()).length == 1) {
errpage = wtvshared.doErrorPage(400, "There are no more users to remove.");
}
else if (session_data.user_id != 0) errpage = wtvshared.doErrorPage(400, "You are not authorized to add users to this account.");
if (errpage) {
headers = errpage[0];
data = errpage[1];
} else {
headers = `200 OK
Connection: Keep-Alive
wtv-expire-all: wtv-setup:/remove-users
wtv-expire-all: wtv-setup:/validate-remove-users
Content-Type: text/html`
data = `<HTML>
<HTML>
<HEAD>
<TITLE>
Remove users
</TITLE>
<DISPLAY nosave
noscroll>
</HEAD>
<sidebar width=110> <table cellspacing=0 cellpadding=0 BGCOLOR=30364D>
<tr>
<td colspan=3 abswidth=104 absheight=4>
<td rowspan=99 width=6 absheight=420 valign=top align=left>
<img src="wtv-home:/ROMCache/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=1C1E28>
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<tr><td abswidth=104 absheight=1 valign=top align=left>
<tr><td abswidth=104 absheight=2 valign=top align=left bgcolor=4D5573>
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
</table>
<tr><td absheight=37>
<tr><td absheight=263 align=right colspan=3>
<img src="ROMCache/AccountBanner.gif" width=53 height=263>
<tr><td absheight=41>
</table>
</sidebar>
<BODY NOHTILEBG BGCOLOR="#191919" TEXT="#42CC55" LINK="36d5ff" VLINK="36d5ff" HSPACE=0 VSPACE=0 FONTSIZE="large"
>
<TABLE cellspacing=0 cellpadding=0>
<TR><TD width=20><img src="wtv-home:/ROMCache/Spacer.gif" width=20 height=1>
<TD colspan=3 height=16 valign=top align=left>
<TR>
<TD width=20>
<TD colspan=3 height=39 valign=top>
<FONT size=+2 color="42CC55"> <blackface><shadow>
Remove users </shadow></blackface>
</FONT>
<TR><TD width=10>
<TD colspan=5 height=56 valign=top>
<TABLE cellspacing=0 cellpadding=0>
<TD width=400>
<FONT color="42CC55">
Mark users to remove permanently from your account,
then choose <b>Remove</b>.
</FONT>
<TD align=right>
</TABLE>
<td abswidth=20>
<TR>
<td>
<td WIDTH=198 HEIGHT=214 VALIGN=top ALIGN=left>
<FONT COLOR="44cc55"><B>
<TABLE CELLSPACING=0 CELLPADDING=0>
<TR><TD COLSPAN=3 HEIGHT=2 VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="2B2B2B"><IMG SRC="ROMCache/spacer.gif" WIDTH=10 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="ROMCache/spacer.gif" WIDTH=10 HEIGHT=1>
<TR><TD abswidth=54 absheight=25 valign=middle align=left>
<TD abswidth=230 valign=left align=left>
<font><blackface>Name</blackface></font>
<TD abswidth=150 valign=left align=right>
<font size="-1"><blackface>New Messages</blackface></font>
<TR><TD COLSPAN=3 HEIGHT=2 VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="2B2B2B"><IMG SRC="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="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD COLSPAN=3 HEIGHT=0>
<P><FORM ACTION="wtv-setup:/validate-remove-users" METHOD="POST">
`;
var accounts = session_data.listPrimaryAccountUsers();
var num_accounts = session_data.getNumberOfUserAccounts();
if (num_accounts > 1) {
delete accounts.subscriber;
for (const [key, value] of Object.entries(accounts)) {
var userSession = new WTVClientSessionData(minisrv_config, socket.ssid);
userSession.user_id = parseInt(key.replace("user", ''));
var mailcount = 0;
if (userSession.mailstore.mailstoreExists()) {
if (userSession.mailstore.mailboxExists(0)) {
mailcount = userSession.mailstore.countUnreadMessages(0);
}
}
data += `<FONT COLOR="42CC55"><B>
<TR><TD COLSPAN=3 HEIGHT=5>
<tr>
<td colspan=2><input type=checkbox name="${key}"><font size=+1> <b>${value.subscriber_username}</b>
<td align=right>${mailcount}
</tr>
</B></FONT>
`;
}
}
data += `
</table>
<TR>
<TD>
<TD COLSPAN=4 HEIGHT=4 VALIGN=top ALIGN=left>
<tr>
<TD>
<td colspan=4 height=2 valign=middle align=center bgcolor="2B2B2B">
<img src="wtv-home:/ROMCache/Spacer.gif" width=436 height=1>
<tr>
<TD>
<td colspan=4 height=1 valign=top align=left>
<tr>
<TD>
<td colspan=4 height=2 valign=top align=left bgcolor="0D0D0D">
<img src="wtv-home:/ROMCache/Spacer.gif" width=436 height=1>
<TR>
<TD>
<TD COLSPAN=4 HEIGHT=4 VALIGN=top ALIGN=left>
<TR>
<TD>
<TD COLSPAN=3 VALIGN=top ALIGN=right>
<FONT COLOR="#E7CE4A" SIZE=-1><SHADOW>
<INPUT type="submit"
name="Remove" value="Remove" WIDTH=103 USESTYLE
TYPE=SUBMIT BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" NAME="Button1" WIDTH=103>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=4 HEIGHT=1>
<INPUT action="wtv-setup:/accounts?"
name="Done"
value="Done"
WIDTH=103
selected
TYPE=SUBMIT BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" NAME="Button3" USESTYLE WIDTH=103>
</SHADOW></FONT></FORM>
<TD>
</TABLE>
</BODY>
</HTML>
`;
}

View File

@@ -1,6 +1,8 @@
var minisrv_service_file = true;
var music_obj = {};
ssid_sessions[socket.ssid].setSessionData("wtv-bgmusic", music_obj);
ssid_sessions[socket.ssid].saveSessionData();
session_data.setSessionData("wtv-bgmusic", music_obj);
session_data.saveSessionData();
headers = `300 OK
Location: wtv-setup:/choose-bg-songs
wtv-backgroundmusic-load-playlist: wtv-setup:/get-playlist`;

View File

@@ -75,7 +75,7 @@ Television
<FONT SIZE="-1">Center WebTV on your screen</FONT><BR>`;
// old classic apparently can do Screen Border
if (ssid_sessions[socket.ssid].get("wtv-client-rom-type") == "bf0app") {
if (session_data.get("wtv-client-rom-type") == "bf0app") {
data += `<spacer type=block width=1 height=5><BR>
<A HREF="wtv-setup:/screen-border" selected><BLACKFACE>Border</BLACKFACE></A><BR>
<FONT SIZE="-1">Change the color of the screen border</FONT><BR>`;

View File

@@ -10,7 +10,7 @@ data = `
<HTML>
<HEAD>
<TITLE>
Your WebTV account
Your ${minisrv_config.config.service_name} account
</TITLE>
<DISPLAY noscroll>
</HEAD>
@@ -51,36 +51,28 @@ Your WebTV account
<tr>
<td valign=center absheight=80>
<font size="+2" color="E7CE4A"><blackface><shadow>
Your WebTV account
Your ${minisrv_config.config.service_name} account
</table>
<td abswidth=20>
<TR>
<td>
<td WIDTH=198 HEIGHT=236 VALIGN=top ALIGN=left>
<A HREF="JavaScript:alert('This feature is not available.')"><BLACKFACE>Subscriber info</BLACKFACE></A><BR>
<A HREF="wtv-setup:/edit-user-begin?user_id=0"><BLACKFACE>Subscriber info</BLACKFACE></A><BR>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=1><BR>
<FONT SIZE="-1">Change your address, phone number, and password</FONT><BR>
<FONT SIZE="-1">Change your display name and/or password</FONT><BR>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=11><BR>
<A HREF="JavaScript:alert('This feature is not available.')"><BLACKFACE>How you pay</BLACKFACE></A><BR>
<A HREF="wtv-setup:/accounts"><BLACKFACE>Additional Users</BLACKFACE></A><BR>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=1><BR>
<FONT SIZE="-1">Change the way you pay for WebTV service</FONT><BR>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=11><BR>
<A HREF="JavaScript:alert('This feature is not available.')"><BLACKFACE>ISP options</BLACKFACE></A><BR>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=1><BR>
<FONT SIZE="-1">Save money if you dial long-distance to WebTV</FONT><BR>
<FONT SIZE="-1">Manage additional user accounts</FONT><BR>
<TD WIDTH=20>
<TD WIDTH=198 VALIGN=top ALIGN=left>
<A HREF="JavaScript:alert('This feature is not available.')"><BLACKFACE>Billing statement</BLACKFACE></A><BR>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=1><BR>
<FONT SIZE="-1">For your account</FONT><BR>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=11><BR>
<A HREF="wtv-home:/Credits-Legal"><BLACKFACE>Terms of service</BLACKFACE></A><BR>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=1><BR>
<FONT SIZE="-1">Rules and regulations</FONT><BR>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=11><BR>
<A HREF="wtv-home:/Credits-Privacy"><BLACKFACE>Privacy policy</BLACKFACE></A><BR>
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=1><BR>
<FONT SIZE="-1">Your personal information</FONT><BR>
<FONT SIZE="-1">How we use your personal information</FONT><BR>
<TR>
<TD>
@@ -102,7 +94,7 @@ Your WebTV account
<TR>
<TD>
<TD COLSPAN=3 VALIGN=top ALIGN=right>
<FORM action="client:goback">
<FORM action="wtv-setup:/setup">
<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>

View File

@@ -1,8 +1,7 @@
var minisrv_service_file = true;
var WTVBGMusic = require("./WTVBGMusic.js");
var wtvbgm = new WTVBGMusic(minisrv_config, ssid_sessions[socket.ssid]);
if (request_headers.query.category) {
const wtvbgm = new WTVBGMusic(minisrv_config, session_data);
var musicList = wtvbgm.getCategorySongList(request_headers.query.category);
var categoryName = wtvbgm.getCategoryName(request_headers.query.category);

View File

@@ -1,14 +1,14 @@
var minisrv_service_file = true;
if (request_headers.query && ssid_sessions[socket.ssid]) {
var settings_obj = ssid_sessions[socket.ssid].getSessionData("wtv-setup");
if (request_headers.query && session_data) {
var settings_obj = session_data.getSessionData("wtv-setup");
if (settings_obj === null) settings_obj = {};
Object.keys(request_headers.query).forEach(function (k) {
settings_obj[k] = request_headers.query[k];
});
console.log(settings_obj);
ssid_sessions[socket.ssid].setSessionData("wtv-setup", Object.assign({}, settings_obj));
ssid_sessions[socket.ssid].saveSessionData();
session_data.setSessionData("wtv-setup", Object.assign({}, settings_obj));
session_data.saveSessionData();
headers = `200 OK
Content-type: text/html`;
} else {

View File

@@ -1,5 +1,4 @@
var minisrv_service_file = true;
var { WTVShared, clientShowAlert } = require("./WTVShared.js");
var notImplementedAlert = new clientShowAlert({
'image': minisrv_config.config.service_logo,
@@ -63,7 +62,7 @@ hspace=0 vspace=0
<td valign=center absheight=80>
<shadow><blackface><font color="e7ce4a" font size="+1">
Settings
for ${ssid_sessions[socket.ssid].getSessionData("subscriber_username") || "You"}
for ${session_data.getSessionData("subscriber_username") || "You"}
</font><blackface><shadow>
</table>
<tr>
@@ -86,11 +85,13 @@ for ${ssid_sessions[socket.ssid].getSessionData("subscriber_username") || "You"}
<img src="ROMCache/BulletArrow.gif" width=6 height=13 valign=absmiddle><spacer type=block width=6 height=1>
<a href="wtv-setup:/mail">Mail</a><BR>
<spacer type=block width=1 height=5><BR>`;
// password
if (!minisrv_config.config.hide_incomplete_features) {
data += `<img src="ROMCache/BulletArrow.gif" width=6 height=13 valign=absmiddle><spacer type=block width=6 height=1>
<a href="${notImplementedAlert}"><strike>Password</strike></a><BR>
if (minisrv_config.config.passwords) {
if (minisrv_config.config.passwords.enabled) {
data += `<img src="ROMCache/BulletArrow.gif" width=6 height=13 valign=absmiddle><spacer type=block width=6 height=1>
<a href="wtv-setup:/edit-password">Password</a><BR>
<spacer type=block width=1 height=5><BR>`;
}
}
data += `
@@ -114,29 +115,28 @@ data += `
<img src="ROMCache/BulletArrow.gif" width=6 height=13 valign=absmiddle><spacer type=block width=6 height=1>
<a href="wtv-setup:/keyboard">Keyboard</a><BR>
<spacer type=block width=1 height=5><BR>`;
// extra users
if (!minisrv_config.config.hide_incomplete_features) {
if (session_data.user_id == 0) {
data += `<img src="ROMCache/BulletArrow.gif" width=6 height=13 valign=absmiddle><spacer type=block width=6 height=1>
<a href="${notImplementedAlert}"><strike>Extra users</strike></a><BR>
<a href="wtv-setup:/accounts">Extra Users</a><BR>
<spacer type=block width=1 height=5><BR>`;
}
data += `
<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>
<a href="wtv-setup:/messenger">Messenger</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:/phone">Dialing</a><BR>
<TD WIDTH=20>
<TD WIDTH=300 VALIGN=top ALIGN=left>
<spacer type=block width=6 height=14><font size="2"><br>
Signature <strike>and more</strike><BR>
<spacer type=block width=6 height=5><font size="2"><br>`;
// password
if (!minisrv_config.config.hide_incomplete_features) {
data += `<strike>Change your password</strike><BR>
<spacer type=block width=6 height=5><font size="2"><br>`;
}
data += `Options for your TV<BR>
<spacer type=block width=6 height=5><font size="2"><br>
Change your password<BR>
<spacer type=block width=6 height=5><font size="2"><br>
Options for your TV<BR>
<spacer type=block width=6 height=5><font size="2"><br>
Make text bigger or smaller<BR>
<spacer type=block width=6 height=5><font size="2"><br>
@@ -147,14 +147,15 @@ if (!minisrv_config.config.hide_incomplete_features) {
data += `<strike>Change how you print</strike><BR>
<spacer type=block width=6 height=5><font size="2"><br>`;
}
data += `Choose an on-screen keyboard<BR>
<spacer type=block width=6 height=5><font size="2"><br>`;
// extra users
if (!minisrv_config.config.hide_incomplete_features) {
data += `<strike>Add, change, or remove users</strike><BR>
<spacer type=block width=6 height=6><font size="2"><br>`;
data += `Choose an on-screen keyboard<BR>`;
if (session_data.user_id == 0) {
data += `<spacer type=block width=6 height=5><font size="2"><br>
Add, change, or remove users<BR>`;
}
data += `
data += `<spacer type=block width=6 height=5><font size="2"><br>
Configure Messenger<BR>`;
data += `<spacer type=block width=6 height=6><font size="2"><br>
Connecting to WebTV<BR>

View File

@@ -1,5 +1,5 @@
var minisrv_service_file = true;
var canDoMuzac = ssid_sessions[socket.ssid].hasCap('client-can-do-muzac');
var canDoMuzac = session_data.hasCap('client-can-do-muzac');
headers = `200 OK
Connection: Keep-Alive

View File

@@ -0,0 +1,67 @@
var minisrv_service_file = true;
var userSession = null;
var errpage = null;
if (session_data.user_id != 0) errpage = wtvshared.doErrorPage(400, "You are not authorized to add users to this account.");
// seperate if statements as to not overwrite the first error if multiple occur
if (!errpage) {
if (request_headers.query.user_password) {
if (request_headers.query.user_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.user_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.user_password !== request_headers.query.user_password2) errpage = wtvshared.doErrorPage(400, "The passwords you entered did not match. Please check them and try again.");
}
else if (!request_headers.query.user_name) errpage = wtvshared.doErrorPage(400, "Please enter a username.");
}
if (!errpage) {
if (session_data.getNumberOfUserAccounts() > minisrv_config.config.user_accounts.max_users_per_account) errpage = wtvshared.doErrorPage(400, "You are not authorized to add more than " + minisrv_config.config.user_accounts.max_users_per_account + ` account${minisrv_config.config.user_accounts.max_users_per_account > 1 ? 's' : ''}.`);
}
if (errpage) {
headers = errpage[0];
data = errpage[1];
} else {
if (!request_headers.query.display_name) request_headers.query.display_name = request_headers.query.username;
userSession = new WTVClientSessionData(minisrv_config, socket.ssid);
var freeUserId = session_data.findFreeUserSlot(session_data);
if (freeUserId) {
userSession.user_id = freeUserId;
userSession.setSessionData("subscriber_userid", freeUserId);
userSession.setSessionData("subscriber_name", request_headers.query.display_name);
userSession.setSessionData("subscriber_username", request_headers.query.user_name);
userSession.setSessionData("registered", true);
var mailstore_exists = userSession.mailstore.mailstoreExists();
var mailbox_exists = false;
if (!mailstore_exists) mailstore_exists = userSession.mailstore.createMailstore();
if (mailstore_exists) {
if (!userSession.mailstore.mailboxExists(0)) {
// mailbox does not yet exist, create it
mailbox_exists = userSession.mailstore.createMailbox(0);
}
if (mailbox_exists) {
// Just created Inbox for the first time, so create the welcome message
userSession.mailstore.createWelcomeMessage();
}
}
if (!userSession.saveSessionData(true, true)) {
var errpage = wtvshared.doErrorPage(400);
headers = errpage[0];
data = errpage[1];
} else {
if (request_headers.query.user_password) {
userSession.setUserPassword(request_headers.query.user_password);
userSession.setUserLoggedIn(true);
}
headers = `300 OK
Content-type: text/html
wtv-expire: wtv-setup:/accounts
Location: wtv-setup:/accounts`;
}
}
}
if (userSession) userSession = null;

View File

@@ -0,0 +1,178 @@
var minisrv_service_file = true;
var errpage = null;
if (session_data.user_id != 0) errpage = wtvshared.doErrorPage(400, "You are not authorized to add users to this account.");
// seperate if statements as to not overwrite the first error if multiple occur
if (!errpage) {
if (session_data.getNumberOfUserAccounts() > minisrv_config.config.user_accounts.max_users_per_account) errpage = wtvshared.doErrorPage(400, "You are not authorized to add more than " + minisrv_config.config.user_accounts.max_users_per_account + ` account${minisrv_config.config.user_accounts.max_users_per_account > 1 ? 's' : ''}.`);
}
if (!errpage) {
if (request_headers.query.user_password) {
if (request_headers.query.user_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.user_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.user_password !== request_headers.query.user_password2) errpage = wtvshared.doErrorPage(400, "The passwords you entered did not match. Please check them and try again.");
}
else if (!request_headers.query.user_name) errpage = wtvshared.doErrorPage(400, "Please enter a username.");
}
if (errpage) {
headers = errpage[0];
data = errpage[1];
} else {
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`
data = `<HTML>
<HTML>
<HEAD>
<TITLE>
Adding a user
</TITLE>
<DISPLAY nosave
noscroll>
</HEAD>
<sidebar width=110> <table cellspacing=0 cellpadding=0 BGCOLOR="30364D">
<tr>
<td colspan=3 abswidth=104 absheight=4>
<td rowspan=99 width=6 absheight=420 valign=top align=left>
<img src="ROMCache/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="1C1E28">
<img src="ROMCache/Spacer.gif" width=1 height=1>
<tr><td abswidth=104 absheight=1 valign=top align=left>
<tr><td abswidth=104 absheight=2 valign=top align=left bgcolor="4D5573">
<img src="ROMCache/Spacer.gif" width=1 height=1>
</table>
<tr><td absheight=37>
<tr><td absheight=263 align=right colspan=3>
<img src="ROMCache/AccountBanner.gif" width=53 height=263>
<tr><td absheight=41>
</table>
</sidebar>
<BODY BGCOLOR="#191919" TEXT="#44cc55" LINK="189CD6" VLINK="189CD6" HSPACE=0 VSPACE=0 FONTSIZE="large"
>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=14>
<td abswidth=416 absheight=80 valign=center>
<font size="+2" color="E7CE4A"><blackface><shadow>
Adding a user
<td abswidth=20>
<tr>
<td>
<td absheight=244 valign=top align=left>
<form
action="/validate-add-user-done"
>
<P>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td align=left valign=top abswidth=198>
<table cellspacing=0 cellpadding=0>
<INPUT TYPE="hidden" NAME="display_name" VALUE="${request_headers.query.display_name}">
<INPUT TYPE="hidden" NAME="user_name" VALUE="${request_headers.query.user_name}">
<INPUT TYPE="hidden" NAME="user_password" VALUE="${request_headers.query.user_password}">
<INPUT TYPE="hidden" NAME="user_password2" VALUE="${request_headers.query.user_password2}">
<tr>
<td align=left>
You are adding
<a href="wtv-setup:/add-user-name?
user-human-name-first=Joe&
user-human-name-last=blow&
user-name=xxxxxxx&
user-password=xxxx&
user-password2=xxxx&
restricted-web-access=unrestricted-access&
restricted-chat-access=unrestricted-access&
email-access-denied=&
cant-connect-past-cap=&
review-only='TRUE'">
${request_headers.query.user_name}<br>
</a>
to your account.
<tr>
<td height=11>
<tr>
<td align=left0 abswidth=198 maxlines=2>
Display Name:
<a href="wtv-setup:/add-user-name?
display_name=${request_headers.query.display_name}&
user_name=${request_headers.query.user_name}&
user_password=${request_headers.query.user_password}&
user_password2=${request_headers.query.user_password2}&
review-only=true">
${request_headers.query.display_name || request_headers.query.user_name}
</a>
<tr>
<td height=6>
<tr>
<td align=left abswidth=188 maxlines=2>
</table>
</td>
<td align=left valign=top width=6>
</td>
<td align=left valign=top abswidth=210>
<table cellspacing=0 cellpadding=0>
<tr>
<td colspan=3 align=left>
<a href="wtv-setup:/add-user-password?
display_name=${request_headers.query.display_name}&
user_name=${request_headers.query.user_name}&
user_password=${request_headers.query.user_password}&
user_password2=${request_headers.query.user_password2}">`;
if ((request_headers.query.user_password) == "") {
data += `No password`;
} else {
data += `Has password`;
}
data += `
</a>
</table>
</table>
<td>
<tr>
<td absheight=7>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="2B2B2B">
<img src="ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=1>
<tr>
<td>
<td colspan=2 absheight=2 bgcolor="0D0D0D">
<img src="ROMCache/Spacer.gif" width=426 height=1>
<tr>
<td absheight=4>
</table>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=430 valign=top align=right>
<font color="#E7CE4A" size=-1><shadow>
<input
selected
type=submit borderimage="file://ROM/Borders/ButtonBorder2.bif"
value=Done name="Done" usestyle width=103>
</shadow></font></form>
<td abswidth=20>
</table>
</body>
</html>
`;
}

View File

@@ -1,9 +1,9 @@
if (request_headers.query && ssid_sessions[socket.ssid]) {
var minisrv_service_file = true;
if (request_headers.query && session_data) {
if (request_headers.request_url.indexOf('?') >= 0) {
var category = (request_headers.query.category) ? request_headers.query.category : null;
var WTVBGMusic = require("./WTVBGMusic.js");
var wtvbgm = new WTVBGMusic(minisrv_config, ssid_sessions[socket.ssid])
var music_obj = wtvbgm.getMusicObj();
var old_music_obj = Object.assign({}, music_obj);
@@ -40,8 +40,8 @@ if (request_headers.query && ssid_sessions[socket.ssid]) {
music_obj = Object.assign({}, music_obj)
if ((Object.keys(music_obj.enableCategories).length != Object.keys(old_music_obj.enableCategories).length) || (Object.keys(music_obj.enableSongs).length != Object.keys(old_music_obj.enableSongs).length)) {
// something changed
ssid_sessions[socket.ssid].setSessionData("wtv-bgmusic", music_obj);
ssid_sessions[socket.ssid].saveSessionData();
session_data.setSessionData("wtv-bgmusic", music_obj);
session_data.saveSessionData();
headers = `200 OK
Content-type: text/html
wtv-backgroundmusic-load-playlist: wtv-setup:/get-playlist`;

View File

@@ -0,0 +1,39 @@
var minisrv_service_file = true;
session_data.loadSessionData();
var user_id = (request_headers.query.user_id) ? request_headers.query.user_id : session_data.user_id;
// security
if (session_data.user_id != 0 && session_data.user_id != request_headers.query.user_id) {
user_id = null; // force unset
var errpage = wtvshared.doErrorPage(400, "You are not authorized to change the selected user's password.");
headers = errpage[0];
data = errpage[1];
}
if (user_id != null) {
var userSession;
if (session_data.user_id == request_headers.query.user_id) userSession = session_data;
else {
userSession = new WTVClientSessionData(minisrv_config, socket.ssid);
userSession.user_id = user_id;
}
if (!userSession.loadSessionData()) {
var errpage = wtvshared.doErrorPage(400, "Invalid user ID.");
headers = errpage[0];
data = errpage[1];
}
else {
var user_name = userSession.getSessionData('subscriber_username');
userSession.setSessionData('subscriber_name', (request_headers.query.display_name) ? request_headers.query.display_name : user_name);
userSession.saveSessionData();
headers = `300 OK
Content-type: text/html
wtv-expire: wtv-setup:/edit-user-begin?user_id=${user_id}
wtv-expire: wtv-setup:/edit-user-name?user_id=${user_id}
Location: wtv-setup:/edit-user-begin?user_id=${user_id}`;
}
}
if (userSession) userSession = null;

View File

@@ -0,0 +1,80 @@
var minisrv_service_file = true;
var userSession = null;
session_data.loadSessionData();
var user_id = null;
if (request_headers.query.user_id) {
user_id = request_headers.query.user_id;
} else {
var errpage = doErrorPage(400, "User was not specified.");
headers = errpage[0];
data = errpage[1];
}
if (session_data.user_id != 0 && session_data.user_id != request_headers.query.user_id) {
user_id = null; // force unset
var errpage = doErrorPage(400, "You are not authorized to edit the selected user.");
headers = errpage[0];
data = errpage[1];
}
if (user_id && !errpage) {
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`
var userSession = null;
if (session_data.user_id == request_headers.query.user_id) userSession = session_data;
else {
userSession = new WTVClientSessionData(minisrv_config, socket.ssid);
userSession.user_id = user_id;
}
if (!userSession.loadSessionData()) {
var errpage = doErrorPage(400, "Invalid user ID.");
headers = errpage[0];
data = errpage[1];
}
else {
if (request_headers.query.password.length == 0 && request_headers.query.verify.length == 0) {
userSession.disableUserPassword();
headers = `300 OK
Content-type: text/html
wtv-expire: wtv-setup:/setup
`;
if (request_headers.query.return_to) {
headers += `wtv-expire: ${request_headers.query.return_to}
Location: ${request_headers.query.return_to}`;
}
else headers += "Location: " + (session_data.user_id === user_id) ? 'wtv-setup:/setup' : 'wtv-setup:/accounts';
}
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 (errpage) {
headers = errpage[0];
data = errpage[1];
} else {
userSession.setUserPassword(request_headers.query.password);
userSession.setUserLoggedIn(true);
headers = `300 OK
Content-type: text/html
wtv-expire: wtv-setup:/setup
`;
if (request_headers.query.return_to) {
headers += `wtv-expire: ${request_headers.query.return_to}
Location: ${request_headers.query.return_to}`;
}
else headers += "Location: "+ (session_data.user_id === user_id) ? 'wtv-setup:/setup' : 'wtv-setup:/accounts';
}
}
}
}
if (errpage) {
headers = errpage[0];
data = errpage[1];
}
if (userSession) userSession = null;

View File

@@ -1,6 +1,8 @@
if (request_headers.query && ssid_sessions[socket.ssid]) {
ssid_sessions[socket.ssid].setSessionData("subscriber_signature", (request_headers.query.mail_signature) ? request_headers.query.mail_signature : "");
ssid_sessions[socket.ssid].saveSessionData();
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();
headers = `200 OK
Content-type: text/html`
} else {

View File

@@ -0,0 +1,24 @@
var minisrv_service_file = true;
var errpage;
if (request_headers.query.email.length < 2) errpage = wtvshared.doErrorPage(400, "Your User Name includes at least 2 characters.");
else if (request_headers.query.email.length > 16) errpage = wtvshared.doErrorPage(400, "Your User Name includes less than 17 characters.");
else if (request_headers.query.password.length < 8) errpage = wtvshared.doErrorPage(400, "Your password includes at least 8 characters.");
else if (request_headers.query.password.length > 20) errpage = wtvshared.doErrorPage(400, "Your password includes less than 21 characters.");
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 any try again.");
if (errpage) {
headers = errpage[0];
data = errpage[1];
} else {
var encryptedpass = session_data.encryptPassword(request_headers.query.password);
session_data.setSessionData("messenger_password", encryptedpass);
session_data.setSessionData("messenger_email", request_headers.query.email);
session_data.setSessionData("messenger_domain", request_headers.query.domain);
session_data.saveSessionData();
headers = `300 OK
wtv-expire-all: wtv-setup:/messenger-account
wtv-expire-all: wtv-setup:/validate-messenger-account
Location: wtv-setup:/messenger`
}

View File

@@ -0,0 +1,75 @@
var minisrv_service_file = true;
var errpage;
if (Object.keys(session_data.listPrimaryAccountUsers()).length == 1) {
errpage = wtvshared.doErrorPage(400, "There are no more users to remove.");
}
else if (session_data.user_id != 0) errpage = wtvshared.doErrorPage(400, "You are not authorized to remove users from this account.");
var usersToRemove = [];
Object.keys(request_headers.query).forEach(function (k) {
if (k.substr(0, 4) === "user" && request_headers.query[k] === "on") {
usersToRemove.push(parseInt(k.replace("user", "")));
}
});
if (usersToRemove.length === 0) errpage = wtvshared.doErrorPage(400, "No users were specified for removal.");
if (errpage) {
headers = errpage[0];
data = errpage[1];
} else {
if (!request_headers.query.confirm_remove) {
var message = '';
if (usersToRemove.length == 1) {
var userSession = new WTVClientSessionData(minisrv_config, socket.ssid);
userSession.switchUserID(usersToRemove[0]);
var userName = userSession.getSessionData("subscriber_username");
message = `Removing <b>${userName}</b> will permanently remove all of <b>${userName}</b>'s e-mail and favorites as well. You will not be able to restore <b>${userName}</b>.`;
} else {
message = "Removing the selected users will permanently remove their e-mail and favorites as well. You will not be able to restore the users.";
}
var removeurl = request_headers.request_url;
if (removeurl.indexOf('?') >= 0) {
removeurl = removeurl.substring(0, removeurl.indexOf('?'));
}
removeurl += "?";
Object.keys(usersToRemove).forEach(function (k) {
removeurl += "user" + usersToRemove[k] + "=on&";
});
removeurl += "confirm_remove=true";
var confirmAlert = new clientShowAlert({
'image': minisrv_config.config.service_logo,
'message': message,
'buttonlabel1': "Don't Remove",
'buttonaction1': "client:donothing",
'buttonlabel2': "Remove",
'buttonaction2': removeurl,
'noback': true,
}).getURL();
headers = `300 OK
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) {
session_data.removeUser(usersToRemove[k]);
})
var num_accounts = session_data.getNumberOfUserAccounts();
var gourl = "wtv-setup:/remove-users?";
if (num_accounts == 1) gourl = "wtv-setup:/accounts?";
headers = `300 OK
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

@@ -1,3 +1,5 @@
var minisrv_service_file = true;
if (request_headers.query) {
if (request_headers.query.shade) {
headers = `300 OK