somewhat guest login

This commit is contained in:
zefie
2026-05-02 10:15:24 -04:00
parent 4f20c08ed0
commit 92958e4c64
18 changed files with 155 additions and 281 deletions

View File

@@ -15,7 +15,7 @@ if (BoxId) {
} else {
sessionId = encodeSessionID(BoxId);
}
} else if (request_headers.cookie.SessionID) {
} else if (request_headers.cookie && request_headers.cookie.SessionID) {
BoxID = decodeSessionID(request_headers.cookie.SessionID);
sessionId = request_headers.cookie.SessionID;
} else {
@@ -77,6 +77,7 @@ data = `<html>
try {
var tvShell = new ActiveXObject("MSNTV.TVShell");
var sink = new ActiveXObject("MSNTV.MultipleEventSink");
function getIDCRLCode(value) {
return value & 0xFFFF;
}
@@ -89,6 +90,12 @@ data = `<html>
var banned = ${banned}; // JavaScript boolean value
if (!banned) {
var BuiltinServiceList = tvShell.BuiltinServiceList;
var entry = BuiltinServiceList.Add("connection::login");
entry.URL = "https://headwaiter.trusted.msntv.msn.com/connection/boxcheck.html?BoxId=${BoxId}";
}
function DoLogin() {
var currentUser = tvShell.UserManager.CurrentUser;
@@ -184,7 +191,7 @@ data = `<html>
}
function GoToUserCheck() {
var url = banned ? 'https://sg1.trusted.msntv.msn.com/connection/banned.html' : 'https://sg1.trusted.msntv.msn.com/connection/usercheck.aspx';
var url = banned ? 'https://headwaiter.trusted.msntv.msn.com/connection/banned.html' : 'https://headwaiter.trusted.msntv.msn.com/connection/login.aspx';
var myPanel = tvShell.PanelManager.Item('service');
if (myPanel) myPanel.GotoURL(url);
}

View File

@@ -27,7 +27,7 @@ data = `<HTML>
}
}
function GotoBoxCheck() {
var url = 'https://sg1.trusted.msntv.msn.com/connection/boxcheck.html';
var url = 'https://headwaiter.trusted.msntv.msn.com/connection/boxcheck.html';
var parms='';
parms += 'BoxId=' + tvShell.SystemInfo.BoxIDService + '&';
parms += 'WANProvider=' + tvShell.ConnectionManager.WANProvider + '&';
@@ -67,7 +67,7 @@ data = `<HTML>
}
else {
tvShell.MeteringManager.Stop();
SetProgress('Hello, New User.', 10);
SetProgress('Please wait while we sign you into MSN TV.', 10);
GotoBoxCheck();
}
</script>

View File

@@ -0,0 +1,32 @@
const minisrv_service_file = true;
// Todo: auth if not guest
headers = `Content-type: text/html`;
data = `<html>
<head>
<title id="title"></title>
</head>
<body>
<iframe id="checkmail" style="display:none"></iframe>
<script language="javascript">
var tvShell = new ActiveXObject("MSNTV.TVShell");
var UserManager = tvShell.UserManager;
var home = "https://sg1.trusted.msntv.msn.com/Home/Home.aspx";
tvShell.ConnectionManager.ServiceState = 'Authorized';
UserManager.SetCurrentUserIsAuthorized(true);
var currentUser = UserManager.CurrentUser;
if (currentUser != null) {
currentUser.IsAuthorized = true;
}
var myPanel = tvShell.PanelManager.Item('main');
if (myPanel) {
myPanel.ClearTravelLog();
myPanel.NoBackToMe = true;
myPanel.GotoURL(home);
}
</script>
</body>
</html>`;

View File

@@ -11,13 +11,43 @@ headers = `Status: 200 OK
Content-type: text/html`;
data = `<HTML xmlns:msntv>
<?import namespace="msntv" implementation="https://sg1.trusted.msntv.msn.com/HTC/CustomButton.htc">
<?import namespace="msntv" implementation="https://sg1.trusted.msntv.msn.com/Include/HTC/Shared/CustomButton.htc">
<HEAD>
<title id="title">Login to Passport</title>
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<link rel="stylesheet" type="text/css" href="msntv:/Registration/css/Registration.css">
<script src="/Include/2.0.261.778/localhost-1700/Shared/BaseClient/JsTransforms/en-us/PaneHelp.js" language="javascript" defer="true"></script>
<script src="/Include/2.0.261.778/localhost-1700/Shared/Anduril/JsTransforms/en-us/Scripts.js" language="javascript"></script>
<script src="msntv:/Javascript/TVShell.js" language="javascript"></script>
<script src="msntv:/Javascript/GuestUser.js" language="javascript"></script>
<script src="msntv:/Javascript/ServiceList.js" language="javascript"></script>
<script language="javascript">
function handleGuest() {
if (!GuestUserExists()) {
InitializeGuestMode();
var PersistentProperties = TVShell.Property("Persistent/");
if (!PersistentProperties) {
return;
}
PersistentProperties.Add("GuestMode", "Guest");
PersistentProperties.Save();
AddGuestUser();
var signon = TVShell.BuiltinServiceList.Item("SignOn");
var panel = TVShell.PanelManager.FocusedPanel;
var atLogin = false;
if ( signon && panel && panel.Name == "main" )
{
if ( IsMainPanelOnPage( signon.URL ) ) atLogin = true;
}
}
if (!atLogin) {
GotoSignOn();
}
}
</script>
<STYLE>
body {
background-image: url(msntv:/Registration/images/bgimage.jpg);
@@ -46,8 +76,13 @@ data = `<HTML xmlns:msntv>
<tr style="margin: 0; padding: 0; top: 2px; position: relative;">
<td style="margin: 0; padding: 0; vertical-align: middle; top: 2px; position: relative;"><img src="msntv:/Shared/Images/BulletCustom.gif" height="14" width="7" alt="Bullet"></td>
<td style="margin: 0; padding: 0; width: 4px;"></td>
<td style="margin: 0; padding: 0; font:bold 18; line-height: 20px;"><a class="shrLnk2" href="/Register/minisrv-import.asx" style="display: inline-block; line-height: 20px;">I want to use my existing minisrv account</a> (TODO)</td>
<td style="margin: 0; padding: 0; font:bold 18; line-height: 20px;"><a class="shrLnk2" href="/Register/Login-to-WebTV.aspx" style="display: inline-block; line-height: 20px;">I want to use my existing minisrv account</a> (TODO)</td>
</tr>
<tr style="margin: 0; padding: 0; top: 2px; position: relative;">
<td style="margin: 0; padding: 0; vertical-align: middle; top: 2px; position: relative;"><img src="msntv:/Shared/Images/BulletCustom.gif" height="14" width="7" alt="Bullet"></td>
<td style="margin: 0; padding: 0; width: 4px;"></td>
<td style="margin: 0; padding: 0; font:bold 18; line-height: 20px;"><a class="shrLnk2" onclick="handleGuest()" style="display: inline-block; line-height: 20px;">I want to sign in as a guest</a></td>
</tr>
</table>
</div>
</DIV>

View File

@@ -76,17 +76,16 @@ data = `<html xmlns:msntv>
<script>
var tvShell = new ActiveXObject("MSNTV.TVShell");
tvShell.UserManager.SetCurrentUserIsAuthorized(true);
tvShell.ConnectionManager.ServiceState = 'Authorized';
tvShell.UserManager.SetCurrentUserIsAuthorized(false);
function AddUser() {
var user = tvShell.UserManager.AddNew("${username}");
if (user) {
user.IsPersistent = false;
user.IsPersistent = true;
} else {
user = tvShell.UserManager.Item("${username}");
if (user && user.IsPersistent) {
if (user && !user.IsPersistent) {
user.IsPersistent = true;
}
}

View File

@@ -32,17 +32,20 @@ data = `<HTML xmlns:msntv>
<BODY width="520" height="388">
<DIV id="title">Logging into your account</DIV>
<DIV id="main">
<p>When using MSN TV, you will be using your webtv.net account
to sign in. If you already have a email to WebTV, you can
use it with MSN TV. If not, you will have to use a Hotmail or MSN address.</p>
<p>When using MSNTV2, you can access the same minisrv account as your WebTV.</p>
<br>
<p>Type your WebTV e-mail in the box below:</p>
<p>Type your existing primary username in the box below:</p>
<div class="input-container">
<textarea name="textarea1" id="textarea1" rows="1" cols="15"></textarea>
<p style="display: inline;">@webtv.net</p>
<textarea name="username" id="username" rows="1" cols="15"></textarea>
<p style="display: inline;">@${minisrv_config.config.service_name}</p>
</div>
<br>
<a>If you don't have a WebTV account, select the <EM>Back</EM> Button.</a>
<div class="input-container">
<textarea name="password" id="password" rows="1" cols="15"></textarea>
</div>
<br>
If you don't have an existing minisrv account, select the <EM>Back</EM> Button.
If you do not have a password set on your primary user account, you will need to set one up on your WebTV before you can log in here. After entering your username and password, select the <EM>Continue</EM> Button.
</DIV>
<div id="footer">
<msntv:CustomButton id="continue" label="Continue" href="/Register/ConnectionType.aspx"/>