|
@@ -35,26 +35,26 @@
|
|
|
document.write("<script type=\"text/javascript\" src=\"/esp/files/dist/stub.eclwatch.js\" charset=\"utf-8\"><" + "/script>");
|
|
|
}
|
|
|
getAuthType();
|
|
|
- function getAuthType() {
|
|
|
- if (document.cookie.indexOf("ESPSessionState=true") > -1) {
|
|
|
+ function getAuthType(){
|
|
|
+ if (document.cookie.indexOf ("ESPSessionState=true") > -1){
|
|
|
checkCookie();
|
|
|
- } else if (document.cookie.indexOf("ESPSessionState=false") > -1) {
|
|
|
- // window.location();
|
|
|
+ } else if (document.cookie.indexOf ("ESPSessionState=false") > -1) {
|
|
|
+ window.location();
|
|
|
} else {
|
|
|
sendAuthRequest();
|
|
|
}
|
|
|
|
|
|
- function checkCookie() {
|
|
|
- document.cookie.indexOf("ESPAuthenticated=true") > -1 ? window.location.href : window.location = location.origin + "/esp/files/Login.html";
|
|
|
- }
|
|
|
+ function checkCookie(){
|
|
|
+ document.cookie.indexOf ("ESPAuthenticated=true") > -1 ? window.location.href : window.location = location.origin + "/esp/files/Login.html";
|
|
|
+ }
|
|
|
|
|
|
- function sendAuthRequest() {
|
|
|
+ function sendAuthRequest(){
|
|
|
var xhttp = new XMLHttpRequest();
|
|
|
- xhttp.open('GET', 'esp/getauthtype', true);
|
|
|
+ xhttp.open ('GET', 'esp/getauthtype', true);
|
|
|
xhttp.send();
|
|
|
- xhttp.onload = function () {
|
|
|
+ xhttp.onload = function(){
|
|
|
var responseType = (this.responseXML.childNodes[0].textContent);
|
|
|
- if (this.readyState == 4 && this.status == 200 && this.responseXML.childNodes[0].textContent == responseType) {
|
|
|
+ if (this.readyState == 4 && this.status == 200 && this.responseXML.childNodes[0].textContent == responseType){
|
|
|
switch (responseType) {
|
|
|
case 'Mixed':
|
|
|
case 'PerSessionOnly':
|
|
@@ -67,9 +67,9 @@
|
|
|
break;
|
|
|
default:
|
|
|
document.cookie = ("ESPSessionState=false");
|
|
|
- }
|
|
|
+ }
|
|
|
} else {
|
|
|
- alert('Authorization Request Error.')
|
|
|
+ alert ('Authorization Request Error.')
|
|
|
}
|
|
|
}
|
|
|
}
|