2018-05-22 02:36:51 +03:00
<!DOCTYPE html>
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
2020-06-13 00:16:24 +03:00
<head lang="en">
2020-05-27 02:36:17 +03:00
<meta charset="utf-8">
2018-05-22 02:36:51 +03:00
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
<meta name="format-detection" content="telephone=no" />
2020-10-29 00:46:40 +03:00
<meta name="robots" content="noindex,nofollow">
2020-05-27 02:36:17 +03:00
<link rel="manifest" href=" {{{ domainurl }}} manifest.json">
<link rel="shortcut icon" href=" {{{ domainurl }}} favicon.ico" />
<link rel="icon" type="image/png" sizes="16x16" href=" {{{ domainurl }}} favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href=" {{{ domainurl }}} favicon-32x32.png">
2020-08-19 04:29:13 +03:00
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
2020-05-27 02:36:17 +03:00
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#ffffff">
<meta name="apple-mobile-web-app-title" content=" {{{ title }}} ">
2020-05-02 09:11:43 +03:00
<script type="text/javascript" src="scripts/common-0.0.1 {{ min }} .js"></script>
<script type="text/javascript" src="scripts/u2f-api {{ min }} .js"></script>
2020-05-27 02:36:17 +03:00
<meta name="msapplication-TileColor" content="#00aba9">
<meta name="theme-color" content="#ffffff">
2019-12-16 22:21:07 +03:00
<title> {{{ title }}} - Login</title>
2018-05-22 02:36:51 +03:00
<style>
a {
color: #036;
text-decoration: underline;
}
#footer a {
color: #fff;
text-decoration: underline;
}
#footer a:hover {
color: #fff;
text-decoration: none;
}
</style>
</head>
<body onload="if (typeof(startup) !== 'undefined') startup();" style="overflow-y:hidden;margin:0;padding:0;border:0;color:black;font-size:13px;font-family:\'Trebuchet MS\', Arial, Helvetica, sans-serif">
<div id=container>
<div id=mastheadx></div>
2018-12-22 01:39:26 +03:00
<div id=masthead style="background:url(logo.png) 0px 0px;background-size:341px 50px;background-color:#036;background-repeat:no-repeat;height:50px;width:100%;overflow:hidden">
2018-05-24 07:43:44 +03:00
<div style="float:left;height:66px;color:#c8c8c8;padding-left:10px;padding-top:6px">
2018-05-22 02:36:51 +03:00
<strong><font style="font-size:36px;font-family:Arial,Helvetica,sans-serif"> {{{ title }}} </font></strong>
</div>
2018-05-24 07:43:44 +03:00
<div style="float:left;height:66px;color:#c8c8c8;padding-left:5px;padding-top:10px">
2018-05-22 02:36:51 +03:00
<strong><font style="font-size:12px;font-family:Arial,Helvetica,sans-serif"> {{{ title2 }}} </font></strong>
</div>
</div>
2018-05-24 07:43:44 +03:00
<div id=page_content style="overflow-y:scroll;position:absolute;bottom:32px;top:50px;width:100%;display:flex;align-items:center">
<div id=column_l style="padding:10px;width:100%">
<table style="width:100%">
2018-05-22 02:36:51 +03:00
<tr>
<td align=center>
2018-05-24 07:43:44 +03:00
<div id=loginpanel style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;clear:both;display:none">
2019-08-26 22:20:24 +03:00
<form method=post>
<input type=hidden name=action value=login />
2019-11-18 01:33:29 +03:00
<div id=message1></div>
2018-05-22 02:36:51 +03:00
<div>
<b>Log In</b>
</div>
<table>
<tr>
2019-07-09 01:59:44 +03:00
<td id=loginusername align=right width=100>Username:</td>
2020-01-13 00:50:06 +03:00
<td><input id=username type=text autocomplete="username" maxlength=64 name=username onchange=validateLogin(1) onkeyup=validateLogin(1,event) /></td>
2018-05-22 02:36:51 +03:00
</tr>
<tr>
<td align=right>Password:</td>
2020-01-13 00:50:06 +03:00
<td><input id=password type=password autocomplete="current-password" maxlength=256 name=password autocomplete=off onchange=validateLogin(2) onkeyup=validateLogin(2,event) /></td>
2018-05-22 02:36:51 +03:00
</tr>
<tr>
<td><div id=showPassHintLink style=display:none><a onclick=showPassHint() style="cursor:pointer">Show Hint</a></div></td>
<td align=right><input id=loginButton type=submit value="Log In" disabled="disabled" /></td>
</tr>
</table>
<div id="hrAccountDiv" style="display:none"><hr /></div>
<div id="resetAccountDiv" style="display:none;padding:2px">
2019-07-09 01:59:44 +03:00
<span id="resetAccountSpan">Forgot user/password?</span> <a onclick=xgo(3) style=cursor:pointer>Reset account</a>.
2018-05-22 02:36:51 +03:00
</div>
<div id="newAccountDiv" style="display:none;padding:2px">
Don't have an account? <a onclick=xgo(2) style=cursor:pointer>Create one</a>.
</div>
2019-06-12 20:23:26 +03:00
<input id=loginformargs name="urlargs" type="hidden" value="" />
2020-05-14 11:41:03 +03:00
<div id="authStrategies" style="display:none">
<hr />
<div style="margin-bottom:8px">Log in using an existing account</div>
<a id="auth-twitter" href="auth-twitter" style="display:none"><img src="images/login/twitter32.png" loading="lazy" width="32" height="32" style="margin-left:3px;margin-right:3px;border-radius:3px;box-shadow:2px 2px 5px black;cursor:pointer" title="Sign-in using Twitter" /></a>
<a id="auth-google" href="auth-google" style="display:none"><img src="images/login/google32.png" loading="lazy" width="32" height="32" style="margin-left:3px;margin-right:3px;border-radius:3px;box-shadow:2px 2px 5px black;cursor:pointer" title="Sign-in using Google" /></a>
<a id="auth-github" href="auth-github" style="display:none"><img src="images/login/github32.png" loading="lazy" width="32" height="32" style="margin-left:3px;margin-right:3px;border-radius:3px;box-shadow:2px 2px 5px black;cursor:pointer" title="Sign-in using GitHub" /></a>
<a id="auth-reddit" href="auth-reddit" style="display:none"><img src="images/login/reddit32.png" loading="lazy" width="32" height="32" style="margin-left:3px;margin-right:3px;border-radius:3px;box-shadow:2px 2px 5px black;cursor:pointer" title="Sign-in using Reddit" /></a>
2020-05-24 10:04:49 +03:00
<a id="auth-azure" href="auth-azure" style="display:none"><img src="images/login/azure32.png" loading="lazy" width="32" height="32" style="margin-left:3px;margin-right:3px;border-radius:3px;box-shadow:2px 2px 5px black;cursor:pointer" title="Sign-in using Azure" /></a>
2022-04-06 19:39:13 +03:00
<a id="auth-oidc" href="auth-oidc" style="display:none"><img src="images/login/oidc32.png" loading="lazy" width="32" height="32" style="margin-left:3px;margin-right:3px;border-radius:3px;box-shadow:2px 2px 5px black;cursor:pointer" title="Sign-in using OpenID Connect" /></a>
2020-05-20 10:39:17 +03:00
<a id="auth-jumpcloud" href="auth-jumpcloud" style="display:none"><img src="images/login/jumpcloud32.png" loading="lazy" width="32" height="32" style="margin-left:3px;margin-right:3px;border-radius:3px;box-shadow:2px 2px 5px black;cursor:pointer" title="Sign-in using JumpCloud" /></a>
2020-05-14 11:41:03 +03:00
<a id="auth-intel" href="auth-intel" style="display:none"><img src="images/login/intel32.png" loading="lazy" width="32" height="32" style="margin-left:3px;margin-right:3px;border-radius:3px;box-shadow:2px 2px 5px black;cursor:pointer" title="Sign-in using Intel" /></a>
2020-05-20 10:39:17 +03:00
<a id="auth-saml" href="auth-saml" style="display:none"><img src="images/login/generic32.png" loading="lazy" width="32" height="32" style="margin-left:3px;margin-right:3px;border-radius:3px;box-shadow:2px 2px 5px black;cursor:pointer" title="Single Sign-in" /></a>
2020-05-14 11:41:03 +03:00
</div>
2018-05-22 02:36:51 +03:00
</form>
</div>
2019-05-22 00:19:32 +03:00
<div id=createpanel style="display:none">
<div style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;clear:both;position:relative">
2019-08-26 22:20:24 +03:00
<form method=post>
<input type=hidden name=action value=createaccount />
2019-11-18 01:33:29 +03:00
<div id=message2></div>
2018-05-24 07:43:44 +03:00
<div>
<b>Account Creation</b>
</div>
2019-02-20 02:38:27 +03:00
<div id="passwordPolicyCallout" style="left:-5px;top:10px;width:100px;position:absolute;background-color:#FFC;border-radius:5px;padding:5px;box-shadow:0px 0px 15px #666;font-size:10px"></div>
2018-05-24 07:43:44 +03:00
<table>
2019-07-09 01:59:44 +03:00
<tr id="nuUserRow">
2018-05-24 07:43:44 +03:00
<td align=right width=100>Username:</td>
2020-01-13 00:50:06 +03:00
<td><input id=ausername type=text autocomplete="username" name=username onchange=validateCreate(1) maxlength=64 onkeydown=haltReturn(event) onkeyup=validateCreate(1,event) /></td>
2018-05-24 07:43:44 +03:00
</tr>
<tr>
<td align=right width=100>Email:</td>
2020-01-13 00:50:06 +03:00
<td><input id=aemail type=text autocomplete="email" inputmode="email" name=email onchange=validateCreate(2) maxlength=256 onkeydown=haltReturn(event) onkeyup=validateCreate(2,event) /></td>
2018-05-24 07:43:44 +03:00
</tr>
<tr>
<td align=right>Password:</td>
2020-01-13 00:50:06 +03:00
<td><input id=apassword1 type=password autocomplete="current-password" name=password1 maxlength=256 onkeydown=haltReturn(event) onchange=validateCreate(3) onkeyup=validateCreate(3,event) /></td>
2018-05-24 07:43:44 +03:00
</tr>
<tr>
<td align=right>Password:</td>
2020-01-13 00:50:06 +03:00
<td><input id=apassword2 type=password autocomplete="current-password" name=password2 maxlength=256 onkeydown=haltReturn(event) onchange=validateCreate(4) onkeyup=validateCreate(4,event) /></td>
2018-05-24 07:43:44 +03:00
</tr>
2019-03-01 03:17:22 +03:00
<tr id="createPanelHint" style="display:none">
2018-05-24 07:43:44 +03:00
<td align=right>Pass Hint:</td>
<td><input id=apasswordhint type=text name=apasswordhint autocomplete=off maxlength=256 onkeydown=haltReturn(event) onchange=validateCreate(5) onkeyup=validateCreate(5,event) /></td>
</tr>
<tr id=newAccountPass title="Enter the account creation token">
<td align=right>Creation Token:</td>
<td><input id=anewaccountpass type=password name=anewaccountpass autocomplete=off maxlength=256 onkeydown=haltReturn(event) onchange=validateCreate(6) onkeyup=validateCreate(6,event) /></td>
</tr>
2022-07-12 01:27:07 +03:00
<tr id=newAccountCaptchaImg title="CAPTCHA image">
<td></td>
<td colspan=2><img src=" {{{ newAccountCaptchaImage }}} " loading="lazy" /></td>
</tr>
<tr id=newAccountCaptcha title="Security check">
<td id="nuCaptcha" align=right>Security Check:</td>
<td><input id=anewaccountcaptcha type=text name=anewaccountcaptcha {{{ autocomplete }}} =off maxlength=256 onkeydown=haltReturn(event) onchange=validateCreate(7,event) onkeyup=validateCreate(7,event) /></td>
</tr>
2018-05-24 07:43:44 +03:00
<tr>
<td colspan=2>
<div style=float:right><input id=createButton type=submit value="Create Account" disabled="disabled" /></div>
<div id=passWarning style="padding-top:6px"></div>
</td>
</tr>
</table>
<hr /><a onclick=xgo(1) style=cursor:pointer>Back to login</a>
2019-06-12 20:23:26 +03:00
<input id=createformargs name="urlargs" type="hidden" value="" />
2022-07-12 01:27:07 +03:00
<input id=createformcaptcha name="captchaargs" type="hidden" value=" {{{ newAccountCaptcha }}} " />
2018-05-24 07:43:44 +03:00
</form>
</div>
2018-05-22 02:36:51 +03:00
</div>
2019-01-16 05:21:03 +03:00
<div id=resetpanel style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;display:none;clear:both">
2019-08-26 22:20:24 +03:00
<form method=post>
<input type=hidden name=action value=resetaccount />
2019-11-18 01:33:29 +03:00
<div id=message3></div>
2018-05-22 02:36:51 +03:00
<div>
<b>Account Reset</b>
</div>
<table>
<tr>
<td align=right width=100>Email:</td>
2020-01-13 00:50:06 +03:00
<td><input id=remail type=text inputmode="email" autocomplete="email" name=email maxlength=256 onchange=validateReset() onkeyup=validateReset(event) /></td>
2018-05-22 02:36:51 +03:00
</tr>
<tr>
<td colspan=2>
<div style=float:right><input id=eresetButton type=submit value="Reset Account" disabled="disabled" /></div>
<div id=passWarning style="padding-top:6px"></div>
</td>
</tr>
</table>
<hr /><a onclick=xgo(1) style=cursor:pointer>Back to login</a>
2019-06-12 20:23:26 +03:00
<input id=resetformargs name="urlargs" type="hidden" value="" />
2018-05-22 02:36:51 +03:00
</form>
</div>
2019-01-16 05:21:03 +03:00
<div id=tokenpanel style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;display:none;clear:both">
2019-08-26 22:20:24 +03:00
<form method=post autocomplete=off>
<input type=hidden name=action value=tokenlogin />
<input type=hidden name=hwstate value=" {{{ hwstate }}} " />
2019-11-18 01:33:29 +03:00
<div id=message4></div>
2019-01-16 05:21:03 +03:00
<table>
<tr>
<td align=right width=100>Login token:</td>
2019-02-08 09:30:33 +03:00
<td>
2020-01-13 00:57:13 +03:00
<input id=tokenInput type=text autocomplete="one-time-code" inputmode="numeric" name=token maxlength=50 onchange=checkToken(event) onkeyup=checkToken(event) onkeydown=checkToken(event) onfocus=checkTokenTimer(1) onblur=checkTokenTimer(0) />
2019-02-11 03:04:36 +03:00
<input id=hwtokenInput type=text name=hwtoken style="display:none" />
2019-02-08 09:30:33 +03:00
</td>
2019-01-16 05:21:03 +03:00
</tr>
2019-11-29 09:29:22 +03:00
<tr>
<td colspan="2" style="align-content:center">
2020-04-30 01:45:31 +03:00
<label id=tokenInputRememberLabel><input id=tokenInputRemember name=remembertoken type=checkbox /><span id=tokenInputRememberSpan></span></label>
2019-11-29 09:29:22 +03:00
</td>
</tr>
2019-01-16 05:21:03 +03:00
<tr>
<td colspan=2>
<div style=float:right><input id=tokenOkButton type=submit value="Login" disabled="disabled" /></div>
2020-03-14 06:39:21 +03:00
<div style=float:right>
<input style="display:none;float:right" id=securityKeyButton type=button value="Use Security Key" onclick="useSecurityKey()" />
<input style="display:none;float:right" id=emailKeyButton type=button value="Email" onclick="useEmailToken()" />
2020-04-23 04:49:17 +03:00
<input style="display:none;float:right" id=smsKeyButton type=button value="SMS" onclick="useSMSToken()" />
2020-03-14 06:39:21 +03:00
</div>
2019-01-16 05:21:03 +03:00
</td>
</tr>
</table>
<hr /><a onclick=xgo(1) style=cursor:pointer>Back to login</a>
2019-06-12 20:23:26 +03:00
<input id=tokenformargs name="urlargs" type="hidden" value="" />
2019-01-16 05:21:03 +03:00
</form>
</div>
2019-02-12 01:41:15 +03:00
<div id=resettokenpanel style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;display:none;clear:both">
2019-08-26 22:20:24 +03:00
<form method=post autocomplete=off>
<input type=hidden name=action value=resetaccount />
2019-11-18 01:33:29 +03:00
<div id=message5></div>
2019-02-12 01:41:15 +03:00
<table>
<tr>
<td align=right width=100>Login token:</td>
<td>
2019-02-20 02:38:27 +03:00
<input id=resetTokenInput type=text name=token maxlength=50 onchange=resetCheckToken(event) onpaste=resetCheckToken(event) onkeyup=resetCheckToken(event) onkeydown=resetCheckToken(event) />
2019-02-12 01:41:15 +03:00
<input id=resetHwtokenInput type=text name=hwtoken style="display:none" />
</td>
</tr>
<tr>
<td colspan=2>
<div style=float:right><input id=resetTokenOkButton type=submit value="Login" disabled="disabled" /></div>
</td>
</tr>
</table>
<hr /><a onclick=xgo(1) style=cursor:pointer>Back to login</a>
2019-06-12 20:23:26 +03:00
<input id=resettokenformargs name="urlargs" type="hidden" value="" />
2019-02-12 01:41:15 +03:00
</form>
</div>
2019-05-22 00:19:32 +03:00
<div id=resetpasswordpanel style="position:relative;background-color:#979797;border-radius:16px;width:300px;padding:16px;text-align:center;display:none">
2019-08-26 22:20:24 +03:00
<form method=post>
<input type=hidden name=action value=resetpassword />
2019-11-18 01:33:29 +03:00
<div id=message6></div>
2019-02-28 05:48:50 +03:00
<div id="rpasswordPolicyCallout" style="left:-10px;width:100px;display:none;position:absolute;background-color:#FFC;border-radius:5px;padding:5px;box-shadow:0px 0px 15px #666;font-size:10px"></div>
<table>
<tr>
<td id="rnuPass1" width=100 align=right>Password:</td>
<td><input id=rapassword1 type=password name=rpassword1 autocomplete=off maxlength=256 onkeydown=haltReturn(event) onchange=validatePassReset(3,event) onkeyup=validatePassReset(3,event) /></td>
</tr>
<tr>
<td id="rnuPass2" align=right>Password:</td>
<td><input id=rapassword2 type=password name=rpassword2 autocomplete=off maxlength=256 onkeydown=haltReturn(event) onchange=validatePassReset(4,event) onkeyup=validatePassReset(4,event) /></td>
</tr>
2019-03-01 03:17:22 +03:00
<tr id="resetpasswordpanelHint" style="display:none">
2019-02-28 05:48:50 +03:00
<td id="rnuHint" align=right>Password Hint:</td>
<td><input id=rapasswordhint type=text name=rpasswordhint autocomplete=off maxlength=256 onkeydown=haltReturn(event) onchange=validatePassReset(5,event) onkeyup=validatePassReset(5,event) /></td>
</tr>
<tr>
<td colspan=2>
<div style=float:right><input id=resetPassButton type=submit value="Reset Password" disabled="disabled" /></div>
<div id=rpassWarning style="padding-top:6px"></div>
</td>
</tr>
</table>
<hr /><a onclick=xgo(1) style=cursor:pointer>Back to login</a>
2019-06-12 20:23:26 +03:00
<input id=resetpasswordformargs name="urlargs" type="hidden" value="" />
2019-02-28 05:48:50 +03:00
</form>
</div>
2020-04-21 11:59:08 +03:00
<div id=checkemailpanel style="position:relative;background-color:#979797;border-radius:16px;width:300px;padding:16px;text-align:center;display:none">
<form method=post>
<input type=hidden name=action value=checkemail />
<div id=message7></div>
<table id="checkCheckOperations" style="width:100%;display:none">
<tr>
<td>
<div id="unconfirmedEmail"></div><br />
</td>
</tr>
<tr>
<td>
<div>
<input id=changeEmailButton type=button value="Change Email Address" onclick="changeEmailAddress()" />
<input id=checkEmailButton2 type=button value="Resend Confirmation Email" onclick="resentEmailConfirmation()" />
<input id=checkEmailButton type=submit style="display:none" />
<input id=checkEmailVal name=email type="hidden" value="" />
</div>
</td>
</tr>
</table>
<hr /><a onclick="return xgo(1,event);" href="#" style=cursor:pointer>Back to login</a>
<input id=checkemailformargs name="urlargs" type="hidden" value="" />
</form>
</div>
2019-02-12 01:41:15 +03:00
2018-05-22 02:36:51 +03:00
</td>
</tr>
</table>
</div>
</div>
<div id=footer style="height:32px;width:100%;text-align:center;background-color:#113962;position:absolute;bottom:0px">
<table cellpadding=0 cellspacing=6 style=width:100%>
<tr>
<td style=text-align:left;color:white> {{{ footer }}} </td>
<td style=text-align:right> {{{ rootCertLink }}} <a href=terms>Terms & Privacy</a></td>
</tr>
</table>
</div>
</div>
2020-03-14 06:39:21 +03:00
<div id=dialog style="z-index:1000;background-color:#EEE;box-shadow:0px 0px 15px #666;font-family:Arial,Helvetica,sans-serif;border-radius:5px;position:fixed;top:180px;width:300px;display:none">
2018-05-22 02:36:51 +03:00
<div style="width:100%;background-color:#003366;color:#FFF;border-radius:5px 5px 0 0">
<div id=id_dialogclose style=float:right;padding:5px;cursor:pointer onclick=setDialogMode()><b>X</b></div>
<div id=id_dialogtitle style=padding:5px></div>
<div style=width:100%;margin:6px></div>
</div>
<div style="margin-right:16px;margin-left:8px">
<div id=dialog1 style="margin:auto;text-align:center;margin:3px">
<div id=id_dialogMessage style="padding:10px"></div>
</div>
<div id=dialog2 style="margin:auto;margin:3px">
<div id=id_dialogOptions></div>
</div>
</div>
<div id="idx_dlgButtonBar" style="padding:10px;margin-bottom:20px">
<input id="idx_dlgCancelButton" type="button" value="Cancel" style="float:right;width:80px;margin-left:5px" onclick="dialogclose(0)">
<input id="idx_dlgOkButton" type="button" value="OK" style="float:right;width:80px" onclick="dialogclose(1)">
</div>
</div>
<script>
2018-08-27 22:24:15 +03:00
'use strict';
2022-06-08 20:47:23 +03:00
var random = ' {{{ randomlength }}} ' // Random length string for BREACH mitigation
2019-10-25 09:58:39 +03:00
var loginMode = ' {{{ log in mode }}} ';
var newAccount = ' {{{ newAccount }}} ';
2019-10-18 03:13:55 +03:00
var passhint = ' {{{ passhint }}} ';
2018-08-24 02:55:06 +03:00
var newAccountPass = parseInt(' {{{ newAccountPass }}} ');
2022-07-12 01:27:07 +03:00
var newAccountCaptcha = ' {{{ newAccountCaptcha }}} ';
2020-01-30 01:38:41 +03:00
var emailCheck = ' {{{ emailcheck }}} ';
2018-08-24 02:55:06 +03:00
var features = parseInt(' {{{ features }}} ');
2019-10-18 03:13:55 +03:00
var passRequirements = ' {{{ passRequirements }}} ';
if (passRequirements != '') { passRequirements = JSON.parse(decodeURIComponent(passRequirements)); } else { passRequirements = { }; }
2019-03-01 03:17:22 +03:00
var passRequirementsEx = ((passRequirements.min != null) || (passRequirements.max != null) || (passRequirements.upper != null) || (passRequirements.lower != null) || (passRequirements.numeric != null) || (passRequirements.nonalpha != null));
2019-03-26 00:43:58 +03:00
var hardwareKeyChallenge = decodeURIComponent(' {{{ hkey }}} ');
2019-11-29 09:29:22 +03:00
var publicKeyCredentialRequestOptions = null;
2019-03-01 03:17:22 +03:00
var currentpanel = 0;
2020-03-14 06:39:21 +03:00
var otpemail = (' {{{ otpemail }}} ' === 'true');
2020-04-23 04:49:17 +03:00
var otpsms = (' {{{ otpsms }}} ' === 'true');
2021-07-28 20:35:33 +03:00
var autofido = (decodeURIComponent(' {{{ autofido }}} ') === 'true');
2020-04-30 01:45:31 +03:00
var twoFactorCookieDays = parseInt(' {{{ twoFactorCookieDays }}} ');
2020-05-14 11:41:03 +03:00
var authStrategies = ' {{{ authStrategies }}} '.split(',');
2021-07-25 01:14:21 +03:00
var tokenTimeout = parseInt(' {{{ tokenTimeout }}} ');
2018-05-22 02:36:51 +03:00
2019-11-18 01:33:29 +03:00
// Display the right server message
var messageid = parseInt(' {{{ messageid }}} ');
2020-07-07 01:04:22 +03:00
var okmessages = ['', "If valid, reset mail sent.", "Email sent.", "Email verification required, check your mailbox and click the confirmation link.", "SMS sent."];
2022-07-12 01:27:07 +03:00
var failmessages = ["Unable to create account.", "Account limit reached.", "Existing account with this email address.", "Invalid account creation token.", "Username already exists.", "Password rejected, use a different one.", "Invalid email.", "Account not found.", "Invalid token, try again.", "Unable to sent email.", "Account locked.", "Access denied.", "Login failed, check username and password.", "Password change requested.", "IP address blocked, try again later.", "Server under maintenance.", "Unable to send device notification.", "Invalid security check."];
2019-11-18 01:33:29 +03:00
if (messageid > 0) {
var msg = '';
if ((messageid < 100) && (messageid < okmessages.length)) { msg = okmessages[messageid]; }
else if ((messageid >= 100) && ((messageid - 100) < failmessages.length)) { msg = failmessages[messageid - 100]; }
if (msg != '') {
if (messageid >= 100) { msg = ('<span class="msg error"><b style=color:#8C001A>' + msg + '<b></span><br /><br />'); } else { msg = ('<span class="msg success"><b>' + msg + '</b></span><br /><br />'); }
2020-04-21 11:59:08 +03:00
for (var i = 1; i < 8; i++) { QH('message' + i, msg); }
2019-11-18 01:33:29 +03:00
}
}
2019-06-12 20:23:26 +03:00
// If URL arguments are provided, add them to form posts
if (window.location.href.indexOf('?') > 0) {
var urlargs = window.location.href.substring(window.location.href.indexOf('?'));
Q('loginformargs').value = urlargs;
Q('createformargs').value = urlargs;
Q('resetformargs').value = urlargs;
Q('tokenformargs').value = urlargs;
Q('resettokenformargs').value = urlargs;
Q('resetpasswordformargs').value = urlargs;
}
2020-04-30 01:45:31 +03:00
// Setup two factor cookie time
if (twoFactorCookieDays > 0) {
QV('tokenInputRememberLabel', true);
QH('tokenInputRememberSpan', format("Remember this device for { 0} days.", twoFactorCookieDays));
} else {
QV('tokenInputRememberLabel', false);
}
2018-05-22 02:36:51 +03:00
function startup() {
if ((features & 32) == 0) {
// Guard against other site's top frames (web bugs).
var loc = null;
try { loc = top.location.toString().toLowerCase(); } catch (e) { }
if (top != self && (loc == null || top.active == false)) { top.location = self.location; return; }
}
2019-07-09 01:59:44 +03:00
if (features & 0x200000) { // Email is username
2019-10-18 03:13:55 +03:00
QH('loginusername', "Email:");
QH('resetAccountSpan', "Forgot password?");
2019-07-09 01:59:44 +03:00
QV('nuUserRow', false);
}
2019-03-01 03:17:22 +03:00
QV('createPanelHint', passRequirements.hint === true);
QV('resetpasswordpanelHint', passRequirements.hint === true);
2020-05-14 11:41:03 +03:00
// Setup authentication strategies
if (authStrategies != '') {
QV('authStrategies', true);
if (authStrategies.indexOf('twitter') >= 0) { QV('auth-twitter', true); }
if (authStrategies.indexOf('google') >= 0) { QV('auth-google', true); }
if (authStrategies.indexOf('github') >= 0) { QV('auth-github', true); }
if (authStrategies.indexOf('reddit') >= 0) { QV('auth-reddit', true); }
2020-05-24 10:04:49 +03:00
if (authStrategies.indexOf('azure') >= 0) { QV('auth-azure', true); }
2022-04-06 19:39:13 +03:00
if (authStrategies.indexOf('oidc') >= 0) { QV('auth-oidc', true); }
2020-05-20 10:39:17 +03:00
if (authStrategies.indexOf('jumpcloud') >= 0) { QV('auth-jumpcloud', true); }
2020-05-14 11:41:03 +03:00
if (authStrategies.indexOf('intel') >= 0) { QV('auth-intel', true); }
2020-05-20 10:39:17 +03:00
if (authStrategies.indexOf('saml') >= 0) { QV('auth-saml', true); }
2020-05-14 11:41:03 +03:00
}
2018-05-22 02:36:51 +03:00
window.onresize = center;
center();
validateLogin();
validateCreate();
2019-10-25 09:58:39 +03:00
if (loginMode.length != 0) { go(parseInt(loginMode)); } else { go(1); }
QV('newAccountDiv', (newAccount === '1') || (newAccount === 'true')); // If new accounts are not allowed, don't display the new account link.
2019-10-18 03:13:55 +03:00
if ((passRequirements.hint === true) && (passhint != null) && (passhint.length > 0)) { QV('showPassHintLink', true); }
QV('newAccountPass', (newAccountPass == 1));
2022-07-12 01:27:07 +03:00
QV('newAccountCaptcha', (newAccountCaptcha != ''));
QV('newAccountCaptchaImg', (newAccountCaptcha != ''));
2020-01-30 01:38:41 +03:00
QV('resetAccountDiv', (emailCheck == 'true'));
QV('hrAccountDiv', (emailCheck == 'true') || (newAccountPass == 1));
2019-02-08 09:30:33 +03:00
2019-10-25 09:58:39 +03:00
if (loginMode == '4') {
2021-07-25 01:14:21 +03:00
if (tokenTimeout > 0) { setTimeout(function () { Q('hwtokenInput').value = '**timeout**'; QE('tokenOkButton', true); Q('tokenOkButton').click(); }, tokenTimeout); }
2019-02-08 09:30:33 +03:00
try { if (hardwareKeyChallenge.length > 0) { hardwareKeyChallenge = JSON.parse(hardwareKeyChallenge); } else { hardwareKeyChallenge = null; } } catch (ex) { hardwareKeyChallenge = null }
2021-07-28 20:35:33 +03:00
var twofakey = (hardwareKeyChallenge != null) && (hardwareKeyChallenge.type == 'webAuthn');
QV('securityKeyButton', twofakey);
2020-04-23 04:49:17 +03:00
QV('emailKeyButton', otpemail && (messageid != 2) && (messageid != 4));
QV('smsKeyButton', otpsms && (messageid != 2) && (messageid != 4));
2021-07-28 20:35:33 +03:00
// If hardware key is an option, trigger it now
if (autofido && twofakey) { setTimeout(function () { useSecurityKey(1); }, 300); }
2019-02-08 09:30:33 +03:00
}
2019-02-12 01:41:15 +03:00
2019-10-25 09:58:39 +03:00
if (loginMode == '5') {
2021-07-25 01:14:21 +03:00
if (tokenTimeout > 0) { setTimeout(function () { Q('hwtokenInput').value = '**timeout**'; QE('tokenOkButton', true); Q('tokenOkButton').click(); }, tokenTimeout); }
2019-02-12 01:41:15 +03:00
try { if (hardwareKeyChallenge.length > 0) { hardwareKeyChallenge = JSON.parse(hardwareKeyChallenge); } else { hardwareKeyChallenge = null; } } catch (ex) { hardwareKeyChallenge = null }
2021-07-28 20:35:33 +03:00
var twofakey = (hardwareKeyChallenge != null) && (hardwareKeyChallenge.type == 'webAuthn');
if (twofakey) {
2019-11-29 09:29:22 +03:00
if (typeof hardwareKeyChallenge.challenge == 'string') { hardwareKeyChallenge.challenge = Uint8Array.from(atob(hardwareKeyChallenge.challenge), function (c) { return c.charCodeAt(0) }).buffer; }
2019-03-25 21:32:16 +03:00
2019-11-29 09:29:22 +03:00
publicKeyCredentialRequestOptions = { challenge: hardwareKeyChallenge.challenge, allowCredentials: [], timeout: hardwareKeyChallenge.timeout }
2019-03-25 21:32:16 +03:00
for (var i = 0; i < hardwareKeyChallenge.keyIds.length; i++) {
publicKeyCredentialRequestOptions.allowCredentials.push(
2020-02-27 23:55:14 +03:00
{ id: Uint8Array.from(atob(hardwareKeyChallenge.keyIds[i]), function (c) { return c.charCodeAt(0) }), type: 'public-key', transports: ['usb', 'ble', 'nfc', 'internal'], }
2019-03-25 21:32:16 +03:00
);
}
// New WebAuthn hardware keys
navigator.credentials.get( { publicKey: publicKeyCredentialRequestOptions }).then(
function (rawAssertion) {
var assertion = {
id: btoa(String.fromCharCode.apply(null, new Uint8Array(rawAssertion.rawId))),
clientDataJSON: btoa(String.fromCharCode.apply(null, new Uint8Array(rawAssertion.response.clientDataJSON))),
userHandle: btoa(String.fromCharCode.apply(null, new Uint8Array(rawAssertion.response.userHandle))),
signature: btoa(String.fromCharCode.apply(null, new Uint8Array(rawAssertion.response.signature))),
authenticatorData: btoa(String.fromCharCode.apply(null, new Uint8Array(rawAssertion.response.authenticatorData))),
};
Q('resetHwtokenInput').value = JSON.stringify(assertion);
QE('resetTokenOkButton', true);
Q('resetTokenOkButton').click();
},
function (error) { console.log('credentials-get error', error); }
);
2019-02-12 01:41:15 +03:00
}
}
2018-05-22 02:36:51 +03:00
}
2019-11-29 09:29:22 +03:00
// Use a hardware security key
function useSecurityKey() {
2020-03-14 06:39:21 +03:00
if (xxdialogMode) return;
2019-11-29 09:29:22 +03:00
if ((hardwareKeyChallenge != null) && (hardwareKeyChallenge.type == 'webAuthn')) {
if (typeof hardwareKeyChallenge.challenge == 'string') { hardwareKeyChallenge.challenge = Uint8Array.from(atob(hardwareKeyChallenge.challenge), function (c) { return c.charCodeAt(0) }).buffer; }
publicKeyCredentialRequestOptions = { challenge: hardwareKeyChallenge.challenge, allowCredentials: [], timeout: hardwareKeyChallenge.timeout }
for (var i = 0; i < hardwareKeyChallenge.keyIds.length; i++) {
publicKeyCredentialRequestOptions.allowCredentials.push(
2020-02-28 02:10:34 +03:00
{ id: Uint8Array.from(atob(hardwareKeyChallenge.keyIds[i]), function (c) { return c.charCodeAt(0) }), type: 'public-key', transports: ['usb', 'ble', 'nfc', 'internal'], }
2019-11-29 09:29:22 +03:00
);
}
// New WebAuthn hardware keys
navigator.credentials.get( { publicKey: publicKeyCredentialRequestOptions }).then(
function (rawAssertion) {
var assertion = {
id: btoa(String.fromCharCode.apply(null, new Uint8Array(rawAssertion.rawId))),
clientDataJSON: btoa(String.fromCharCode.apply(null, new Uint8Array(rawAssertion.response.clientDataJSON))),
userHandle: btoa(String.fromCharCode.apply(null, new Uint8Array(rawAssertion.response.userHandle))),
signature: btoa(String.fromCharCode.apply(null, new Uint8Array(rawAssertion.response.signature))),
authenticatorData: btoa(String.fromCharCode.apply(null, new Uint8Array(rawAssertion.response.authenticatorData))),
};
Q('hwtokenInput').value = JSON.stringify(assertion);
QE('tokenOkButton', true);
Q('tokenOkButton').click();
},
function (error) { console.log('credentials-get error', error); }
);
}
}
2018-05-22 02:36:51 +03:00
2020-03-14 06:39:21 +03:00
function useEmailToken() {
if (xxdialogMode) return;
if (otpemail != true) return;
setDialogMode(1, "Secure Login", 3, useEmailKeyEx, "Send token to registed email address?");
}
function useEmailKeyEx() {
Q('hwtokenInput').value = '**email**';
QE('tokenOkButton', true);
Q('tokenOkButton').click();
}
2020-04-23 04:49:17 +03:00
function useSMSToken() {
if (otpsms != true) return;
setDialogMode(1, "Secure Login", 3, useSMSTokenEx, "Send token to registed phone number?");
}
function useSMSTokenEx() {
Q('hwtokenInput').value = '**sms**';
QE('tokenOkButton', true);
Q('tokenOkButton').click();
}
2018-05-22 02:36:51 +03:00
function showPassHint() {
2019-03-01 03:17:22 +03:00
if (passRequirements.hint === true) { messagebox("Password Hint", passhint); }
2018-05-22 02:36:51 +03:00
}
function xgo(x) {
QV('message1', false);
QV('message2', false);
2019-02-12 01:41:15 +03:00
QV('message3', false);
QV('message4', false);
QV('message5', false);
2019-02-28 05:48:50 +03:00
QV('message6', false);
2020-04-21 11:59:08 +03:00
QV('message7', false);
2018-05-22 02:36:51 +03:00
go(x);
}
function go(x) {
2019-03-01 03:17:22 +03:00
currentpanel = x;
2018-05-22 02:36:51 +03:00
setDialogMode(0);
2019-10-18 03:13:55 +03:00
QV('showPassHintLink', false);
2018-05-22 02:36:51 +03:00
QV('loginpanel', x == 1);
QV('createpanel', x == 2);
QV('resetpanel', x == 3);
2019-01-16 05:21:03 +03:00
QV('tokenpanel', x == 4);
2019-02-12 01:41:15 +03:00
QV('resettokenpanel', x == 5);
2019-02-28 05:48:50 +03:00
QV('resetpasswordpanel', x == 6);
2020-04-21 11:59:08 +03:00
QV('checkemailpanel', x == 7);
2018-05-22 02:36:51 +03:00
if (x == 1) { Q('username').focus(); }
2019-07-09 01:59:44 +03:00
if (x == 2) { if (features & 0x200000) { Q('aemail').focus(); } else { Q('ausername').focus(); } } // Email is username
2018-05-22 02:36:51 +03:00
if (x == 3) { Q('remail').focus(); }
2019-01-16 05:21:03 +03:00
if (x == 4) { Q('tokenInput').focus(); }
2019-02-28 05:48:50 +03:00
if (x == 5) { Q('resetTokenInput').focus(); }
if (x == 6) { Q('rapassword1').focus(); }
2020-04-21 11:59:08 +03:00
if (x == 7) {
QH('unconfirmedEmail', passhint);
QV('checkCheckOperations', Q('unconfirmedEmail').innerHTML != '');
QH('checkEmailVal', passhint);
}
2018-05-22 02:36:51 +03:00
}
function validateLogin(box, e) {
var ok = ((Q('username').value.length > 0) && (Q('username').value.indexOf(' ') == -1) && (Q('password').value.length > 0));
QE('loginButton', ok);
setDialogMode(0);
if ((e != null) && (e.keyCode == 13)) { if (box == 1) { Q('password').focus(); } else if (box == 2) { Q('loginButton').click(); } }
if (e != null) { haltEvent(e); }
}
function validateCreate(box,e) {
setDialogMode(0);
2019-07-09 01:59:44 +03:00
var ok = false;
if (features & 0x200000) { ok = true; } else { ok = (Q('ausername').value.length > 0) && (Q('ausername').value.indexOf(' ') == -1) && (Q('ausername').value.indexOf('"') == -1) && (Q('ausername').value.indexOf(',') == -1); }
ok &= ((validateEmail(Q('aemail').value) == true) && (Q('apassword1').value.length > 0) && (Q('apassword2').value == Q('apassword1').value));
2018-05-22 02:36:51 +03:00
if ((newAccountPass == 1) && (Q('anewaccountpass').value.length == 0)) { ok = false; }
if (Q('apassword1').value == '') {
QH('passWarning', '');
2019-02-20 02:38:27 +03:00
QV('passwordPolicyCallout', false);
2018-05-22 02:36:51 +03:00
} else {
2019-03-01 03:17:22 +03:00
if (!passRequirementsEx) {
2018-12-21 01:14:37 +03:00
// No password requirements, display password strength
var passStrength = checkPasswordStrength(Q('apassword1').value);
2019-10-18 03:13:55 +03:00
if (passStrength >= 80) { QH('passWarning', '<span style=color:green><b>' + "Strong Password" + '</b><span>'); }
else if (passStrength >= 60) { QH('passWarning', '<span style=color:blue><b>' + "Good Password" + '</b><span>'); }
else { QH('passWarning', '<span style=color:red><b>' + "Weak Password" + '</b><span>'); }
2018-12-21 01:14:37 +03:00
} else {
// Password requirements provided, use that
var passReq = checkPasswordRequirements(Q('apassword1').value, passRequirements);
if (passReq == false) {
ok = false;
//QS('nuPass1').color = '#7b241c';
//QS('nuPass2').color = '#7b241c';
2019-10-18 03:13:55 +03:00
QH('passWarning', '<span style=color:red><b>' + "Password Policy" + '</b><span>'); // TODO: Display problem hint
2019-02-20 02:38:27 +03:00
QV('passwordPolicyCallout', true);
QH('passwordPolicyCallout', passwordPolicyText(Q('apassword1').value));
2018-12-21 01:14:37 +03:00
} else {
QH('passWarning', '');
2019-02-20 02:38:27 +03:00
QV('passwordPolicyCallout', false);
2018-12-21 01:14:37 +03:00
}
}
2018-05-22 02:36:51 +03:00
}
2018-12-21 01:14:37 +03:00
QE('createButton', ok);
2018-05-22 02:36:51 +03:00
if ((e != null) && (e.keyCode == 13)) {
if (box == 1) { Q('aemail').focus(); }
if (box == 2) { Q('apassword1').focus(); }
if (box == 3) { Q('apassword2').focus(); }
if (box == 4) { Q('apasswordhint').focus(); }
2022-07-12 01:27:07 +03:00
if (box == 5) { if (newAccountPass == 1) { Q('anewaccountpass').focus(); } else { box = 6; } }
if (box == 6) { if (newAccountCaptcha != '') { Q('anewaccountcaptcha').focus(); } else { box = 7; } }
if (box == 7) { Q('createButton').click(); }
2018-05-22 02:36:51 +03:00
}
if (e != null) { haltEvent(e); }
}
2019-02-28 05:48:50 +03:00
function validatePassReset(box, e) {
setDialogMode(0);
var pass1ok = (Q('rapassword1').value.length > 0);
var pass2ok = (Q('rapassword2').value.length > 0) && (Q('rapassword2').value == Q('rapassword1').value);
var ok = (pass1ok && pass2ok);
// Color the fields
QS('rnuPass1').color = pass1ok ? 'black' : '#7b241c';
QS('rnuPass2').color = pass2ok ? 'black' : '#7b241c';
if (Q('rapassword1').value == '') {
QH('rpassWarning', '');
QV('rpasswordPolicyCallout', false);
} else {
2019-03-01 03:17:22 +03:00
if (!passRequirementsEx) {
2019-02-28 05:48:50 +03:00
// No password requirements, display password strength
var passStrength = checkPasswordStrength(Q('rapassword1').value);
2019-10-18 03:13:55 +03:00
if (passStrength >= 80) { QH('rpassWarning', '<span style=color:green><b>' + "Strong Password" + '</b><span>'); }
else if (passStrength >= 60) { QH('rpassWarning', '<span style=color:blue><b>' + "Good Password" + '</b><span>'); }
else { QH('rpassWarning', '<span style=color:red><b>' + "Weak Password" + '</b><span>'); }
2019-02-28 05:48:50 +03:00
} else {
// Password requirements provided, use that
var passReq = checkPasswordRequirements(Q('rapassword1').value, passRequirements);
if (passReq == false) {
ok = false;
QS('rnuPass1').color = '#7b241c';
QS('rnuPass2').color = '#7b241c';
2019-10-18 03:13:55 +03:00
QH('rpassWarning', '<div style=color:red;cursor:pointer onclick=showPasswordPolicy()><b>' + "Password Policy" + '</b><div>'); // This is also a link to the password policy
2019-02-28 05:48:50 +03:00
QV('rpasswordPolicyCallout', true);
QH('rpasswordPolicyCallout', passwordPolicyText(Q('rapassword1').value));
} else {
QH('rpassWarning', '');
QV('rpasswordPolicyCallout', false);
}
}
}
if ((e != null) && (e.keyCode == 13)) {
if (box == 2) { Q('rapassword1').focus(); }
if (box == 3) { Q('rapassword2').focus(); }
if (box == 4) { Q('rapasswordhint').focus(); }
if (box == 6) { Q('resetPassButton').click(); }
}
if (e != null) { haltEvent(e); }
QE('resetPassButton', ok);
}
2018-05-22 02:36:51 +03:00
function validateReset(e) {
setDialogMode(0);
var x = validateEmail(Q('remail').value);
QE('eresetButton', x);
2019-10-18 03:13:55 +03:00
if ((e != null) && (e.keyCode == 13) && (x == true)) { Q('eresetButton').click(); }
2018-05-22 02:36:51 +03:00
if (e != null) { haltEvent(e); }
}
2019-02-20 02:38:27 +03:00
function passwordPolicyText(pass) {
var policy = '<div style=text-align:left>';
var counts = strCount(pass);
2019-10-18 03:13:55 +03:00
if (passRequirements.min && ((pass == null) || (pass.length < passRequirements.min))) { policy += format("Minimum length of { 0}", passRequirements.min) + '<br />'; }
if (passRequirements.max && ((pass == null) || (pass.length > passRequirements.max))) { policy += format("Maximum length of { 0}", passRequirements.max) + '<br />'; }
if (passRequirements.upper && ((pass == null) || (counts.upper < passRequirements.upper))) { policy += format(" { 0} upper case", passRequirements.upper) + '<br />'; }
if (passRequirements.lower && ((pass == null) || (counts.lower < passRequirements.lower))) { policy += format(" { 0} lower case", passRequirements.lower) + '<br />'; }
if (passRequirements.numeric && ((pass == null) || (counts.numeric < passRequirements.numeric))) { policy += format(" { 0} numeric", passRequirements.numeric) + '<br />'; }
if (passRequirements.nonalpha && ((pass == null) || (counts.nonalpha < passRequirements.nonalpha))) { policy += format(" { 0} non-alphanumeric", passRequirements.nonalpha) + '<br />'; }
2019-02-20 02:38:27 +03:00
policy += '</div>';
return policy;
}
2018-05-22 02:36:51 +03:00
// Return a password strength score
function checkPasswordStrength(password) {
var r = 0, letters = { }, varCount = 0, variations = { digits: /\d/.test(password), lower: /[a-z]/.test(password), upper: /[A-Z]/.test(password), nonWords: /\W/.test(password) }
if (!password) return 0;
for (var i = 0; i< password.length; i++) { letters[password[i]] = (letters[password[i]] || 0) + 1; r += 5.0 / letters[password[i]]; }
for (var c in variations) { varCount += (variations[c] == true) ? 1 : 0; }
return parseInt(r + (varCount - 1) * 10);
}
2018-12-21 01:14:37 +03:00
// Check password requirements
function checkPasswordRequirements(password, requirements) {
if ((requirements == null) || (requirements == '') || (typeof requirements != 'object')) return true;
if (requirements.min) { if (password.length < requirements.min) return false; }
if (requirements.max) { if (password.length > requirements.max) return false; }
2019-02-20 02:38:27 +03:00
var counts = strCount(password);
if (requirements.numeric && (counts.numeric < requirements.numeric)) return false;
if (requirements.lower && (counts.lower < requirements.lower)) return false;
if (requirements.upper && (counts.upper < requirements.upper)) return false;
if (requirements.nonalpha && (counts.nonalpha < requirements.nonalpha)) return false;
return true;
}
function strCount(password) {
var counts = { numeric: 0, lower: 0, upper: 0, nonalpha: 0 };
if (typeof password != 'string') return counts;
2018-12-21 01:14:37 +03:00
for (var i = 0; i < password.length; i++) {
2019-02-20 02:38:27 +03:00
if (/\d/.test(password[i])) { counts.numeric++; }
if (/[a-z]/.test(password[i])) { counts.lower++; }
if (/[A-Z]/.test(password[i])) { counts.upper++; }
if (/\W/.test(password[i])) { counts.nonalpha++; }
2018-12-21 01:14:37 +03:00
}
2019-02-20 02:38:27 +03:00
return counts;
2018-12-21 01:14:37 +03:00
}
2019-03-01 03:17:22 +03:00
var xcheckTokenTimer = null;
function checkTokenTimer(enter) {
if ((enter == 0) && (xcheckTokenTimer != null)) { clearInterval(xcheckTokenTimer); xcheckTokenTimer = null; }
if ((enter == 1) && (xcheckTokenTimer == null)) { xcheckTokenTimer = setInterval(checkToken, 200); }
}
2019-02-06 06:07:12 +03:00
function checkToken() {
2019-03-01 03:17:22 +03:00
var t1 = Q('tokenInput').value, t2 = t1.split(' ').join('');
2019-02-06 06:07:12 +03:00
if (t1 != t2) { Q('tokenInput').value = t2; }
2019-02-08 20:24:00 +03:00
QE('tokenOkButton', (Q('tokenInput').value.length == 6) || (Q('tokenInput').value.length == 8) || (Q('tokenInput').value.length == 44));
2019-02-06 06:07:12 +03:00
}
2019-01-16 05:21:03 +03:00
2019-02-12 01:41:15 +03:00
function resetCheckToken() {
2019-03-01 03:17:22 +03:00
var t1 = Q('resetTokenInput').value, t2 = t1.split(' ').join('');
2019-02-12 01:41:15 +03:00
if (t1 != t2) { Q('resetTokenInput').value = t2; }
QE('resetTokenOkButton', (Q('resetTokenInput').value.length == 6) || (Q('resetTokenInput').value.length == 8) || (Q('resetTokenInput').value.length == 44));
}
2020-04-21 11:59:08 +03:00
function changeEmailAddress() {
var email = Q('unconfirmedEmail').innerHTML;
var x = addHtmlValue("Email", '<input id=dp1email style=width:230px maxlength=256 value="' + email + '" autocomplete=off onchange=validateEmailAddress() onkeyup=validateEmailAddress() />');
setDialogMode(1, "Email Confirmation", 3, changeEmailAddressEx, x);
validateEmailAddress();
}
function validateEmailAddress() {
QE('idx_dlgOkButton', (validateEmail(Q('dp1email').value) == true));
}
function changeEmailAddressEx() {
Q('checkEmailVal').value = Q('dp1email').value;
QH('unconfirmedEmail', Q('dp1email').value);
Q('checkEmailButton').click();
}
function resentEmailConfirmation() {
Q('checkEmailVal').value = Q('unconfirmedEmail').innerHTML;
Q('checkEmailButton').click();
}
2018-05-22 02:36:51 +03:00
//
// POPUP DIALOG
//
// undefined = Hidden, 1 = Generic Message
var xxdialogMode;
var xxdialogFunc;
var xxdialogButtons;
var xxdialogTag;
var xxcurrentView = 0;
// Display a dialog box
// Parameters: Dialog Mode (0 = none), Dialog Title, Buttons (1 = OK, 2 = Cancel, 3 = OK & Cancel), Call back function(0 = Cancel, 1 = OK), Dialog Content (Mode 2 only)
function setDialogMode(x, y, b, f, c, tag) {
xxdialogMode = x;
xxdialogFunc = f;
xxdialogButtons = b;
xxdialogTag = tag;
QE('idx_dlgOkButton', true);
QV('idx_dlgOkButton', b & 1);
QV('idx_dlgCancelButton', b & 2);
QV('id_dialogclose', (b & 2) || (b & 8));
QV('idx_dlgButtonBar', b & 7);
if (y) QH('id_dialogtitle', y);
for (var i = 1; i < 24; i++) { QV('dialog' + i, i == x); } // Edit this line when more dialogs are added
QV('dialog', x);
if (c) { if (x == 2) { QH('id_dialogOptions', c); } else { QH('id_dialogMessage', c); } }
}
function dialogclose(x) {
var f = xxdialogFunc;
var b = xxdialogButtons;
var t = xxdialogTag;
setDialogMode();
if (((b & 8) || x) && f) f(x, t);
}
2020-03-14 06:39:21 +03:00
function center() { QS('dialog').left = ((((getDocWidth() - 300) / 2)) + 'px'); }
2018-05-22 02:36:51 +03:00
function messagebox(t, m) { QH('id_dialogMessage', m); setDialogMode(1, t, 1); }
function statusbox(t, m) { QH('id_dialogMessage', m); setDialogMode(1, t); }
function getDocWidth() { if (window.innerWidth) return window.innerWidth; if (document.documentElement && document.documentElement.clientWidth && document.documentElement.clientWidth != 0) return document.documentElement.clientWidth; return document.getElementsByTagName('body')[0].clientWidth; }
function haltEvent(e) { if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false; }
function haltReturn(e) { if (e.keyCode == 13) { haltEvent(e); } }
2018-10-17 00:51:54 +03:00
function validateEmail(v) { var emailReg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9] { 1,3}\.[0-9] { 1,3}\.[0-9] { 1,3}\.[0-9] { 1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z] { 2,}))$/; return emailReg.test(v); } // New version
2019-10-18 03:13:55 +03:00
function format(format) { var args = Array.prototype.slice.call(arguments, 1); return format.replace(/ { (\d+)}/g, function (match, number) { return typeof args[number] != 'undefined' ? args[number] : match; }); };
2020-04-21 11:59:08 +03:00
function addHtmlValue(t, v) { return '<table><td style=text-align:left>' + t + '<td><b>' + v + '</b></table>'; }
2018-05-22 02:36:51 +03:00
</script>
</body>
</html>