v0.9.33
- 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:
165
zefie_wtvp_minisrv/ServiceVault/wtv-setup/remove-users.js
Normal file
165
zefie_wtvp_minisrv/ServiceVault/wtv-setup/remove-users.js
Normal 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>
|
||||
`;
|
||||
}
|
||||
Reference in New Issue
Block a user