2016-02-04 14:40:51 +01:00
|
|
|
(function(){var a={_whatToTrace:[function(g,f){return"groupBy=substr("+g+",1)"},function(g,f){return g+"="+f+"*&groupBy="+g},function(g,f){return g+"="+f}],ipAddr:[function(g,f){return"groupBy=net4("+g+",1)"},function(g,f){return"groupBy=net4("+g+",2)"},function(g,f){return"groupBy=net4("+g+",3)"},function(g,f){return"groupBy=net4("+g+",4)"},function(g,f){return g+"="+f+"&groupBy=_whatToTrace"},function(g,f,h){return h.replace(/\&groupBy.*$/,"")+"&_whatToTrace="+f}],doubleIp:[function(g,f){return g},function(g,f){return"_whatToTrace="+f+"&groupBy=ipAddr"},function(g,f,h){return h.replace(/\&groupBy.*$/,"")+"&ipAddr="+f}]};var d="_password";var b=[["dateTitle",["_utime","startTime","updateTime","_lastAuthnUTime","_lastSeen"]],["connectionTitle",["ipAddr","_timezone","_url"]],["authenticationTitle",["_session_id","_user","_password","authenticationLevel"]],["modulesTitle",["_auth","_userDB","_passwordDB","_issuerDB","_authChoice","_authMulti","_userDBMulti"]],["saml",["_idp","_idpConfKey","_samlToken","_lassoSessionDump","_lassoIdentityDump"]],["groups",["groups","hGroups"]],["ldap",["dn"]],["BrowserID",["_browserIdAnswer","_browserIdAnswerRaw"]],["OpenIDConnect",["OpenIDConnect_IDToken","OpenIDConnect_OP","OpenIDConnect_access_token"]]];var e={session:[{title:"deleteSession",icon:"trash"}],home:[]};var c=angular.module("llngSessionsExplorer",["ui.tree","ui.bootstrap","llApp"]);c.controller("SessionsExplorerCtrl",["$scope","$translator","$location","$q","$http",function(n,f,g,h,k){n.links=links;n.menulinks=menulinks;n.staticPrefix=staticPrefix;n.scriptname=scriptname;n.formPrefix=formPrefix;n.availableLanguages=availableLanguages;n.waiting=true;n.showM=false;n.showT=true;n.data=[];n.currentScope=null;n.currentSession=null;n.menu=e;n.translateP=f.translateP;n.translate=f.translate;n.translateTitle=function(o){return f.translateField(o,"title")};var m="global";n.menuClick=function(o){if(o.popup){window.open(o.popup)}else{if(!o.action){o.action=o.title}switch(typeof o.action){case"function":o.action(n.currentNode,n);break;case"string":n[o.action]();break;default:console.log(typeof o.action)}}n.showM=false};n.deleteSession=function(){n.waiting=true;k["delete"](scriptname+"sessions/"+m+"/"+n.currentSession.id).success(function(o){n.currentSession=null;n.currentScope.remove();n.waiting=false}).error(function(o,p){n.currentSession=null;n.currentScope.remove();n.waiting=false})};n.stoggle=function(o){var p=o.$modelValue;if(p.nodes.length==0){n.updateTree(p.value,p.nodes,p.level,p.query)}o.toggle()};n.displaySession=function(p){var o=function(x){var s=function(z){return z};var r=function(C,D){var A=[];var B=new RegExp(C);for(var z in x){if(z.match(B)&&x[z]){A.push({title:z,value:x[z]});delete x[z]}}if(A.length>0){u.push({title:D,nodes:A})}};var w=x._utime;var y=x._session_id;for(var v in x){if(x[v]==null){delete x[v];console.log(v+" "+x[v])}if(x[v]===""){delete x[v]}else{if(typeof x=="string"&&x[v].match(/; /)){x[v]=x[v].split("; ")}if(typeof x[v]!="object"){if(d.match(new RegExp("\b"+v+"\b"))){x[v]="********"}else{if(v.match(/^(_utime|_lastAuthnUTime|_lastSeen)$/)){x[v]=n.localeDate(x[v])}else{if(v.match(/^(startTime|updateTime)$/)){x[v]=s(x[v])}else{if(v.match(/^notification/)){x[v]=n.localeDate(x[v])}}}}}}}var u=[];b.forEach(function(B){var z=[],C=B[0],A=B[1];A.forEach(function(D){if(x[D]){z.push({title:D,value:x[D]});delete x[D]}});if(z.length>0){u.push({title:"__"+C+"__",nodes:z})}});r("^_openid","OpenID");r("^notification_(.+)","__notificationsDone__");if(x.loginHistory){var t=[];if(x.loginHistory.successLogin){x.loginHistory.successLogin.forEach(function(z){t.push({t:z._utime,title:n.localeDate(z._utime),value:"Success (IP "+z.ipAddr+")"})});if(x.loginHistory.failedLogin){x.loginHistory.failedLogin.forEach(function(z){t.push({t:z._utime,title:n.localeDate(z._utime),value:z.error+" (IP "+z.ipAddr+")"})})}}delete x.loginHistory;t.sort(function(A,z){return A.t-z.t});u.push({title:"__loginHistory__",nodes:t})}var t=[];for(var v in x){t.push({title:v,value:x[v]})}t.sort(function(A,z){return A.title>z.title?1:A.title<z.title?-1:0
|