1var logInfo = null; 2var restrictedInitialized = $.Deferred(); 3 4init(); 5 6function init() { 7 8 9 if (sessionStorage.login && sessionStorage.login != 'null') { 10 logInfo = JSON.parse(sessionStorage.login); 11 restrictedInitialized.resolve(logInfo); 12 } 13 else { 14 var json = JSON.stringify({ 15 host: window.location.host 16 }); 17 rest.getMyUserAccount(json).done(function(data) { 18 if (data) { 19 sessionStorage.login = data; 20 logInfo = JSON.parse(data); 21 var sessionId=Math.floor((Math.random() * 10000000) + 1); 22 var json = JSON.stringify({ 23 "sessionId" : sessionId.toString(), 24 }); 25 rest.successLogin(json); 26 sessionStorage.sessionId=sessionId; 27 } 28 else { // TODO: provide cleaning of this ERROR 29 logInfo = null; 30 sessionStorage.removeItem('login'); 31 restrictedInitialized.resolve(null); 32 } 33 restrictedInitialized.resolve(logInfo); 34 }); 35 36 /* if (rest) { 37 var sessionId=Math.floor((Math.random() * 10000000) + 1); 38 var json = JSON.stringify({ 39 "sessionId" : sessionId.toString(), 40 }); 41 rest.successLogin(json); 42 sessionStorage.sessionId=sessionId; 43 44 }*/ 45 } 46 47} 48 49function hasSession() { 50 return $.ajax({ 51 type: 'GET', 52 async: true, 53 url: 'https://' + location.hostname + (location.port?':'+location.port:'') + '/MainServlet/hasSession', 54 dataType: 'text', 55 contentType: "text/html; charset=utf-8", 56 success: function(data) {return data;}, 57 beforeSend : function( xhr ) { 58 xhr.setRequestHeader( "Authorization", "BEARER " + access_token); 59 }, 60 error: function(jqXHR, textStatus, errorThrown) { 61 console.error('hasSession error!'); 62 return false; 63 64 } 65 }); 66} 67 68function getLogInfo() { 69 return restrictedInitialized; 70} 71 72 73 74 75 76 77
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.