|
@@ -3,12 +3,7 @@
|
|
<head>
|
|
<head>
|
|
<#include "layout/header.ftl">
|
|
<#include "layout/header.ftl">
|
|
<#include "layout/common.cssjs.ftl">
|
|
<#include "layout/common.cssjs.ftl">
|
|
-
|
|
|
|
- <style>
|
|
|
|
- .wrapper { position: relative; }
|
|
|
|
- i.fa { position: absolute; top: 5px; left: 5px; font-size: 22px; color: gray;}
|
|
|
|
- .wrapper input { text-indent: 20px;}
|
|
|
|
- </style>
|
|
|
|
|
|
+ <script src ="<@base />/static/javascript/login.js" type="text/javascript" ></script>
|
|
|
|
|
|
<#if true==isKerberos>
|
|
<#if true==isKerberos>
|
|
<@browser name="MSIE">
|
|
<@browser name="MSIE">
|
|
@@ -25,138 +20,6 @@
|
|
</script>
|
|
</script>
|
|
</@browser>
|
|
</@browser>
|
|
</#if>
|
|
</#if>
|
|
-
|
|
|
|
- <script type="text/javascript">
|
|
|
|
- <#--resend captcha code Interval-->
|
|
|
|
- var captchaCountTimer;
|
|
|
|
- var captchaCount=60;
|
|
|
|
- function getCaptchaCount(){
|
|
|
|
- $("#mobile_j_otp_captcha_button").val("<@locale code="login.text.login.mobile.obtain.valid"/>("+captchaCount+")<@locale code="login.text.login.mobile.obtain.valid.unit"/>");
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- captchaCount--;
|
|
|
|
- if(captchaCount==0){
|
|
|
|
- $("#mobile_j_otp_captcha_button").val("<@locale code="login.text.login.mobile.obtain"/>");
|
|
|
|
- captchaCount=60;
|
|
|
|
- clearInterval(captchaCountTimer);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- <#--current datetime-->
|
|
|
|
- var currentDate= new Date('${.now}');
|
|
|
|
- var fullYear=currentDate.getFullYear();
|
|
|
|
- var month=currentDate.getMonth()+1;
|
|
|
|
- var date=currentDate.getDate();
|
|
|
|
-
|
|
|
|
- var hours=currentDate.getHours();
|
|
|
|
- var minutes=currentDate.getMinutes();
|
|
|
|
- var seconds=currentDate.getSeconds();
|
|
|
|
- var strTime="";
|
|
|
|
- function formatTime(){
|
|
|
|
- strTime=fullYear+"-";
|
|
|
|
- strTime+=(month<10?"0"+month:month)+"-";
|
|
|
|
- strTime+=(date<10?"0"+date:date)+" ";
|
|
|
|
- strTime+=(hours<10?"0"+hours:hours)+":";
|
|
|
|
- strTime+=(minutes<10?"0"+minutes:minutes)+":";
|
|
|
|
- strTime+=(seconds<10?"0"+seconds:seconds);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- <#if true==isMfa && "TOPT"==otpType>
|
|
|
|
- function currentTime(){
|
|
|
|
- seconds++;
|
|
|
|
- if(seconds>59){
|
|
|
|
- minutes++;
|
|
|
|
- seconds=0;
|
|
|
|
- }
|
|
|
|
- if(minutes>59){
|
|
|
|
- hours++;
|
|
|
|
- minutes=0;
|
|
|
|
- }
|
|
|
|
- if(hours>23){
|
|
|
|
- date++;
|
|
|
|
- hours=0;
|
|
|
|
- }
|
|
|
|
- formatTime();
|
|
|
|
- //for timebase token
|
|
|
|
- getTimeBaseCount();
|
|
|
|
-
|
|
|
|
- $("#currentTime").val(strTime);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- <#--timeBase Token Interval default is 30s-->
|
|
|
|
- var timeBaseCount;
|
|
|
|
- function getTimeBaseCount(){
|
|
|
|
- if(seconds<${otpInterval}){
|
|
|
|
- timeBaseCount=${otpInterval}-seconds;
|
|
|
|
- }else{
|
|
|
|
- timeBaseCount=${otpInterval}-(seconds-${otpInterval});
|
|
|
|
- }
|
|
|
|
- $("#tfa_j_otp_captcha_button").val("<@locale code="login.text.login.twofactor.validTime"/>("+timeBaseCount+")<@locale code="login.text.login.twofactor.validTime.unit"/>");
|
|
|
|
- };
|
|
|
|
- </#if>
|
|
|
|
- var currentSwitchTab="normalLogin";
|
|
|
|
- <#--submit form-->
|
|
|
|
- function doLoginSubmit(){
|
|
|
|
- $.cookie("mxk_login_username", $("#"+currentSwitchTab+"Form input[name=username]").val(), { expires: 7 });
|
|
|
|
- $("#"+currentSwitchTab+"SubmitButton").click();
|
|
|
|
- $.cookie("mxk_login_switch_tab", currentSwitchTab, { expires: 7 });
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- <#--switch Login Form-->
|
|
|
|
- function switchTab(id){
|
|
|
|
- if($("#"+id+"Form input[name=username]").val()==""){
|
|
|
|
- $("#"+id+"Form input[name=username]").focus();
|
|
|
|
- }else{
|
|
|
|
- $("#"+id+"Form input[name=password]").focus();
|
|
|
|
- }
|
|
|
|
- currentSwitchTab=id;
|
|
|
|
- }
|
|
|
|
- <#-- when press ENTER key,do form submit-->
|
|
|
|
- document.onkeydown=function(event){
|
|
|
|
- var e = event || window.event || arguments.callee.caller.arguments[0];
|
|
|
|
- if(e && e.keyCode==13){
|
|
|
|
- doLoginSubmit();
|
|
|
|
- };
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- $(function(){
|
|
|
|
- <#if true==isMfa && "TOPT"==otpType>
|
|
|
|
- setInterval("currentTime()", 1000);
|
|
|
|
- </#if>
|
|
|
|
-
|
|
|
|
- <#--submit loginForme-->
|
|
|
|
- $(".doLoginSubmit").on("click",function(){
|
|
|
|
- doLoginSubmit();
|
|
|
|
- });
|
|
|
|
- var cookieLoginUsername = $.cookie("mxk_login_username");
|
|
|
|
- <#--read username cookie for login e-->
|
|
|
|
- if(cookieLoginUsername != undefined && cookieLoginUsername != ""){
|
|
|
|
- var switch_tab=$.cookie("mxk_login_switch_tab")==undefined ? "normalLogin" : $.cookie("mxk_login_switch_tab");
|
|
|
|
- $("#"+switch_tab).click();
|
|
|
|
- $("#"+switch_tab+"Form input[name=username]").val(cookieLoginUsername ==undefined ? "" : cookieLoginUsername);
|
|
|
|
- $("#div_"+switch_tab+" input[name=password]").focus();
|
|
|
|
- }else{
|
|
|
|
- $("#div_normalLogin input[name=username]").focus();
|
|
|
|
- }
|
|
|
|
- <#--resend captchae-->
|
|
|
|
- $("#mobile_j_otp_captcha_button").on("click",function(){
|
|
|
|
- if(captchaCount<60){
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- var loginName = $("#mobile_j_username").val();
|
|
|
|
- if(loginName == ""){
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- $.get("<@base />/login/sendsms/"+loginName,function(data,status){
|
|
|
|
- //alert("Data: " + data + "\nStatus: " + status);
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- <#--todo:send captcha-->
|
|
|
|
- captchaCountTimer=setInterval("getCaptchaCount()", 1000);
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- });
|
|
|
|
-</script>
|
|
|
|
</head>
|
|
</head>
|
|
<body >
|
|
<body >
|
|
<div id="top">
|
|
<div id="top">
|