<!DOCTYPE HTML>
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Secure24 Sales Management System - Administration Interface</title>
	<meta name="ROBOTS" content="NOINDEX, NOFOLLOW"/>
	<link type="text/css" rel="stylesheet" href="getFile.php?type=css&amp;file=index%2Ecss%2Cform%2Ecss" />
	<script type="text/javascript" src="getFile.php?type=js&amp;file=index%2Ejs%2Cprototype%2Ejs%2Cstyle%2Ejs"></script>
</head>
<body>
<div id="center">
	<div id="box" name="box">
		<div id="box_internal">

			<div style="position:relative;width:300px;height:150px">
				<div style="font-size:12px;color:#ff6600;font-weight:bold;position:absolute;bottom:5px;left:0px;width:300px;text-align:center;text-shadow:0px 0px 10px white;text-shadow:0px 0px 10px white, 0px 0px 10px white;"></div>
			</div>
			<style type="text/css">
				/* Keep the box the full height of its background artwork (images/login_image.png is 360x364). */
				#box { min-height:362px; }
				/* The two sign-in choices sit where the email form sits, so the box keeps one size. */
				#ssoChoices { display:flex; flex-direction:column; justify-content:center; gap:16px; height:176px; }
				/* Microsoft identity branding, light theme (learn.microsoft.com: howto-add-branding-in-apps);
				   the label is centred with the logo for looks. The email button copies the size and style. */
				.s24SignInBtn { display:flex; align-items:center; justify-content:center; box-sizing:border-box; width:300px; height:41px; margin:0 auto; padding:0 12px;
					background:#FFFFFF; border:1px solid #8C8C8C; border-radius:0; color:#5E5E5E; text-decoration:none; cursor:pointer;
					font-family:'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
					font-size:15px; font-weight:600; }
				.s24SignInBtn:hover { background:#F3F3F3; }
				.s24SignInBtn:focus { outline:2px solid #5E5E5E; outline-offset:1px; }
				.s24SignInBtn svg { flex:0 0 21px; margin-right:12px; }
				#msBackLink { float:left; margin:10px 5px; font-size:12px; color:#5E5E5E; }
			</style>
			<div id="ssoChoices">
				<a id="msSignIn" class="s24SignInBtn" href="/auth/microsoft/start.php" target="_top" onclick="return s24MsSignIn();"><svg xmlns="http://www.w3.org/2000/svg" width="21" height="21" viewBox="0 0 21 21" aria-hidden="true" focusable="false"><rect x="0" y="0" width="10" height="10" fill="#F25022"/><rect x="11" y="0" width="10" height="10" fill="#7FBA00"/><rect x="0" y="11" width="10" height="10" fill="#00A4EF"/><rect x="11" y="11" width="10" height="10" fill="#FFB900"/></svg><span>Sign in with Microsoft</span></a>
				<a id="emailSignInToggle" class="s24SignInBtn" href="index.php?email=1" onclick="return s24ShowEmailSignIn();"><svg xmlns="http://www.w3.org/2000/svg" width="21" height="21" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="2" y="4.5" width="20" height="15" rx="1.5" fill="none" stroke="#ff6600" stroke-width="2"/><path d="M2.8 6l9.2 7 9.2-7" fill="none" stroke="#ff6600" stroke-width="2" stroke-linejoin="round"/></svg><span>Sign in with email code</span></a>
			</div>
			
			<form style="width:300px;margin:auto;display:none;" id="emailSignIn" method="post" action="./" onSubmit="return check_form();">
				<label for="Username">Username</label>
				<input type="text" id="Username" autofocus="autofocus" name="Username" value="" autocomplete="off"/>
				
				<label for="Password">Password</label>
				<input type="password" id="Password"  name="Password" autocomplete="off">
				
				<input type="hidden" name="LoginSubmit" value="1">
				<input type="hidden" name="session" value="80e4c66647595e4e5fd7235036701e4b">
				<input type="hidden" name="TimeZoneOffset" id="TimeZoneOffset" value="INVALID">
				<input type="hidden" name="TimeZoneAbrv" id="TimeZoneAbrv" value="INVALID">
				<input type="hidden" name="ClientScreen" id="ClientScreen" value="">
				<input type="hidden" name="ClientTZ" id="ClientTZ" value="">
				<input type="hidden" name="ClientLang" id="ClientLang" value="">
				<a id="msBackLink" href="index.php" onclick="return s24ShowSsoChoices();">&larr; Sign in with Microsoft</a>
				<div  xtitle="Sign in" onclick="SubmitForm(this);" class="has_icon Button"><div style="background-image:url(images/icons/bullet_go.png);" class="ButtonInternal"><input onclick="return false;" type="submit" value="Sign in" />Sign in</div></div>				<div style="clear:both;"></div>
			</form>
			
		</div>
	</div>
</div>
<script type="text/javascript">
	// PROJ-371: browser facts for the LoginEvent audit row (screen, IANA time zone, language) and the
	// same clock reading the email form sends, so an SSO session gets the same TimeZoneOffset.
	function s24ClientInfo() {
		var d = new Date(), o = {};
		try { o.TimeZoneOffset = (d.getMonth() + 1) + '~' + d.getDate() + '~' + d.getFullYear() + '~' + d.getHours() + '~' + d.getMinutes() + '~' + d.getSeconds(); } catch (e) {}
		try { o.TimeZoneAbrv = d.format('Z'); } catch (e) {}
		try { o.ClientScreen = screen.width + 'x' + screen.height + '@' + (window.devicePixelRatio || 1); } catch (e) {}
		try { o.ClientTZ = Intl.DateTimeFormat().resolvedOptions().timeZone || ''; } catch (e) {}
		try { o.ClientLang = navigator.language || ''; } catch (e) {}
		return o;
	}
	function s24StartUrl(silent) {
		var o = s24ClientInfo(), q = [];
		if (silent) q.push('silent=1');
		for (var k in o) if (o.hasOwnProperty(k) && o[k] !== undefined) q.push(k + '=' + encodeURIComponent(o[k]));
		return '/auth/microsoft/start.php?' + q.join('&');
	}
	function s24MsSignIn() {
		var u = s24StartUrl(false);
		// never sign in inside a frame: if the top window cannot be navigated, open a new window instead
		try { window.top.location.href = u; } catch (e) { try { window.open(u, '_blank'); } catch (e2) {} }
		return false;
	}
	function s24ShowEmailSignIn() {
		var f = document.getElementById('emailSignIn');
		if (!f) return true;
		try { document.getElementById('ssoChoices').style.display = 'none'; } catch (e) {}
		f.style.display = '';
		try { document.getElementById('Username').focus(); } catch (e) {}
		return false;
	}
	function s24ShowSsoChoices() {
		var c = document.getElementById('ssoChoices'), f = document.getElementById('emailSignIn');
		if (!c || !f) return true;
		f.style.display = 'none';
		c.style.display = '';
		return false;
	}
	(function () {
		var o = s24ClientInfo();
		try { document.getElementById('ClientScreen').value = o.ClientScreen || ''; } catch (e) {}
		try { document.getElementById('ClientTZ').value = o.ClientTZ || ''; } catch (e) {}
		try { document.getElementById('ClientLang').value = o.ClientLang || ''; } catch (e) {}
	})();
	// Silent sign-in: ONLY in the top window (never in an iframe / desktop tab; a cross-origin frame
	// counts as framed), and at most once per browser tab per minute even if the cookie guard is lost.
	(function () {
		var isTop = false;
		try { isTop = (window.top === window.self); } catch (e) { isTop = false; }
		if (!isTop) return;
		try {
			var last = parseInt(sessionStorage.getItem('s24SsoSilentAt') || '0', 10);
			if (last && (new Date().getTime() - last) < 60000) return;
			sessionStorage.setItem('s24SsoSilentAt', String(new Date().getTime()));
		} catch (e) {}
		location.replace(s24StartUrl(true));
	})();
</script>

</body></html>
