- 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
81 lines
4.8 KiB
JavaScript
81 lines
4.8 KiB
JavaScript
var minisrv_service_file = true;
|
|
|
|
if (!request_headers.query.registering) {
|
|
var errpage = wtvshared.doErrorPage(400);
|
|
headers = errpage[0];
|
|
data = errpage[1];
|
|
} else {
|
|
const WTVRegister = require(classPath + "/WTVRegister.js")
|
|
var wtvr = new WTVRegister(minisrv_config, SessionStore);
|
|
var errpage = null;
|
|
if (!request_headers.query.registering) errpage = wtvshared.doErrorPage(400);
|
|
else if (!request_headers.query.subscriber_name) errpage = wtvshared.doErrorPage(400, "Please enter your name. This can be your real name, or your well-known online alias.");
|
|
else if (!request_headers.query.subscriber_username) errpage = wtvshared.doErrorPage(400, "Please enter a username.");
|
|
else if (request_headers.query.subscriber_username.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.subscriber_username.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.subscriber_username)) 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.subscriber_username)) errpage = wtvshared.doErrorPage(400, "The username you have selected is already in use. Please select another username.");
|
|
else if (!request_headers.query.subscriber_contact) errpage = wtvshared.doErrorPage(400, "Please enter your contact information.");
|
|
else if (request_headers.query.subscriber_contact_method == "") errpage = wtvshared.doErrorPage(400, "Please select the type of contact information you provided.");
|
|
|
|
|
|
if (errpage) {
|
|
headers = errpage[0];
|
|
data = errpage[1];
|
|
} else {
|
|
|
|
headers = `200 OK
|
|
wtv-noback-all: wtv-register:
|
|
Content-Type: text/html`;
|
|
var title = "Account Review";
|
|
var isOldBuild = wtvshared.isOldBuild(session_data);
|
|
var main_data = '';
|
|
if (!isOldBuild) main_data += `<table cellspacing=0 cellpadding=0 border=0 width=560 bgcolor=#171726>
|
|
<tr><td>`;
|
|
|
|
main_data += `<form ACTION="ValidateReviewAccountInfo" ENCTYPE="x-www-form-encoded" METHOD="POST">
|
|
<input type=hidden name=registering value="true">
|
|
<input type=hidden name=subscriber_name value="${request_headers.query.subscriber_name}">
|
|
<input type=hidden name=subscriber_username value="${request_headers.query.subscriber_username}">
|
|
<input type=hidden name=subscriber_contact value="${request_headers.query.subscriber_contact}">
|
|
<input type=hidden name=subscriber_contact_method value="${request_headers.query.subscriber_contact_method}">
|
|
<td height=50 width=300 colspan=6 valign=top align=left>
|
|
<br>
|
|
Here is your account information. If you need to<br>
|
|
correct an item, press <b>Back</b>.<p>`;
|
|
if (isOldBuild) main_data += "<table>";
|
|
|
|
main_data += `<tr>
|
|
<td width=260 valign=top align=left colspan=4>
|
|
<table cellspacing=0 cellpadding=0 border=0 >
|
|
<img src="images/arrow.gif"> <font size=-2><b>NAME</b></font><br>
|
|
<tt><font color=#d1d3d3 size=-2><spacer type=horizontal size=17> ${request_headers.query.subscriber_name}</font></tt></a>
|
|
</table>
|
|
<p>
|
|
<table cellspacing=0 cellpadding=0 border=0>
|
|
<img src="images/arrow.gif"> <font size=-2><b>CONTACT</b></font><br>
|
|
<tt><font color=#d1d3d3 size=-2><spacer type=horizontal size=17> ${request_headers.query.subscriber_contact}</font></tt></a>
|
|
</table>
|
|
</TD>
|
|
<td abswidth=200 valign=top align=left>
|
|
<table cellspacing=0 cellpadding=0 border=0> <TR><TD>
|
|
<img src="images/arrow.gif"><font size=-2> <b>USERNAME</b></font><br>
|
|
<tr><td maxlines=1 >
|
|
<tt><font color=#d1d3d3><spacer type=horizontal size=17>${request_headers.query.subscriber_name}</font></tt></a>
|
|
</table>
|
|
<p>
|
|
<table cellspacing=0 cellpadding=0 border=0>
|
|
<img src="images/arrow.gif"> <font size=-2><b>CONTACT TYPE</b></font><br>
|
|
<tt><font color=#d1d3d3 size=-2><spacer type=horizontal size=17>${request_headers.query.subscriber_contact_method}</font></tt>
|
|
</table> <P> <P>
|
|
<td abswidth=20>
|
|
</tr>`;
|
|
if (isOldBuild) main_data += '</table>';
|
|
var form_data = `<shadow>
|
|
<input selected Value="Sign Up" name="Sign Up" width="110" type=submit Value=Continue name="Continue" borderimage="file://ROM/Borders/ButtonBorder2.bif" text="#dddddd">
|
|
</shadow>
|
|
</font>
|
|
</form>`;
|
|
data = wtvr.getHTMLTemplate(title, main_data, form_data, isOldBuild);
|
|
}
|
|
} |