lemonldap-ng/lemonldap-ng-manager/site/htdocs/static/js/2ndfa.min.js

1 line
9.0 KiB
JavaScript
Raw Normal View History

(function(){var c,d,f,g,h,a,e,i,b;b=function(j,k){$("#msg").html(window.translate(j));$("#color").removeClass("message-positive message-warning alert-success alert-warning");$("#color").addClass("message-"+k);if(k==="positive"){k="success"}return $("#color").addClass("alert-"+k)};d=function(l,k,n){var m;console.log("Error",n);m=JSON.parse(l.responseText);if(m&&m.error){m=m.error.replace(/.* /,"");console.log("Returned error",m);return b(m,"warning")}};h=25;i={_whatToTrace:[function(k,j){return"groupBy=substr("+k+",1)"},function(k,j){return k+"="+j+"*&groupBy="+k},function(k,j){return k+"="+j}],_startTime:[function(k,j){return"groupBy=substr("+k+",8)"},function(k,j){return k+"="+j+"*&groupBy=substr("+k+",10)"},function(k,j){return k+"="+j+"*&groupBy=substr("+k+",11)"},function(k,j){return k+"="+j+"*&groupBy=substr("+k+",12)"},function(k,j){return k+"="+j+"*&groupBy=_whatToTrace"},function(k,j,l){console.log(k);console.log(j);console.log(l);return l.replace(/\&groupBy.*$/,"")+("&_whatToTrace="+j)}]};e={_whatToTrace:function(k,j,m,l){if(m===1){return k+"="+j+"*&groupBy=substr("+k+","+(m+l+1)+")"}else{return null}},ipAddr:function(k,j,m,l){if(m>0&&m<4){return k+"="+j+"*&groupBy=net("+k+","+(16*m+4*(l+1))+",2)"}else{return null}}};f="_password";c={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:["_oidc_id_token","_oidc_OP","_oidc_access_token"]};a={delU2FKey:[{title:"deleteU2FKey",icon:"trash"}],addU2FKey:[{title:"addU2FKey",icon:"plus"}],verifyU2FKey:[{title:"verifyU2FKey",icon:"check"}],delTOTPKey:[{title:"deleteTOTPKey",icon:"trash"}],addTOTPKey:[{title:"addTOTPKey",icon:"plus"}],verifyTOTPKey:[{title:"verifyTOTPKey",icon:"check"}],home:[]};g=angular.module("llngSessionsExplorer",["ui.tree","ui.bootstrap","llApp"]);g.controller("SessionsExplorerCtrl",["$scope","$translator","$location","$q","$http",function(r,j,k,l,o){var p,n,m,q;r.links=links;r.menulinks=menulinks;r.staticPrefix=staticPrefix;r.scriptname=scriptname;r.formPrefix=formPrefix;r.availableLanguages=availableLanguages;r.waiting=true;r.showM=false;r.showT=true;r.data=[];r.currentScope=null;r.currentSession=null;r.menu=a;r.searchString="";r.translateP=j.translateP;r.translate=j.translate;r.translateTitle=function(s){return j.translateField(s,"title")};q="global";r.menuClick=function(s){if(s.popup){window.open(s.popup)}else{if(!s.action){s.action=s.title}switch(typeof s.action){case"function":s.action(r.currentNode,r);break;case"string":r[s.action]();break;default:console.log(typeof s.action)}}return r.showM=false};r.search2FA=function(s){if(s){r.searchString=""}r.currentSession=null;r.data=[];return r.updateTree2("",r.data,0,0)};r.deleteU2FKey=function(){r.waiting=true;o["delete"](scriptname+"sfa/"+q+"/"+r.currentSession.id+"?Key=U2F").then(function(s){r.currentSession=null;r.currentScope.remove();return r.waiting=false},function(s){r.currentSession=null;r.currentScope.remove();return r.waiting=false});return r.showT=false};r.deleteTOTPKey=function(){r.waiting=true;o["delete"](scriptname+"sfa/"+q+"/"+r.currentSession.id+"?Key=TOTP").then(function(s){r.currentSession=null;r.currentScope.remove();return r.waiting=false},function(s){r.currentSession=null;r.currentScope.remove();return r.waiting=false});return r.showT=false};r.addU2FKey=function(){r.waiting=true;o.put(scriptname+"sfa/"+q+"/"+r.currentSession.id+"?Key=U2F").then(function(s){r.currentSession=null;r.currentScope.remove();return r.waiting=false},function(s){r.currentSession=null;r.currentScope.remove();return r.waiting=false});return r.showT=false};r.addTOTPKey=function(){r.waiting=true;o.put(scriptname+"sfa/"+q+"/"+r.currentSession.id+"?Key=TOTP").then(function(s){r.c