Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html xmlns:th="http://www.thymeleaf.org">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <title>Forgot Password</title>
- <link rel="stylesheet" href="resource/bootstrap.min.css"/>
- <link rel="stylesheet" href="resource/forgotPassword.css">
- <script src="resource/jquery.min.js"></script>
- <script src="resource/bootstrap.min.js"></script>
- <link rel="stylesheet" href="resource/css-loader.css">
- </head>
- <body>
- <div class="content-wrapper">
- <div class="panel-body text-center" style=" padding-top:120px;">
- <div class="container col-md-6 col-md-offset-3" style=" outline: 2px solid black; padding-left:0px; padding-right:0px;box-shadow: -1px -2px 5px;}">
- <div class="container" style="outline: 2px solid black;">
- <div class="row">
- <div>
- <img style="width: 500px;" th:src="@{/logo/IHIELogo}" alt="IHIE Logo">
- </div>
- <div style="width:98%;">
- <div>
- <p class="zero-margin" style="text-align: right;"><img style="padding-bottom: 3px; width: 150px;" th:src="@{/logo/careWebLogo}"></p>
- </div>
- </div>
- </div>
- </div>
- <div class="container" style="padding:0px;" >
- <div class="row" style="padding-top:40px; padding-bottom:40px;">
- <div class="alert-wrap">
- <div class="alert" id="errorDiv" style="display: none;">
- <div class="icon-section"><img th:src="@{/logo/warning}" width="25px" height="25px"></div>
- <div class="alert-msg"><p id="message" ></p></div>
- </div>
- </div>
- <div class="container col-md-10 col-md-offset-1" id="forgotPasswordMain">
- <h4 class="page-header">
- Reset Password
- </h4>
- <div class="form-group row no-gutters" id = "institution">
- <label for="dropOperator" class="col-sm-4 col-md-4 form-control-label text-right" style="padding-top: 7px; font-weight: bold; padding-right: 7px;">Institution<span style="color: #e25c5c;">*</span></label>
- <div class="col-sm-6 col-md-6" style="padding:0px;">
- <select class="form-control" th:field="${institutionList}" id="dropOperator" th:name="dropOperator" required>
- <option value=""><span class="dropdown-text">Use drop-down to select your institution</span></option>
- <option th:each="option : ${institutionList}" th:value="${option.institutionId}" th:text="${option.institutionName}"></option>
- </select>
- </div>
- <div class="icon-section warning" id="dropOperatorSpan" style="display: none;"><img style="margin-top: 3px;" th:src="@{/logo/warning}" width="25px" height="25px"></div>
- </div>
- <div class="form-group row no-gutters">
- <label for="username" class="col-sm-4 col-md-4 form-control-label text-right" style="padding-top: 7px; font-weight: bold; padding-right: 7px;">Username<span style="color: #e25c5c;">*</span></label>
- <div class="col-sm-6 col-md-6" style="padding:0px;">
- <input type="text"
- class="form-control" id="username"
- placeholder="Enter your current username" required>
- </div>
- <div class="icon-section warning" id="usernameSpan" style="display: none;"><img style="margin-top: 3px;" th:src="@{/logo/warning}" width="25px" height="25px"></div>
- </div>
- <div class="row button-section">
- <div class="col-md-2"></div>
- <div class="col-md-8 pr-0">
- <input type="button" class="btn btn-primary" onclick="forgotPwSubmit();" id="mainSubmit" value="Submit" style="width: 100%;">
- </div>
- </div>
- </div>
- <div class="container col-md-10 col-md-offset-1" id="vpnScreen">
- <div class="container" style="padding:0px;" >
- <div class="row" style="padding-top:40px; padding-bottom:40px;">
- <div class="container col-md-10 col-md-offset-1">
- <h4 class="page-header">
- Verify Your Identity
- </h4>
- <!--<div style="float: left;">-->
- <!--<!–<textarea id="qstn">Question Goes here.......?</textarea>–>-->
- <!--<span id="qstn" class="security-qstn">Question Goes here.......?</span>-->
- <!--</div>-->
- <!--<div class="col-md-12 m0 p-0 float-left">-->
- <!--<div class="col-md-6 p-0 mb-4" style="padding: 15px;">-->
- <!--<input type="password" class="form-control" placeholder="Enter the answer">-->
- <!--</div>-->
- <!--</div>-->
- <div style="padding-bottom: 10px;">
- <label style="float: left;">Please answer your security question:</label>
- <input type="text" class="form-control pb-10" id="qstn" readonly>
- </div>
- <div style="padding-bottom: 10px;">
- <label style="float: left;">Answer:</label>
- <div class="d-flex col-md-12 pl-0 pr-2">
- <input type="text" class="form-control" id="answer" placeholder="please enter your answer">
- <div class="icon-section warning" id="answerSpan" style="display: none;"><img style="margin-top: 3px;" th:src="@{/logo/warning}" width="25px" height="25px"></div>
- </div>
- </div>
- <div class="row button-section">
- <input type="button" class="btn btn-primary" value="Verify" style="width: 100%;" onclick="verifyAnswer();">
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="container col-md-10 col-md-offset-1" id="nonVpnScreen">
- <div class="container" style="padding:0px;" >
- <div class="row" style="padding-top:40px; padding-bottom:40px;">
- <div class="container col-md-10 col-md-offset-1">
- <div class="row">
- <div class="col-md-12" id="email" style="display: none;">
- <h4 class="page-header text-center">
- Email Verification
- </h4>
- <!--<div>(d....i@tecnics.com)</div>-->
- <div class="row col-md-12" style="padding: 0; margin: 20px 0px;">
- <div class="col-md-4 zero-margin button-section" style=" padding-left: 0px; width: 100%; margin: 0;">
- <input class="btn btn-primary" type="button" id="emailBtn" onclick="sendCode('email');" value="Send Code">
- </div>
- <div class="col-md-8 zero-margin enter-passcode" style="padding-right: 0px;">
- <input class="form-control" type="text" id="emailPasscode" placeholder="Enter Passcode">
- </div>
- </div>
- <div class="col-md-12 row button-section">
- <input class="btn btn-primary" style="width:100%;" type="button" id="emailSubmitBtn" value="Verify" onclick="verifyPasscode('email');">
- </div>
- </div>
- <div class="col-md-12" id="sms" style="display: none;">
- <h4 class="page-header text-center">
- SMS Verification
- </h4>
- <div class="row col-md-12" style="padding: 0; margin: 20px 0px;">
- <div class="col-md-4 zero-margin button-section" style="padding-left: 0px; width: 100%; margin: 0;">
- <input class="btn btn-primary" type="button" id="smsBtn" onclick="sendCode('sms');" value="Send Code">
- </div>
- <div class="col-md-8 zero-margin enter-passcode" style="padding-right: 0px;">
- <input class="form-control" type="text" id="smsPasscode" placeholder="Enter Passcode">
- </div>
- </div>
- <div class="col-md-12 row button-section">
- <input class="btn btn-primary" style="width:100%;" type="button" id="smsSubmitBtn" value="Verify" onclick="verifyPasscode('sms');">
- </div>
- </div>
- <div class="col-md-12" id="okta" style="display: none;">
- <h4 class="page-header text-center">
- OKTA Verification
- </h4>
- <div class="row col-md-12" style="padding: 0; margin: 20px 0px;">
- <div class="col-md-4 zero-margin button-section" style="padding-left: 0px; width: 100%; margin: 0;">
- <label id="oktaLabel">Please enter the code displayed in the OKTA application.</label>
- </div>
- <div class="col-md-8 zero-margin enter-passcode" style="padding-right: 0px;">
- <input class="form-control" type="text" id="oktaPasscode" placeholder="Enter Passcode">
- </div>
- </div>
- <div class="col-md-12 row button-section">
- <input class="btn btn-primary" style="width:100%;" type="button" id="oktaSubmitBtn" value="Verify" onclick="verifyPasscode('sms');">
- </div>
- </div>
- <div class="col-md-12" id="push" style="display: none;">
- <h4 class="page-header text-center" style=" width: 100%;">Okta Push Verification </h4>
- <div class="row button-section">
- <input class="btn btn-primary" type="button" id="pushBtn" value="Send Push" onclick="sendCode('push');">
- </div>
- <!--<div class="text-center" style="width: 100%; padding: 2% 4% 6%;"><a href="#" onclick="diplayCodeBlock();">or enter code</a></div>-->
- <!--<div id="codeBlock" >-->
- <!--<div class="col-md-8 zero-margin" style="padding-left: 0px; float: left;"><input class="form-control" type="text" id="pushPasscode" placeholder="Enter Passcode"></div>-->
- <!--<div class="col-md-4 button-section zero-margin" style=" margin: 0; padding: 0; float: left"><input class="btn btn-primary" type="button" id="pushVerify" value="Verify" onclick="verifyPushPasscode();"></div>-->
- <!--</div>-->
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="container col-md-10 col-md-offset-1" id="pwScreen">
- <div class="container" style="padding:0px;" >
- <div class="row" style="padding-top:40px; padding-bottom:40px;">
- <div class="container col-md-10 col-md-offset-1">
- <h4 class="page-header">
- Reset Password
- </h4>
- <div class="sub-text" style="width: 70%;">
- <p style="font-size: 14px;">CareWeb requires a new password every 90 days. Please enter an new password.</p>
- </div>
- <div class="form-group row no-gutters">
- <label for="username" class="col-sm-5 col-md-5 form-control-label text-right" style="padding-top: 7px; font-weight: bold; padding-right: 7px;">Password<span style="color: #e25c5c;">*</span></label>
- <div class="col-sm-6 col-md-6" style="padding:0px;">
- <input type="password"
- class="form-control" id="password"
- placeholder="Enter Password" required>
- </div>
- <div class="icon-section warning" id="passwordSpan" style="display: none;"><img style="margin-top: 3px;" th:src="@{/logo/warning}" width="25px" height="25px"></div>
- </div>
- <div class="form-group row no-gutters">
- <label for="username" class="col-sm-5 col-md-5 form-control-label text-right" style="padding-top: 7px; font-weight: bold; padding-right: 7px;">Confirm Password<span style="color: #e25c5c;">*</span></label>
- <div class="col-sm-6 col-md-6" style="padding:0px;">
- <input type="password"
- class="form-control" id="confirmPassword"
- placeholder="Enter Confirm Password" required>
- </div>
- <div class="icon-section warning" id="confirmPasswordSpan" style="display: none;"><img style="margin-top: 3px;" th:src="@{/logo/warning}" width="25px" height="25px"></div>
- </div>
- <div class="row button-section">
- <div class="col-md-2"></div>
- <div class="col-md-8 pr-0">
- <input type="button" class="btn btn-primary" onclick="resetPassword();" value="Submit" style="width: 100%;">
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="container col-md-10 col-md-offset-1" id="errorScreen">
- <div class="container" style="padding:0px;" >
- <div class="row" style="padding-top:40px; padding-bottom:40px;">
- <div class="container col-md-10 col-md-offset-1" style="outline: 2px solid #ea4051; box-shadow: -1px 1px 6px;">
- <p style="font-size: 20px; color: red; margin: 0px;">An Error Occurred. Please contact IHIE. </p>
- <p style="font-size: 15px; color: red;">Email: support@ihie.org </p>
- </div>
- </div>
- </div>
- </div>
- <div class="sub-text">
- <p>If you do not remember this information, please contact the IHIE Help Desk at 877-435-7343 or Helpdesk@ihie.org </p>
- </div>
- </div>
- </div>
- <div>
- <p style="background-color: #3a73b1; height: 30px; text-align: left; padding-left: 20px; padding-top: 4px;"></p>
- </div>
- </div>
- </div>
- </div>
- <div class="loader loader-default" id="loadingSpinner"></div>
- </body>
- <script th:inline="javascript">
- var contextPath = window.location.href.split('/')[3];
- document.getElementById('forgotPasswordMain').style.display = 'block';
- document.getElementById('vpnScreen').style.display = 'none';
- document.getElementById('nonVpnScreen').style.display = 'none';
- document.getElementById('pwScreen').style.display = 'none';
- document.getElementById('errorScreen').style.display = 'none';
- var institutes = /*[[${institutionList}]]*/ 'defaultanyvalue';
- var postForgotResult = {};
- var nonVpnData = {};
- var cookiePresent = checkCookie("institutionId");
- if(cookiePresent != ""){
- var instId = getCookie("institutionId");
- $('#dropOperator').find("option[value*='instId']").prop('selected', true);
- document.getElementById('dropOperator').value = instId;
- }
- function forgotPwSubmit() {
- $('#loadingSpinner').addClass('is-active');
- var selectedInstituteId = document.getElementById('dropOperator').value;
- var finalData;
- finalData = getInstitution(selectedInstituteId);
- if(cookiePresent != ""){
- getInstitution(selectedInstituteId);
- setCookie("institutionId", selectedInstituteId, 30);
- setCookie("institutionName", finalData['institutionName'], 30);
- }
- else if(cookiePresent == ""){
- setCookie("institutionId", selectedInstituteId, 30);
- setCookie("institutionName", finalData['institutionName'], 30);
- }
- if (username != '' && selectedInstituteId != '') {
- document.getElementById('errorDiv').style.display = 'none';
- document.getElementById('mainSubmit').disabled = true;
- document.getElementById('dropOperatorSpan').style.display = 'none';
- document.getElementById('usernameSpan').style.display = 'none';
- $.ajax({
- method: "POST",
- url: '/' + contextPath + '/password/forgot',
- data: JSON.stringify(finalData),
- contentType: "application/json; charset=utf-8",
- success: function(data){
- postForgotResult = data;
- console.log("Data in Ajax is: ", data);
- if(data.connectionType == 'VPN') {
- document.getElementById('forgotPasswordMain').style.display = 'none';
- document.getElementById('vpnScreen').style.display = 'block';
- document.getElementById('nonVpnScreen').style.display = 'none';
- document.getElementById('pwScreen').style.display = 'none';
- document.getElementById('errorScreen').style.display = 'none';
- document.getElementById('qstn').value = data.recoveryQuestion;
- $('#loadingSpinner').removeClass('is-active');
- } else if(data.connectionType == 'NONVPN') {
- document.getElementById('forgotPasswordMain').style.display = 'none';
- document.getElementById('vpnScreen').style.display = 'none';
- document.getElementById('nonVpnScreen').style.display = 'block';
- document.getElementById('pwScreen').style.display = 'none';
- document.getElementById('errorScreen').style.display = 'none';
- nonVpnData = data;
- if (data.factorType == 'sms'){
- document.getElementById('sms').style.display = 'block';
- }else if (data.factorType == 'email'){
- document.getElementById('email').style.display = 'block';
- }else if (data.factorType == 'push'){
- document.getElementById('push').style.display = 'block';
- }
- else if (data.factorType == 'OKTA'){
- document.getElementById('okta').style.display = 'block';
- }
- $('#loadingSpinner').removeClass('is-active');
- } else {
- document.getElementById('forgotPasswordMain').style.display = 'none';
- document.getElementById('vpnScreen').style.display = 'none';
- document.getElementById('nonVpnScreen').style.display = 'none';
- document.getElementById('pwScreen').style.display = 'none';
- document.getElementById('errorScreen').style.display = 'block';
- $('#loadingSpinner').removeClass('is-active');
- }
- }
- });
- } else {
- if (selectedInstituteId == '' && username !== '') {
- document.getElementById('message').innerHTML = 'Please select institution before submitting information.';
- document.getElementById('errorDiv').style.display = 'block';
- document.getElementById('dropOperatorSpan').style.display = 'block';
- document.getElementById('usernameSpan').style.display = 'none';
- $('#loadingSpinner').removeClass('is-active');
- } else if (username == '' && selectedInstituteId !== ''){
- document.getElementById('message').innerHTML = 'Please enter your username before submitting information.';
- document.getElementById('errorDiv').style.display = 'block';
- document.getElementById('usernameSpan').style.display = 'block';
- document.getElementById('dropOperatorSpan').style.display = 'none';
- $('#loadingSpinner').removeClass('is-active');
- } else {
- document.getElementById('message').innerHTML = 'Please select institution before submitting information. Please enter your username before submitting information.';
- document.getElementById('errorDiv').style.display = 'block';
- document.getElementById('usernameSpan').style.display = 'block';
- document.getElementById('dropOperatorSpan').style.display = 'block';
- $('#loadingSpinner').removeClass('is-active');
- }
- }
- }
- function verifyAnswer(){
- $('#loadingSpinner').addClass('is-active');
- var enteredAnswer = document.getElementById('answer').value;
- postForgotResult['answer'] = enteredAnswer;
- if (enteredAnswer != ''){
- document.getElementById('errorDiv').style.display = 'none';
- document.getElementById('answerSpan').style.display = 'none';
- $.ajax({
- method: "POST",
- url: '/' + contextPath + '/password/answer',
- data: JSON.stringify(postForgotResult),
- contentType: "application/json; charset=utf-8",
- success: function(data){
- if (data == true){
- document.getElementById('forgotPasswordMain').style.display = 'none';
- document.getElementById('vpnScreen').style.display = 'none';
- document.getElementById('nonVpnScreen').style.display = 'none';
- document.getElementById('pwScreen').style.display = 'block';
- document.getElementById('errorScreen').style.display = 'none';
- document.getElementById('errorDiv').style.display = 'none';
- document.getElementById('answerSpan').style.display = 'none';
- $('#loadingSpinner').removeClass('is-active');
- } else {
- document.getElementById('message').innerHTML = 'The answer you provided is incorrect. Please re-enter your answer.';
- document.getElementById('errorDiv').style.display = 'block';
- document.getElementById('answerSpan').style.display = 'block';
- $('#loadingSpinner').removeClass('is-active');
- }
- }
- });
- } else {
- document.getElementById('message').innerHTML = 'Please enter the answer to your security question before submitting information.';
- document.getElementById('errorDiv').style.display = 'block';
- document.getElementById('answerSpan').style.display = 'block';
- $('#loadingSpinner').removeClass('is-active');
- }
- }
- function resetPassword() {
- $('#loadingSpinner').addClass('is-active');
- var enteredPassword = document.getElementById('password').value;
- var enteredConfirmPassword = document.getElementById('confirmPassword').value;
- if (enteredPassword != '' && enteredConfirmPassword != '') {
- document.getElementById('errorDiv').style.display = 'none';
- document.getElementById('passwordSpan').style.display = 'none';
- document.getElementById('confirmPasswordSpan').style.display = 'none';
- if(enteredPassword == enteredConfirmPassword) {
- postForgotResult['password'] = enteredPassword;
- $.ajax({
- method: "POST",
- url: '/' + contextPath + '/password/change',
- data: JSON.stringify(postForgotResult),
- contentType: "application/json; charset=utf-8",
- success: function(data){
- <!--if (data == null) {-->
- <!--var curUrl = window.location.href;-->
- <!--var pathList = curUrl.split("/");-->
- <!--var signinPath = pathList[0] + "//" + pathList[2] + "/" + contextPath + "/signin" ;-->
- <!--window.location.href = signinPath;-->
- <!--}-->
- if(data){
- document.write(data);
- }
- }
- });
- } else {
- document.getElementById('message').innerHTML = 'The passwords do not match. Please re-enter';
- document.getElementById('errorDiv').style.display = 'block';
- $('#loadingSpinner').removeClass('is-active');
- }
- } else {
- if (enteredPassword == '' && enteredConfirmPassword !== ''){
- document.getElementById('message').innerHTML = 'Please enter the password before submitting information.';
- document.getElementById('errorDiv').style.display = 'block';
- document.getElementById('passwordSpan').style.display = 'block';
- document.getElementById('confirmPasswordSpan').style.display = 'none';
- $('#loadingSpinner').removeClass('is-active');
- } else if (enteredPassword !== '' && enteredConfirmPassword == ''){
- document.getElementById('message').innerHTML = 'Please enter the confirmation password before submitting information.';
- document.getElementById('errorDiv').style.display = 'block';
- document.getElementById('passwordSpan').style.display = 'none';
- document.getElementById('confirmPasswordSpan').style.display = 'block';
- $('#loadingSpinner').removeClass('is-active');
- } else {
- document.getElementById('message').innerHTML = 'Please enter the password and confirmation password before submitting information.';
- document.getElementById('errorDiv').style.display = 'block';
- document.getElementById('passwordSpan').style.display = 'block';
- document.getElementById('confirmPasswordSpan').style.display = 'block';
- $('#loadingSpinner').removeClass('is-active');
- }
- }
- }
- function sendCode(factorType){
- $('#loadingSpinner').addClass('is-active');
- nonVpnData['passCode'] = null;
- btnId = '#' + factorType + 'Btn';
- var btnText = $(btnId)[0].getAttribute("value");
- var type;
- if (btnText == 'Send Code'){
- type = 'send';
- }else {
- type='resend';
- }
- $(btnId).attr("disabled", "disabled");
- if (factorType == 'push') {
- document.getElementById('pushBtn').disabled = true;
- console.log("Inside first Condition");
- $.ajax({
- method: "POST",
- url: '/' + contextPath + '/password/send',
- data: JSON.stringify(nonVpnData),
- contentType: "application/json; charset=utf-8",
- success: function(data){
- console.log("Inside first AJAX");
- var timer = setInterval(function(){
- $.ajax({
- method: "POST",
- url: '/' + contextPath + '/password/poll',
- data: JSON.stringify(data),
- contentType: "application/json; charset=utf-8",
- success: function(pollData){
- console.log("Inside second Condition", pollData);
- if ('factorResult' in pollData && pollData.factorResult == 'REJECTED'){
- clearInterval(timer);
- var curUrl = window.location.href;
- var pathList = curUrl.split("/");
- var signinPath = pathList[0] + "//" + pathList[2] + "/" + contextPath + "/signin" ;
- window.location.href = signinPath;
- }else if ('factorResult' in pollData && pollData.factorResult == 'SUCCESS') {
- clearInterval(timer);
- document.getElementById('forgotPasswordMain').style.display = 'none';
- document.getElementById('vpnScreen').style.display = 'none';
- document.getElementById('nonVpnScreen').style.display = 'none';
- document.getElementById('pwScreen').style.display = 'block';
- document.getElementById('errorScreen').style.display = 'none';
- $('#loadingSpinner').removeClass('is-active');
- }else if ('factorResult' in pollData && pollData.factorResult == 'TIMEOUT'){
- clearInterval(timer);
- var curUrl = window.location.href;
- var pathList = curUrl.split("/");
- var signinPath = pathList[0] + "//" + pathList[2] + "/" + contextPath + "/signin" ;
- window.location.href = signinPath;
- }
- }
- });
- }, 3000);
- }
- });
- } else {
- $.ajax({
- method: "POST",
- url: '/' + contextPath + '/password/send',
- data: JSON.stringify(nonVpnData),
- contentType: "application/json; charset=utf-8",
- success: function(data){
- console.log("Inside else ajax", factorType);
- if ('factorResult' in data){
- $('#loadingSpinner').removeClass('is-active');
- } else {
- var curUrl = window.location.href;
- var pathList = curUrl.split("/");
- var signinPath = pathList[0] + "//" + pathList[2] + "/" + contextPath + "/signin" ;
- window.location.href = signinPath;
- }
- }
- });
- setTimeout(function(){
- $(btnId).attr("value", "Re-send Code");
- $(btnId).removeAttr("disabled");
- }, 30000);
- }
- $(btnId).attr("value", "Sent");
- }
- function verifyPasscode(type){
- $('#loadingSpinner').addClass('is-active');
- var passCode;
- if(type == 'sms'){
- passCode = document.getElementById('smsPasscode').value;
- } else if (type == 'email'){
- passCode = document.getElementById('emailPasscode').value;
- }else if (type == 'okta'){
- passCode = document.getElementById('oktaPasscode').value;
- }
- if (passCode != ''){
- nonVpnData['passCode'] = passCode;
- console.log("nonVPNData is: ", nonVpnData);
- $.ajax({
- method: "POST",
- url: '/' + contextPath + '/password/verify',
- data: JSON.stringify(nonVpnData),
- contentType: "application/json; charset=utf-8",
- success: function(data){
- if ('factorResult' in data){
- if(data.factorResult == 'SUCCESS'){
- $('#loadingSpinner').removeClass('is-active');
- document.getElementById('forgotPasswordMain').style.display = 'none';
- document.getElementById('vpnScreen').style.display = 'none';
- document.getElementById('nonVpnScreen').style.display = 'none';
- document.getElementById('pwScreen').style.display = 'block';
- document.getElementById('errorScreen').style.display = 'none';
- } else {
- var curUrl = window.location.href;
- var pathList = curUrl.split("/");
- var signinPath = pathList[0] + "//" + pathList[2] + "/" + contextPath + "/signin" ;
- window.location.href = signinPath;
- }
- } else {
- var curUrl = window.location.href;
- var pathList = curUrl.split("/");
- var signinPath = pathList[0] + "//" + pathList[2] + "/" + contextPath + "/signin" ;
- window.location.href = signinPath;
- }
- }
- });
- }
- }
- function verifyPushPasscode() {
- $('#loadingSpinner').addClass('is-active');
- passCode = document.getElementById('pushPasscode').value;
- if (passCode != ''){
- nonVpnData['passCode'] = passCode;
- $.ajax({
- method: "POST",
- url: '/' + contextPath + '/password/verify',
- data: JSON.stringify(nonVpnData),
- contentType: "application/json; charset=utf-8",
- success: function(data){
- if ('factorResult' in data){
- if(data.factorResult == 'SUCCESS'){
- $('#loadingSpinner').removeClass('is-active');
- alert('SUCCESS');
- } else {
- $('#loadingSpinner').removeClass('is-active');
- alert(data.factorResult);
- }
- } else {
- var curUrl = window.location.href;
- var pathList = curUrl.split("/");
- var signinPath = pathList[0] + "//" + pathList[2] + "/" + contextPath + "/signin" ;
- window.location.href = signinPath;
- }
- }
- });
- }
- }
- function setCookie(cname,cvalue,exdays) {
- var d = new Date();
- d.setTime(d.getTime() + (exdays*24*60*60*1000));
- var expires = "expires=" + d.toGMTString();
- document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
- }
- function getCookie(cname) {
- var name = cname + "=";
- var decodedCookie = decodeURIComponent(document.cookie);
- var ca = decodedCookie.split(';');
- for(var i = 0; i < ca.length; i++) {
- var c = ca[i];
- while (c.charAt(0) == ' ') {
- c = c.substring(1);
- }
- if (c.indexOf(name) == 0) {
- return c.substring(name.length, c.length);
- }
- }
- return "";
- }
- function checkCookie(instName) {
- var user=getCookie(instName);
- if (user != "") {
- console.log("The cookie is: ", user);
- return user;
- <!--document.getElementById('institution').style.display = 'none';-->
- <!--document.getElementById('institution').value = user;-->
- }
- else{
- return "";
- }
- <!--else if(document.getElementById('dropOperator').options[document.getElementById('dropOperator').selectedIndex].text != ""){-->
- <!--user = document.getElementById('dropOperator').options[document.getElementById('dropOperator').selectedIndex].text;-->
- <!--alert(user);-->
- <!--if (user != "" && user != null) {-->
- <!--setCookie(institutionName, user, 30);-->
- <!--}-->
- <!--}-->
- }
- function getInstitution(selectedIns){
- let data = {};
- for(var i=0; i<institutes.length; i++){
- if (institutes[i].institutionId == selectedIns){
- data = institutes[i];
- }
- }
- var username = document.getElementById('username').value;
- data['username'] = username;
- return data;
- }
- </script>
- </html>
Add Comment
Please, Sign In to add comment