
<!-- saved from url=(0019)http://192.168.0.1/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" type="text/css" href="pn.css">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<script src="jquery-2.0.3.min.js"></script>
<script language="javascript" src="util.js"></script>      
<script language="javascript" src="gibberish-aes.js"></script>
<script type="text/javascript" src="jsencrypt.min.js"></script>
<title>Wi-Fi 6 Gateway - Login</title>
<style>
	form {
		position: absolute;
        width: 100%;
        height: 510px;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
	}
</style>
<script language="javascript">
<!-- hide me

top != self && (top.location = self.location);

window.sessionStorage.removeItem("id");
window.sessionStorage.removeItem("historyItemURL");
window.sessionStorage.removeItem("historyFolderURL");

if( ("<%ejGetOther(sysInfo,supportPhone)%>"=="1") && /(iPhone|iPod|Android|ios|SymbianOS)/i.test(navigator.userAgent)) 
{
      location.href = "MobileLogin.html";
}


var supportOpensslAES = '<%ejGetOther(sysInfo, supportOpensslAES)%>';
var DeviceProject = "<%ejGetOther(sysInfo,DeviceProject)%>";
var UserNameFlag = 0;
var PasswordFlag = 0;
var sessionKey='<%ejGetOther(sessionKey)%>'; 
var PUBLIC_KEY = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv47uL0SnPFkmUinq3R6JMLR9dcGd5MgfuBAfKfjkpdGFim1ISYxGjaV0+FK6A+fpUrsYO2zVEnZVyhvVRAGyp4W+r86yLPLRQsIviD0C08faExQqEAPTMU3hQTrKzUvKgM5V9+NjRTtTWVHxI71pnYuOvcIA8VSj6Im/pgn33xeQmbsQD1H227OHuDjV6DmTTLWuz31A3HqU690UqRlW+h8dB2s25SefvpR+ijdfqDPWT+c+4tNMKPUQjDUB41hICPTmPORhFJqioFaZzCuElct2bYpdjps3Vv4AGYAgduuBJ2z/az3nb4OtHPh6/2bVpX5S5tBgo9WEJgvjPFRdwwIDAQAB';
function RndNum(n){
	var rnd="";
	for(var i=0;i<n;i++)
		rnd+=Math.floor(Math.random()*10);
	return(rnd);
}
function onFocusUsername()
{
	window.document.login.loginUsername.className = "pn-username-input-active";
	window.document.login.loginUsername.value = "";
}

function onBlurUsername()
{
	if(window.document.login.loginUsername.value == "")
	{
		window.document.login.loginUsername.className = "pn-username-input";
		window.document.login.loginUsername.value = "Username";
	}
	else
	{
		UserNameFlag = 1;
	}
}

function onFocusPassword()
{
	window.document.login.loginText.style.display = 'none';
	window.document.login.loginPassword.style.display = '';
	window.document.login.loginPassword.focus();
/*
	window.document.login.loginPassword.className = "pn-password-input-active";
	window.document.login.loginPassword.value = "";
	window.document.login.loginPassword.type = "password";
*/
}

function onBlurPassword()
{
	if(window.document.login.loginPassword.value == "")
	{
		window.document.login.loginPassword.style.display = 'none';
		window.document.login.loginText.style.display = '';
		

	}
	else
	{
		PasswordFlag = 1;
	}
/*
	if(window.document.login.loginPassword.value == "")
	{
		window.document.login.loginPassword.className = "pn-password-input";
		window.document.login.loginPassword.value = "Password";
		window.document.login.loginPassword.type = "text";
	}
	else
	{
		PasswordFlag = 1;
	}
*/
}


