diff --git a/Makefile b/Makefile index 5f06fc900..fa2538f07 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,7 @@ UNCOMPRESS=tar xzf LISTCOMPRESSED=tar tzf COMPRESSSUFFIX=tar.gz NGINX=/usr/sbin/nginx +UGLIFYJSVERSION:=$(shell uglifyjs --version|perl -pe 's/^[^\d]*(\d).*$$/$$1/') # Default directories install # --------------------------- @@ -311,7 +312,11 @@ $(SRCMANAGERDIR)/site/htdocs/static/js/%.js: $(SRCMANAGERDIR)/site/coffee/%.coff %.min.js: %.js @echo "Compressing $*.js" - @uglifyjs $*.js --compress --mangle --comments='/Copyr/i' --source-map $*.min.js.map -o $*.min.js + if test "$(UGLIFYJSVERSION)" = 2; then \ + uglifyjs $*.js --compress --mangle --comments='/Copyr/i' --source-map $*.min.js.map -o $*.min.js; \ + else \ + uglifyjs $*.js --compress --mangle --comments='/Copyr/i' --source-map -o $*.min.js; \ + fi fastcgi-server/man/llng-fastcgi-server.1p: fastcgi-server/sbin/llng-fastcgi-server @echo Update FastCGI server man page diff --git a/_example/etc/manager-apache2.4.conf b/_example/etc/manager-apache2.4.conf index adb89d0ad..6fe88e6ba 100644 --- a/_example/etc/manager-apache2.4.conf +++ b/_example/etc/manager-apache2.4.conf @@ -4,7 +4,7 @@ # To insert LLNG user id in Apache logs, declare this format and use it in # CustomLog directive -#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O" llng +#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O %{Lm-Remote-Custom}o" llng # Manager virtual host (manager.__DNSDOMAIN__) diff --git a/_example/etc/manager-apache2.X.conf b/_example/etc/manager-apache2.X.conf index 25377f236..7289f4f8b 100644 --- a/_example/etc/manager-apache2.X.conf +++ b/_example/etc/manager-apache2.X.conf @@ -7,7 +7,7 @@ # To insert LLNG user id in Apache logs, declare this format and use it in # CustomLog directive -#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O" llng +#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O %{Lm-Remote-Custom}o" llng # Manager virtual host (manager.__DNSDOMAIN__) diff --git a/_example/etc/manager-apache2.conf b/_example/etc/manager-apache2.conf index dc5453639..b26859cef 100644 --- a/_example/etc/manager-apache2.conf +++ b/_example/etc/manager-apache2.conf @@ -7,7 +7,7 @@ # To insert LLNG user id in Apache logs, declare this format and use it in # CustomLog directive -#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O" llng +#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O %{Lm-Remote-Custom}o" llng # Manager virtual host (manager.__DNSDOMAIN__) diff --git a/_example/etc/nginx-lmlog.conf b/_example/etc/nginx-lmlog.conf index c887edfa2..c58014191 100644 --- a/_example/etc/nginx-lmlog.conf +++ b/_example/etc/nginx-lmlog.conf @@ -1,6 +1,6 @@ log_format lm_combined '$remote_addr - $lmremote_user [$time_local] ' '"$request" $status $body_bytes_sent ' - '"$http_referer" "$http_user_agent"'; + '"$http_referer" "$http_user_agent" $lmremote_custom'; log_format lm_app '$remote_addr - $upstream_http_lm_remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' - '"$http_referer" "$http_user_agent"'; + '"$http_referer" "$http_user_agent" $lmremote_custom'; diff --git a/_example/etc/portal-apache2.4.conf b/_example/etc/portal-apache2.4.conf index cb813b571..e6a38d84f 100644 --- a/_example/etc/portal-apache2.4.conf +++ b/_example/etc/portal-apache2.4.conf @@ -4,7 +4,7 @@ # To insert LLNG user id in Apache logs, declare this format and use it in # CustomLog directive -#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O" llng +#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O %{Lm-Remote-Custom}o" llng # Portal Virtual Host (auth.__DNSDOMAIN__) diff --git a/_example/etc/portal-apache2.X.conf b/_example/etc/portal-apache2.X.conf index 0d2b66990..dc362ea0d 100644 --- a/_example/etc/portal-apache2.X.conf +++ b/_example/etc/portal-apache2.X.conf @@ -7,7 +7,7 @@ # To insert LLNG user id in Apache logs, declare this format and use it in # CustomLog directive -#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O" llng +#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O %{Lm-Remote-Custom}o" llng # Portal Virtual Host (auth.__DNSDOMAIN__) diff --git a/_example/etc/portal-apache2.conf b/_example/etc/portal-apache2.conf index 2b3ee86af..6ef65c451 100644 --- a/_example/etc/portal-apache2.conf +++ b/_example/etc/portal-apache2.conf @@ -7,7 +7,7 @@ # To insert LLNG user id in Apache logs, declare this format and use it in # CustomLog directive -#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O" llng +#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O %{Lm-Remote-Custom}o" llng # Portal Virtual Host (auth.__DNSDOMAIN__) diff --git a/_example/etc/test-nginx.conf b/_example/etc/test-nginx.conf index 6b3382386..a10aeb8a9 100644 --- a/_example/etc/test-nginx.conf +++ b/_example/etc/test-nginx.conf @@ -58,6 +58,7 @@ server { ################################## auth_request /lmauth; auth_request_set $lmremote_user $upstream_http_lm_remote_user; + auth_request_set $lmremote_custom $upstream_http_lm_remote_custom; auth_request_set $lmlocation $upstream_http_location; # If CDA is used, uncomment this #auth_request_set $cookie_value $upstream_http_set_cookie; @@ -88,8 +89,9 @@ server { # Uncomment this if you use https only #add_header Strict-Transport-Security "max-age=15768000"; - # Set REMOTE_USER (for FastCGI apps only) + # Set REMOTE_USER and REMOTE_CUSTOM (for FastCGI apps only) #fastcgi_param REMOTE_USER $lmremote_user; + #fastcgi_param REMOTE_CUSTOM $lmremote_custom; } # Handle test CGI @@ -100,6 +102,7 @@ server { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_split_path_info ^(.*\.pl)(/.+)$; fastcgi_param REMOTE_USER $lmremote_user; + fastcgi_param REMOTE_CUSTOM $lmremote_custom; # Or with uWSGI #include /etc/nginx/uwsgi_params; diff --git a/e2e-tests/apache2.conf b/e2e-tests/apache2.conf index 51e433109..cc87bf1c9 100644 --- a/e2e-tests/apache2.conf +++ b/e2e-tests/apache2.conf @@ -25,7 +25,7 @@ LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined -LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O" llng +LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O %{Lm-Remote-Custom}o" llng ErrorLog conf/apache2.log CustomLog conf/apache2.log vhost_combined diff --git a/e2e-tests/lmConf-1.json b/e2e-tests/lmConf-1.json index b84c90f45..9558fe5ff 100644 --- a/e2e-tests/lmConf-1.json +++ b/e2e-tests/lmConf-1.json @@ -207,5 +207,6 @@ "sessionDataToRemember": {}, "timeout": 72000, "userDB": "Same", - "whatToTrace": "_whatToTrace" + "whatToTrace": "_whatToTrace", + "customToTrace": "mail" } diff --git a/e2e-tests/test-nginx.conf b/e2e-tests/test-nginx.conf index e21d2f34f..e9f232cea 100644 --- a/e2e-tests/test-nginx.conf +++ b/e2e-tests/test-nginx.conf @@ -37,6 +37,7 @@ server { try_files $uri $uri/ =404; auth_request /lmauth; auth_request_set $lmremote_user $upstream_http_lm_remote_user; + auth_request_set $lmremote_custom $upstream_http_lm_remote_custom; auth_request_set $lmlocation $upstream_http_location; error_page 401 $lmlocation; include conf/nginx-lua-headers.conf; diff --git a/lemonldap-ng-common/lemonldap-ng.ini b/lemonldap-ng-common/lemonldap-ng.ini index 29b55da08..3a99cf5d7 100644 --- a/lemonldap-ng-common/lemonldap-ng.ini +++ b/lemonldap-ng-common/lemonldap-ng.ini @@ -372,10 +372,11 @@ languages = fr, en, it, vi, ar ; Manager modules enabled ; Set here the list of modules you want to see in manager interface ; The first will be used as default module displayed -enabledModules = conf, sessions, notifications, 2ndFA, viewer +;enabledModules = conf, sessions, notifications, 2ndFA, viewer +enabledModules = conf, sessions, notifications, 2ndFA ; To avoid restricted users to edit configuration, defaulModule MUST be different than 'conf' -; 'viewer' is set by default +; 'conf' is set by default ;defaultModule = viewer ; Viewer module allows us to edit configuration in read-only mode @@ -384,7 +385,7 @@ enabledModules = conf, sessions, notifications, 2ndFA, viewer ;viewerAllowDiff = $uid ne 'dwho' ; ; Viewer options - Default values -;viewerHiddenKeys = samlIDPMetaDataNodes samlSPMetaDataNodes +;viewerHiddenKeys = samlIDPMetaDataNodes samlSPMetaDataNodes managerPassword ManagerDn globalStorageOptions persistentStorageOptions ;viewerAllowBrowser = 0 ;viewerAllowDiff = 0 diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm index c8d99bff1..e0fdb0dc8 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm @@ -129,7 +129,7 @@ sub defaultValues { 'ldapVersion' => 3, 'linkedInAuthnLevel' => 1, 'linkedInFields' => 'id,first-name,last-name,email-address', - 'linkedInScope' => 'r_basicprofile r_emailaddress', + 'linkedInScope' => 'r_liteprofile r_emailaddress', 'linkedInUserField' => 'emailAddress', 'localSessionStorage' => 'Cache::FileCache', 'localSessionStorageOptions' => { diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Session/REST.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Session/REST.pm index d93996a6d..451c91d21 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Session/REST.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Session/REST.pm @@ -276,11 +276,11 @@ sub getMod { my ( $self, $req ) = @_; my ( $s, $m ); unless ( $s = $req->params('sessionType') ) { - $self->error('Session type is required'); + $self->error($req->error('Session type is required')); return (); } unless ( $m = $self->sessionTypes->{$s} ) { - $self->error('Unknown (or unconfigured) session type'); + $self->error($req->error('Unknown (or unconfigured) session type')); return (); } if ( my $kind = $req->params('kind') ) { diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/ApacheMP2/FCGIClient.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/ApacheMP2/FCGIClient.pm index 426941af0..4a2a5711e 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/ApacheMP2/FCGIClient.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/ApacheMP2/FCGIClient.pm @@ -92,6 +92,10 @@ sub handler { if ( $hdrs{'Lm-Remote-User'} ) { $r->user( $hdrs{'Lm-Remote-User'} ); } + if ( $hdrs{'Lm-Remote-Custom'} ) { + $r->subprocess_env( REMOTE_CUSTOM => $hdrs{'Lm-Remote-Custom'} ); + } + my $i = 1; while ( $hdrs{"Headername$i"} ) { $r->headers_in->set( $hdrs{"Headername$i"} => $hdrs{"Headervalue$i"} ) diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/ApacheMP2/Main.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/ApacheMP2/Main.pm index 93b7da8c4..fe2de61ac 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/ApacheMP2/Main.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/ApacheMP2/Main.pm @@ -81,6 +81,15 @@ sub set_user { $request->env->{'psgi.r'}->user($user); } +## @method void set_custom(string custom) +# sets remote_custom +# @param custom string custom_header +sub set_custom { + my ( $class, $request, $custom ) = @_; + $request->env->{'psgi.r'}->subprocess_env( REMOTE_CUSTOM => $custom ) + if defined $custom; +} + ## @method void set_header_in(hash headers) # sets or modifies request headers # @param headers hash containing header names => header value diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/PSGI.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/PSGI.pm index 054743b6c..1b8965f75 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/PSGI.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/PSGI.pm @@ -176,6 +176,13 @@ sub user { || _whatToTrace => 'anonymous' }; } +## @method hashRef custom() +# @return hash of custom data +sub custom { + my ( $self, $req ) = @_; + return { $Lemonldap::NG::Handler::Main::tsv->{customToTrace} }; +} + ## @method string userId() # @return user identifier to log sub userId { @@ -195,7 +202,7 @@ sub group { } ## @method PSGI::Response sendError($req,$err,$code) -# Add user di to $err before calling Lemonldap::NG::Common::PSGI::sendError() +# Add user id to $err before calling Lemonldap::NG::Common::PSGI::sendError() # @param $req Lemonldap::NG::Common::PSGI::Request # @param $err String to push # @code int HTTP error code (default to 500) diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm index 9d8a464b4..0db62c7b4 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm @@ -197,7 +197,7 @@ sub defaultValuesInit { securedCookie timeout timeoutActivity timeoutActivityInterval useRedirectOnError useRedirectOnForbidden useSafeJail whatToTrace handlerInternalCache - handlerServiceTokenTTL + handlerServiceTokenTTL customToTrace ) ); diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Run.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Run.pm index 9ca0a041c..261156618 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Run.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Run.pm @@ -147,6 +147,7 @@ sub run { # ACCOUNTING (1. Inform web server) $class->set_user( $req, $session->{ $class->tsv->{whatToTrace} } ); + $class->set_custom( $req, $session->{ $class->tsv->{customToTrace} } ); # AUTHORIZATION return ( $class->forbidden( $req, $session ), $session ) diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/PSGI/Main.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/PSGI/Main.pm index df144c48f..338fdf281 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/PSGI/Main.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/PSGI/Main.pm @@ -41,6 +41,15 @@ sub set_user { push @{ $req->{respHeaders} }, 'Lm-Remote-User' => $user; } +## @method void set_custom(string custom) +# sets remote_custom in response headers +# @param custom string custom_value +sub set_custom { + my ( $class, $req, $custom ) = @_; + push @{ $req->{respHeaders} }, 'Lm-Remote-Custom' => $custom + if defined $custom; +} + ## @method void set_header_in(hash headers) # sets or modifies request headers # @param headers hash containing header names => header value diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Server/Main.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Server/Main.pm index 9855cd334..6c12effa5 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Server/Main.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Server/Main.pm @@ -39,6 +39,7 @@ sub unset_header_in { *setServerSignature = *Lemonldap::NG::Handler::PSGI::Main::setServerSignature; *thread_share = *Lemonldap::NG::Handler::PSGI::Main::thread_share; *set_user = *Lemonldap::NG::Handler::PSGI::Main::set_user; +*set_custom = *Lemonldap::NG::Handler::PSGI::Main::set_custom; *set_header_out = *Lemonldap::NG::Handler::PSGI::Main::set_header_out; *is_initial_req = *Lemonldap::NG::Handler::PSGI::Main::is_initial_req; *print = *Lemonldap::NG::Handler::PSGI::Main::print; diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Server/Nginx.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Server/Nginx.pm index d0b31cf45..ec109b479 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Server/Nginx.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Server/Nginx.pm @@ -72,7 +72,7 @@ sub handler { my $i = 0; while ( my $k = shift @$hdrs ) { my $v = shift @$hdrs; - if ( $k =~ /^(?:Lm-Remote-User|Cookie)$/ ) { + if ( $k =~ /^(?:Lm-Remote-(?:User|Custom)|Cookie)$/ ) { push @convertedHdrs, $k, $v; } else { diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm index 4227c05dd..c7833a050 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm @@ -52,7 +52,7 @@ sub init { return 0; } - $self->{enabledModules} ||= "conf, sessions, notifications, 2ndFA, viewer"; + $self->{enabledModules} ||= "conf, sessions, notifications, 2ndFA"; my @links; my @enabledModules = map { push @links, $_; "Lemonldap::NG::Manager::" . ucfirst($_) } @@ -88,10 +88,10 @@ sub init { ); # Avoid restricted users to access configuration by default route - my $defaultMod = $self->{defaultModule} || 'viewer'; + my $defaultMod = $self->{defaultModule} || 'conf'; $self->logger->debug("Default module -> $defaultMod"); my ($index) = - grep { $working[$_] =~ /::$defaultMod$/ } ( 0 .. $#working ); + grep { $working[$_] =~ /::$defaultMod$/i } ( 0 .. $#working ); $index //= $#working; $self->logger->debug("Default index -> $index"); $self->defaultRoute( $working[$index]->defaultRoute ); diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm index 73180f4de..d9ccc951a 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm @@ -1022,6 +1022,9 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.] 'customRegister' => { 'type' => 'text' }, + 'customToTrace' => { + 'type' => 'lmAttrOrMacro' + }, 'customUserDB' => { 'type' => 'text' }, @@ -1555,7 +1558,7 @@ m[^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?: 'type' => 'text' }, 'linkedInScope' => { - 'default' => 'r_basicprofile r_emailaddress', + 'default' => 'r_liteprofile r_emailaddress', 'type' => 'text' }, 'linkedInUserField' => { diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm index f04d1ad45..d65775119 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm @@ -891,6 +891,11 @@ sub attributes { documentation => 'Session parameter used to fill REMOTE_USER', flags => 'hp', }, + customToTrace => { + type => 'lmAttrOrMacro', + documentation => 'Session parameter used to fill REMOTE_CUSTOM', + flags => 'hp', + }, lwpOpts => { type => 'keyTextContainer', documentation => 'Options given to LWP::UserAgent', @@ -3163,7 +3168,7 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?: }, linkedInUserField => { type => 'text', default => 'emailAddress' }, linkedInScope => - { type => 'text', default => 'r_basicprofile r_emailaddress' }, + { type => 'text', default => 'r_liteprofile r_emailaddress' }, # WebID webIDAuthnLevel => { diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/CTrees.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/CTrees.pm index 12e1b5055..cea606f49 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/CTrees.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/CTrees.pm @@ -250,7 +250,9 @@ sub cTrees { ] }, ], - casAppMetaDataNode => [ { + casAppMetaDataNode => [ + 'casAppMetaDataExportedVars', + { title => 'casAppMetaDataOptions', form => 'simpleInputContainer', nodes => [ @@ -259,7 +261,6 @@ sub cTrees { 'casAppMetaDataOptionsRule' ] }, - 'casAppMetaDataExportedVars', ], }; } diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm index da25d7882..f314c36e4 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm @@ -511,7 +511,7 @@ sub tree { title => 'logParams', help => 'logs.html', form => 'simpleInputContainer', - nodes => [ 'whatToTrace', 'hiddenAttributes' ] + nodes => [ 'whatToTrace', 'customToTrace', 'hiddenAttributes' ] }, { title => 'cookieParams', diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm index 8ab4781e0..fbb2e4bc9 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm @@ -383,6 +383,7 @@ sub _scanNodes { } elsif ($h) { hdebug(' opened'); + $self->confChanged(1); $self->set( $target, $key, $leaf->{title}, $leaf->{data} ); } @@ -451,6 +452,7 @@ sub _scanNodes { } elsif ($h) { hdebug(' opened'); + $self->confChanged(1); $self->set( $target, $key, $leaf->{title}, $leaf->{data} ); } diff --git a/lemonldap-ng-manager/site/htdocs/static/js/2ndfa.js b/lemonldap-ng-manager/site/htdocs/static/js/2ndfa.js index 9c86640b5..8ad08f61b 100644 --- a/lemonldap-ng-manager/site/htdocs/static/js/2ndfa.js +++ b/lemonldap-ng-manager/site/htdocs/static/js/2ndfa.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.12.7 +// Generated by CoffeeScript 1.12.8 /* * 2ndFA Session explorer diff --git a/lemonldap-ng-manager/site/htdocs/static/js/2ndfa.min.js b/lemonldap-ng-manager/site/htdocs/static/js/2ndfa.min.js index 9b65d0356..f5b155d2c 100644 --- a/lemonldap-ng-manager/site/htdocs/static/js/2ndfa.min.js +++ b/lemonldap-ng-manager/site/htdocs/static/js/2ndfa.min.js @@ -1,2 +1 @@ -(function(){var e,t,n,a,r,i,o,s;s=function(e,t){return $("#msg").html(window.translate(e)),$("#color").removeClass("message-positive message-warning alert-success alert-warning"),$("#color").addClass("message-"+t),"positive"===t&&(t="success"),$("#color").addClass("alert-"+t)},a=25,o={_whatToTrace:[function(e,t){return"groupBy=substr("+e+",1)"},function(e,t){return e+"="+t+"*"}]},i={_whatToTrace:function(e,t,n,a){return console.log("overSchema => level",n,"over",a),1===n&&t.length>a?e+"="+t+"*&groupBy=substr("+e+","+(n+a+1)+")":null}},t="_password",e={dateTitle:["_utime","_startTime","_updateTime"],sfaTitle:["_2fDevices"]},r={home:[]},n=angular.module("llngSessionsExplorer",["ui.tree","ui.bootstrap","llApp"]),n.controller("SessionsExplorerCtrl",["$scope","$translator","$location","$q","$http",function(n,s,l,u,c){var h,p,d,g;return n.links=links,n.menulinks=menulinks,n.staticPrefix=staticPrefix,n.scriptname=scriptname,n.formPrefix=formPrefix,n.availableLanguages=availableLanguages,n.waiting=!0,n.showM=!1,n.showT=!0,n.data=[],n.currentScope=null,n.currentSession=null,n.menu=r,n.searchString="",n.U2FCheck="1",n.TOTPCheck="1",n.UBKCheck="1",n.translateP=s.translateP,n.translate=s.translate,n.translateTitle=function(e){return s.translateField(e,"title")},g="persistent",n.menuClick=function(e){if(e.popup)window.open(e.popup);else switch(e.action||(e.action=e.title),typeof e.action){case"function":e.action(n.currentNode,n),n[e.action]();break;case"string":n[e.action]();break;default:console.log(typeof e.action)}return n.showM=!1},n.search2FA=function(e){return e&&(n.searchString=""),n.currentSession=null,n.data=[],n.updateTree2("",n.data,0,0)},n.delete2FA=function(e,t){var a;return a=angular.element(".data-"+t),a.remove(),n.waiting=!0,c.delete(scriptname+"sfa/"+g+"/"+n.currentSession.id+"?type="+e+"&epoch="+t).then(function(e){return n.waiting=!1},function(e){return n.waiting=!1}),n.showT=!1},n.stoggle=function(e){var t;return t=e.$modelValue,0===t.nodes.length&&n.updateTree(t.value,t.nodes,t.level,t.over,t.query,t.count),e.toggle()},n.displaySession=function(a){var r,i;return i=function(a){var r,i,o,s,l,u,c,h,p,d,g,f,m,T,w,v,y,_,k,C,S;r=function(e){return e},k=a._utime,p=a._session_id;for(g in a)S=a[g],S?("string"==typeof a&&S.match(/; /)&&(a[g]=S.split("; ")),"object"!=typeof a[g]&&(t.match(new RegExp("\b"+g+"\b"))?a[g]="********":g.match(/^(_utime|_lastAuthnUTime|_lastSeen|notification)$/)?a[g]=n.localeDate(S):g.match(/^(_startTime|_updateTime)$/)&&(S=r(S),w=/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/,o=S.match(w),a[g]=o[3]+"/"+o[2]+"/"+o[1]+" à "+o[4]+":"+o[5]+":"+o[6]))):delete a[g];v=[];for(u in e){for(l=e[u],_=[],h=0,f=l.length;h0&&v.push({title:"__"+u+"__",nodes:_})}return{_utime:k,id:p,nodes:v}},n.currentScope=a,r=a.$modelValue.session,c.get(scriptname+"sfa/"+g+"/"+r).then(function(e){return n.currentSession=i(e.data)}),n.showT=!1},n.localeDate=function(e){var t;return t=new Date(1e3*e),t.toLocaleString()},n.getLanguage=function(e){return n.lang=e,n.form="white",n.init(),n.showM=!1},d=function(e,t,a){var r;return r=t.match(/#!?\/(\w+)/),(null===r||r[1].match(/^(persistent)$/))&&(n.type="_session_uid"),n.init()},n.$on("$locationChangeSuccess",d),h=0,n.updateTree=function(e,t,r,s,l,u){var p,d,f;return n.waiting=!0,d=o[n.type]?o[n.type]:o._whatToTrace,p=d[r](n.type,e,l),u>a&&i[n.type]&&(f=i[n.type](n.type,e,r,s,l))?(s++,p=f,r-=1):s=0,c.get(scriptname+"sfa/"+g+"?"+p+"&U2FCheck="+n.U2FCheck+"&TOTPCheck="+n.TOTPCheck+"&UBKCheck="+n.UBKCheck).then(function(a){var i,o,l,u,c;if(i=a.data,i.result){for(c=i.values,o=0,l=c.length;oa&&i[n.type]&&(f=i[n.type](n.type,e,r,s,l))?(s++,p=f,r-=1):s=0,c.get(scriptname+"sfa/"+g+"?_session_uid="+n.searchString+"*&groupBy=substr(_session_uid,"+n.searchString.length+")&U2FCheck="+n.U2FCheck+"&TOTPCheck="+n.TOTPCheck+"&UBKCheck="+n.UBKCheck).then(function(a){var i,o,l,u,c;if(i=a.data,i.result){for(c=i.values,o=0,l=c.length;o level",n,"over",a),1===n&&t.length>a?e+"="+t+"*&groupBy=substr("+e+","+(n+a+1)+")":null}},C={dateTitle:["_utime","_startTime","_updateTime"],sfaTitle:["_2fDevices"]},o={home:[]},angular.module("llngSessionsExplorer",["ui.tree","ui.bootstrap","llApp"]).controller("SessionsExplorerCtrl",["$scope","$translator","$location","$q","$http",function(k,t,e,n,a){var p,r,i,d;return k.links=links,k.menulinks=menulinks,k.staticPrefix=staticPrefix,k.scriptname=scriptname,k.formPrefix=formPrefix,k.availableLanguages=availableLanguages,k.waiting=!0,k.showM=!1,k.showT=!0,k.data=[],k.currentScope=null,k.currentSession=null,k.menu=o,k.searchString="",k.U2FCheck="1",k.TOTPCheck="1",k.UBKCheck="1",k.translateP=t.translateP,k.translate=t.translate,k.translateTitle=function(e){return t.translateField(e,"title")},d="persistent",k.menuClick=function(e){if(e.popup)window.open(e.popup);else switch(e.action||(e.action=e.title),typeof e.action){case"function":e.action(k.currentNode,k),k[e.action]();break;case"string":k[e.action]();break;default:console.log(typeof e.action)}return k.showM=!1},k.search2FA=function(e){return e&&(k.searchString=""),k.currentSession=null,k.data=[],k.updateTree2("",k.data,0,0)},k.delete2FA=function(e,t){return angular.element(".data-"+t).remove(),k.waiting=!0,a.delete(scriptname+"sfa/"+d+"/"+k.currentSession.id+"?type="+e+"&epoch="+t).then(function(e){return k.waiting=!1},function(e){return k.waiting=!1}),k.showT=!1},k.stoggle=function(e){var t;return 0===(t=e.$modelValue).nodes.length&&k.updateTree(t.value,t.nodes,t.level,t.over,t.query,t.count),e.toggle()},k.displaySession=function(e){var t,n;return n=function(o){var e,t,n,a,r,i,s,u,l,c,h,p,d,f,g,m,T,w,v,y,_;for(h in e=function(e){return e},function(e,t){var n,a,r,i;for(n in r=[],a=new RegExp(e),o)i=o[n],n.match(a)&&i&&(r.push({title:n,value:i}),delete o[n]);if(00?{title:"badRequest",message:r,items:[]}:{title:"networkProblem",message:"",items:[]},e.showModal("message.html")},e.showModal=function(t,n){var o,i;return i=a.open({templateUrl:t,controller:"ModalInstanceCtrl",size:"lg",resolve:{elem:function(){return function(t){return e[t]}},set:function(){return function(t,n){return e[t]=n}},init:function(){return n}}}),o=r.defer(),i.result.then(function(t){return e.message={title:"",message:"",items:[]},o.resolve(t)},function(t){return e.message={title:"",message:"",items:[]},o.reject(t)}),o.promise},e.menuClick=function(t){if(t.popup)window.open(t.popup);else switch(t.action||(t.action=t.title),typeof t.action){case"function":t.action(e.currentNode,e);break;case"string":e[t.action]();break;default:console.log(typeof t.action)}return e.showM=!1},e.home=function(){return e.form="home",e.showM=!1},u=function(t){var r;if(e.message={title:"",message:"",items:[],itemsE:[],itemsNC:[],itemsW:[]},t.needConfirm&&(e.confirmNeeded=!0),t.message&&(e.message.message=t.message),t.details){for(r in t.details)"__changes__"!==r&&("__needConfirmation__"===r?(e.message.itemsNC.push({message:r,items:t.details[r]}),console.log("NeedConfirmation:",e.message.itemsNC)):"__warnings__"===r?(e.message.itemsW.push({message:r,items:t.details[r]}),console.log("Warnings:",e.message.itemsW)):(e.message.itemsE.push({message:r,items:t.details[r]}),console.log("Errors:",e.message.itemsE)));e.message.items=e.message.itemsE.concat(e.message.itemsNC.concat(e.message.itemsW))}return e.waiting=!1,1===t.result?(n.path("/confs/"),e.message.title="successfullySaved"):e.message.title="saveReport",e.showModal("message.html")},e.downloadConf=function(){return window.open(e.confPrefix+e.currentCfg.cfgNum+"?full=1")},e.save=function(){return e.showModal("save.html").then(function(){return e.waiting=!0,e.data.push({id:"cfgLog",title:"cfgLog",data:e.result?e.result:""}),t.post(window.confPrefix+"?cfgNum="+e.currentCfg.cfgNum+(e.forceSave?"&force=1":""),e.data).then(function(t){return e.data.pop(),u(t.data)},function(t){return g(t),e.data.pop()})},function(){return console.log("Saving canceled")}),e.showM=!1},e.saveRawConf=function(n){return e.waiting=!0,t.post(window.confPrefix+"/raw",n).then(function(e){return u(e.data)},g)},e.restore=function(){return e.currentNode=null,e.form="restore"},e.cancel=function(){return e.currentNode.data=null,e.getKey(e.currentNode)},p=1,e._findContainer=function(){return e._findScopeContainer().$modelValue},e._findScopeContainer=function(){var t;for(t=e.currentScope;!t.$modelValue.type.match(/Container$/);)t=t.$parentNodeScope;return t},e._findScopeByKey=function(t){var n;for(n=e.currentScope;n.$modelValue.title!==t;)n=n.$parentNodeScope;return n},e.newGrantRule=function(){var t,n;return n=e._findContainer(),t=n.nodes.length,t>0?t-1:0,n.nodes.push({id:n.id+"/n"+p++,title:"New rule",re:"Message",comment:"New rule",data:"1",type:"grant"})},e.newRule=function(){var t,n,r;return r=e._findContainer(),t=r.nodes.length,n=t>0?t-1:0,r.nodes.splice(n,0,{id:r.id+"/n"+p++,title:"New rule",re:"^/new",comment:"New rule",data:"accept",type:"rule"})},e.newPost=function(){var t;return t=e._findContainer(),t.nodes.push({id:t.id+"/n"+p++,title:"/absolute/path/to/form",data:{},type:"post"})},e.newPostVar=function(){return null==e.currentNode.data.vars&&(e.currentNode.data.vars=[]),e.currentNode.data.vars.push(["var1","$uid"])},e.newAuthChoice=function(){var t;return t=e._findContainer(),t.nodes.push({id:t.id+"/n"+p++,title:"1_Key",data:["Null","Null","Null"],type:"authChoice"}),e.execFilters(e._findScopeByKey("authParams"))},e.newHashEntry=function(){var t;return t=e._findContainer(),t.nodes.push({id:t.id+"/n"+p++,title:"new",data:"",type:"keyText"})},e.newCat=function(){var t;return t=e.currentScope,"menuApp"===t.$modelValue.type&&(t=t.$parentNodeScope),t.$modelValue.nodes.push({id:t.$modelValue.id+"/n"+p++,title:"New category",type:"menuCat",nodes:[]})},e.newApp=function(){var t;return t=e.currentScope,"menuApp"===t.$modelValue.type&&(t=t.$parentNodeScope),t.$modelValue.nodes.push({id:t.$modelValue.id+"/n"+p++,title:"New application",type:"menuApp",data:{description:"New app description",uri:"https://test.example.com/",logo:"network.png",display:"auto"}})},e.newCmbMod=function(){var t;return t=e._findContainer(),t.nodes.push({id:t.id+"/n"+p++,title:"new",type:"cmbModule",data:{type:"LDAP",for:"0",over:[]}}),e.execFilters(e._findScopeByKey("authParams"))},e.newSfExtra=function(){var t;return t=e._findContainer(),t.nodes.push({id:t.id+"/n"+p++,title:"new",type:"sfExtra",data:{type:"",rule:"",logo:"",label:"",over:[]}})},e.newSfOver=function(){var t;return t=e.currentNode.data,t.over||(t.over=[]),t.over.push(["new"+p++,""])},e.newCmbOver=function(){var t;return t=e.currentNode.data,t.over||(t.over=[]),t.over.push(["new"+p++,""])},e.newChoiceOver=function(){var t;return t=e.currentNode.data,console.log("data",t),t[5]||(t[5]=[]),t[5].push(["new"+p++,""])},e.addHost=function(){var t;return t=e.currentNode,t.data||(t.data=[]),t.data.push({k:"newHost",h:[{k:"key",v:"uid"}]})},e.addSamlAttribute=function(){var t;return t=e._findContainer(),t.nodes.push({id:t.id+"/n"+p++,title:"new",type:"samlAttribute",data:["0","New","",""]})},e.addVhost=function(){var t;return t=e.domain?"."+e.domain.data:".example.com",e.message={title:"virtualHostName",field:"hostname"},e.showModal("prompt.html",t).then(function(){var t;if(t=e.result)return e.addTemplateNode(t,"virtualHost")})},e.duplicateVhost=function(){var t;return t=e.domain?"."+e.domain.data:".example.com",e.message={title:"virtualHostName",field:"hostname"},e.showModal("prompt.html",t).then(function(){var t;return t=e.result,e.duplicateNode(t,"virtualHost",e.currentNode.title)})},e.addSamlIDP=function(){return e.newTemplateNode("samlIDPMetaDataNode","samlPartnerName","idp-example")},e.addSamlSP=function(){return e.newTemplateNode("samlSPMetaDataNode","samlPartnerName","sp-example")},e.addOidcOp=function(){return e.newTemplateNode("oidcOPMetaDataNode","oidcOPName","op-example")},e.addOidcRp=function(){return e.newTemplateNode("oidcRPMetaDataNode","oidcRPName","rp-example")},e.addCasSrv=function(){return e.newTemplateNode("casSrvMetaDataNode","casPartnerName","srv-example")},e.addCasApp=function(){return e.newTemplateNode("casAppMetaDataNode","casPartnerName","app-example")},e.newTemplateNode=function(t,n,r){return e.message={title:n,field:"name"},e.showModal("prompt.html",r).then(function(){var n;if(n=e.result)return e.addTemplateNode(n,t)})},e.addTemplateNode=function(t,n){var r,a;for(r=e.currentScope;r.$modelValue.title!==n+"s";)r=r.$parentNodeScope;return a={id:n+"s/new__"+t,title:t,type:n,nodes:templates(n,"new__"+t)},h(a.nodes),r.$modelValue.nodes.push(a),r.expand(),a},h=function(e){var t,n,r;for(r=0,t=e.length;r0&&(u=i.nodes[n],i.nodes[n]=i.nodes[n-1],i.nodes[n-1]=u),n},e.inSelect=function(t){var n,r,a,o;for(o=e.currentNode.select,a=0,n=o.length;a0?e.comment:e.re},e.filters={},e.execFilters=function(t){var n,a,o;t=t||e,o=e.filters;for(n in o)if(a=o[n],e.filters.hasOwnProperty(n))return window.filterFunctions[n](t,r,a);return!1},e.stoggle=function(e){var t;return t=e.$modelValue,c(t),e.toggle()},c=function(t){var n,r,a,o,i,s,u,l,d,c,f;for(d=["nodes","nodes_cond"],s=0,r=d.length;s level",n,"over",o),1===n&&t.length>o?e+"="+t+"*&groupBy=substr("+e+","+(n+o+1)+")":null},ipAddr:function(e,t,n,o){return console.log("overSchema => level",n,"over",o),n>0&&n<4&&!t.match(/^\d+\.\d/)&&o<2?e+"="+t+"*&groupBy=net("+e+","+(16*n+4*(o+1))+","+(1+n+o)+")":null},_startTime:function(e,t,n,o){return console.log("overSchema => level",n,"over",o),n>3?e+"="+t+"*&groupBy=substr("+e+","+(10+n+o)+")":null}},t="_password",e={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"],sfaTitle:["_2fDevices"],oidcConsents:["_oidcConsents"]},r={session:[{title:"deleteSession",icon:"trash"}],home:[]},n=angular.module("llngSessionsExplorer",["ui.tree","ui.bootstrap","llApp"]),n.controller("SessionsExplorerCtrl",["$scope","$translator","$location","$q","$http",function(n,u,a,l,c){var p,d,g,h;return n.links=links,n.menulinks=menulinks,n.staticPrefix=staticPrefix,n.scriptname=scriptname,n.formPrefix=formPrefix,n.impPrefix=impPrefix,n.sessionTTL=sessionTTL,n.availableLanguages=availableLanguages,n.waiting=!0,n.showM=!1,n.showT=!0,n.data=[],n.currentScope=null,n.currentSession=null,n.menu=r,n.translateP=u.translateP,n.translate=u.translate,n.translateTitle=function(e){return u.translateField(e,"title")},h="global",n.menuClick=function(e){if(e.popup)window.open(e.popup);else switch(e.action||(e.action=e.title),typeof e.action){case"function":e.action(n.currentNode,n);break;case"string":n[e.action]();break;default:console.log(typeof e.action)}return n.showM=!1},n.deleteOIDCConsent=function(e,t){var o;return o=angular.element(".data-"+t),o.remove(),n.waiting=!0,c.delete(scriptname+"sessions/OIDCConsent/"+h+"/"+n.currentSession.id+"?rp="+e+"&epoch="+t).then(function(e){return n.waiting=!1},function(e){return n.waiting=!1}),n.showT=!1},n.deleteSession=function(){return n.waiting=!0,c.delete(scriptname+"sessions/"+h+"/"+n.currentSession.id).then(function(e){return n.currentSession=null,n.currentScope.remove(),n.waiting=!1},function(e){return n.currentSession=null,n.currentScope.remove(),n.waiting=!1})},n.stoggle=function(e){var t;return t=e.$modelValue,0===t.nodes.length&&n.updateTree(t.value,t.nodes,t.level,t.over,t.query,t.count),e.toggle()},n.displaySession=function(o){var r,i;return i=function(o){var r,i,s,u,a,l,c,p,d,g,h,f,_,m,T,y,w,v,S,$,B,b,D,L,A,P,x,C,I,k,O,R,E,H,M,U;r=function(e,t){var n,r,i,s;i=[],r=new RegExp(e);for(n in o)s=o[n],n.match(r)&&s&&(i.push({title:n,value:s}),delete o[n]);if(i.length>0)return I.push({title:t,nodes:i})},E=o._utime,g=o._session_id;for(_ in o)U=o[_],U?("string"==typeof o&&U.match(/; /)&&(o[_]=U.split("; ")),"object"!=typeof o[_]&&(t.match(new RegExp("\b"+_+"\b"))?o[_]="********":_.match(/^(_utime|_lastAuthnUTime|_lastSeen|notification)$/)?o[_]=n.localeDate(U):_.match(/^(_startTime|_updateTime)$/)&&(o[_]=n.strToLocaleDate(U)))):delete o[_];I=[];for(a in e){for(u=e[a],R=[],d=0,T=u.length;d0&&I.push({title:"__"+a+"__",nodes:R})}if(r("^openid","OpenID"),r("^notification_(.+)","__notificationsDone__"),o._loginHistory){if(M=[],o._loginHistory.successLogin)for(x=o._loginHistory.successLogin,B=0,v=x.length;Bt.title?1:e.title real attribute"),P.push(c)):O.push(c);return M=O.concat(P),I.push({title:"__attributesAndMacros__",nodes:M}),{_utime:E,id:g,nodes:I}},n.currentScope=o,r=o.$modelValue.session,c.get(scriptname+"sessions/"+h+"/"+r).then(function(e){return n.currentSession=i(e.data)}),n.showT=!1},n.localeDate=function(e){var t;return t=new Date(1e3*e),t.toLocaleString()},n.isValid=function(e,t){var n,o,r;return r=a.path(),o=Date.now()/1e3,console.log("Path",r),console.log("Session epoch",e),console.log("Current date",o),console.log("Session TTL",sessionTTL),n=o-eo&&i[n.type]&&(f=i[n.type](n.type,e,r,u,a))?(u++,d=f,r-=1):u=0,c.get(scriptname+"sessions/"+h+"?"+d).then(function(o){var i,s,a,l,c;if(i=o.data,i.result){for(c=i.values,s=0,a=c.length;s level",n,"over",o),1===n&&t.length>o?e+"="+t+"*&groupBy=substr("+e+","+(n+o+1)+")":null},ipAddr:function(e,t,n,o){return console.log("overSchema => level",n,"over",o),0 level",n,"over",o),3t.title?1:e.title real attribute"),D.push(u)):C.push(u);return R=C.concat(D),P.push({title:"__attributesAndMacros__",nodes:R}),{_utime:k,id:c,nodes:P}},t=(H.currentScope=e).$modelValue.session,o.get(scriptname+"sessions/"+g+"/"+t).then(function(e){return H.currentSession=n(e.data)}),H.showT=!1},H.localeDate=function(e){return new Date(1e3*e).toLocaleString()},H.isValid=function(e,t){var n,o,r;return r=i.path(),o=Date.now()/1e3,console.log("Path",r),console.log("Session epoch",e),console.log("Current date",o),console.log("Session TTL",sessionTTL),n=o-e0?{title:"badRequest",message:r,items:[]}:{title:"networkProblem",message:"",items:[]},e.showModal("message.html")},e.showModal=function(t,n){var a,i;return i=o.open({templateUrl:t,controller:"ModalInstanceCtrl",size:"lg",resolve:{elem:function(){return function(t){return e[t]}},set:function(){return function(t,n){return e[t]=n}},init:function(){return n}}}),a=r.defer(),i.result.then(function(t){return e.message={title:"",message:"",items:[]},a.resolve(t)},function(t){return e.message={title:"",message:"",items:[]},a.reject(t)}),a.promise},e.menuClick=function(t){if(t.popup)window.open(t.popup);else switch(t.action||(t.action=t.title),typeof t.action){case"function":t.action(e.currentNode,e);break;case"string":e[t.action]();break;default:console.log(typeof t.action)}return e.showM=!1},e.home=function(){return e.form="homeViewer",e.showM=!1},e.downloadConf=function(){return window.open(e.viewPrefix+e.currentCfg.cfgNum+"?full=1")},d=1,e._findContainer=function(){return e._findScopeContainer().$modelValue},e._findScopeContainer=function(){var t;for(t=e.currentScope;!t.$modelValue.type.match(/Container$/);)t=t.$parentNodeScope;return t},e._findScopeByKey=function(t){var n;for(n=e.currentScope;n.$modelValue.title!==t;)n=n.$parentNodeScope;return n},u=function(t){var n,o;return n=r.defer(),o=r.defer(),t._nodes?(c(t),n.resolve()):t.cnodes?s(t).then(function(){return n.resolve()}):t.nodes||t.data?n.resolve():e.getKey(t).then(function(){return n.resolve()}),n.promise.then(function(){var e,n,a,i,l;if(l=[],t.nodes)for(i=t.nodes,e=0,n=i.length;e0&&(s=i.nodes[n],i.nodes[n]=i.nodes[n-1],i.nodes[n-1]=s),n},e.inSelect=function(t){var n,r,o,a;for(a=e.currentNode.select,n=0,r=a.length;n0?e.comment:e.re},e.filters={},e.execFilters=function(t){var n,o,a;t=t||e,a=e.filters;for(n in a)if(o=a[n],e.filters.hasOwnProperty(n))return window.filterFunctions[n](t,r,o);return!1},e.stoggle=function(e){var t;return t=e.$modelValue,c(t),e.toggle()},c=function(t){var n,r,o,a,i,l,s,u,c,d,f;for(c=["nodes","nodes_cond"],r=0,o=c.length;r