function loginApply() {
	with ( document.forms[0] ) {
		var Svalue = RndNum(117);
		var user = loginUsername.value;
		var user_login = "";
		var temp = loginPassword.value;
		var encrypted_pwd = "";

		if(loginUsername.value.length <= 0) {
			alert("Please input the username!");
			return;
		}

		if(! RefreshSessionKey())
		{
			return;
		}

		if(1 == supportOpensslAES)
		{
			var encrypt = new JSEncrypt();
			encrypt.setPublicKey('-----BEGIN PUBLIC KEY-----' + PUBLIC_KEY + '-----END PUBLIC KEY-----');
			var encrypted = encrypt.encrypt(Svalue);
			
			GibberishAES.size(256);

			var encdata = GibberishAES.enc(temp,Svalue);
			encrypted_pwd = base64encode(encdata.toString());

     			var userdata = GibberishAES.enc(user,Svalue);
			user_login = base64encode(userdata.toString());
		}
		else
		{
			encrypted_pwd = base64encode(temp);
		}
		
		var loc = "main.html";
	
		var code = 'location="' + loc + '"';
		eval(code);
	}
}

   function SpaceDown(e){
   		e=e||event;
   		if(e.keyCode==13){
   		var button = document.getElementById('btn');
      		button.onclick();
      		return false;
   	}
   }

   var rsk_lastTime = new Date();
   var rsk_isRunig = false;
   function RefreshSessionKey()
   {
		var t = new Date();
		if(t.getTime() - rsk_lastTime.getTime() > 60*1000)
		{
			if(!rsk_isRunig){
				rsk_isRunig = true;
				sendAction("login.html").done(function(result){
						sessionKey = getValueByName(result,"sessionKey");
						rsk_lastTime = new Date();
						document.getElementById('btn').onclick();
				})
				.then(function(){
					rsk_isRunig = false;
				})
			}
			return false;
		}
		else
			return true;   
   }

   document.onkeydown = SpaceDown;
// show me -->

</script>
</head>

<body>

<form  name="login">
<div id="pn-login">
  <div id="pn-login-logo">
       <img src="NetComm_Logo_RGB_White.png" width="400px">
  </div>
<script language="javascript">
	if(DeviceProject == "2" ) {
		document.writeln("<div id='pn-login-logo'>");
		document.writeln("<img src='login_logo.png' width='400px'>");
		document.writeln("</div>");
		
		document.writeln("<div id='pn-login-welcome'>");
		document.writeln("<span class='pn-login-welcome-text'>Vodafone Wi-Fi Hub 2.0</span>");
		document.writeln("</div>");
	}
	else {
		document.writeln("<div id='pn-login-welcome'>");
		document.writeln("<span class='pn-login-welcome-text'>Welcome to your Wi-Fi 6 Gateway</span>");
		document.writeln("</div>");
	}
</script>

<div id="pn-username">
<input class="pn-username-input" type="text" name="loginUsername" onKeydown="SpaceDown()" onfocus="onFocusUsername()" onblur="onBlurUsername()" value="Username">
</div>

<div id="pn-password">
<input class="pn-password-input" type="text"  name="loginText"  onfocus="onFocusPassword();" value="Password">
<input class="pn-password-input-active" type="password" name="loginPassword" onblur="onBlurPassword();" value="" style="display:none" >
</div>

<div id="pn-note">
<span class="pn-note-text">&nbsp;&nbsp;</span>
</div>

<div id="pn-button">
<input class="pn-login-button"  type="button" id="btn"name="" value="Login" onclick="loginApply()">
</div>

<script language="javascript">
	if(DeviceProject == '2') {
		document.writeln("<div id='pn-note'>");
		document.writeln("<span class='pn-note-text'>You can find your dashboard username and password on your device's label.</span>");
		document.writeln("</div>");
	}
	else {
		document.writeln("<div id='pn-note'>");
		document.writeln("<span class='pn-note-text'>You can find your username and password on the Wi-Fi 6 Gateway's label.</span>");
		document.writeln("</div>");
	}
</script>

</div>
</form>

<!--
#CE0000
2001-2015 Broadcom Corporation
-->





</body></html>
