Merge branch 'v2.0'

This commit is contained in:
Xavier Guimard 2019-05-07 09:36:19 +02:00
commit db4b46c487
20 changed files with 90 additions and 40 deletions

View File

@ -318,9 +318,19 @@ fastcgi-server/man/llng-fastcgi-server.1p: fastcgi-server/sbin/llng-fastcgi-serv
# Perl libraries configuration
json: $(MANAGERJSONDST) fastcgi-server/man/llng-fastcgi-server.1p
json: $(MANAGERJSONDST) fastcgi-server/man/llng-fastcgi-server.1p debian/*cron*
@if which yui-compressor >/dev/null; then $(MAKE) minify; fi
debian/liblemonldap-ng-handler-perl.cron.d: lemonldap-ng-handler/eg/scripts/purgeLocalCache.cron.d
@perl -pe 's/__APACHEUSER__/www-data/g;s@__BINDIR__@/usr/share/lemonldap-ng/bin@g' \
lemonldap-ng-handler/eg/scripts/purgeLocalCache.cron.d \
> debian/liblemonldap-ng-handler-perl.cron.d
debian/liblemonldap-ng-portal-perl.cron.d: lemonldap-ng-portal/site/cron/purgeCentralCache.cron.d
@perl -pe 's/__APACHEUSER__/www-data/g;s@__BINDIR__@/usr/share/lemonldap-ng/bin@g' \
lemonldap-ng-portal/site/cron/purgeCentralCache.cron.d \
> debian/liblemonldap-ng-portal-perl.cron.d
$(MANAGERJSONDST): $(MANAGERJSONSRC)
./scripts/jsongenerator.pl

View File

@ -1,4 +1,4 @@
#
# Regular cron jobs for the Lemonldap::NG portal
# Regular cron jobs for LemonLDAP::NG Handler
#
1 * * * * www-data test -x /usr/share/lemonldap-ng/bin/purgeLocalCache && /usr/share/lemonldap-ng/bin/purgeLocalCache
1 * * * * www-data [ -x /usr/share/lemonldap-ng/bin/purgeLocalCache ] && /usr/share/lemonldap-ng/bin/purgeLocalCache

View File

@ -1,4 +1,4 @@
#
# Regular cron jobs for the Lemonldap::NG portal
# Regular cron jobs for LemonLDAP::NG Portal
#
*/10 * * * * www-data test -x /usr/share/lemonldap-ng/bin/purgeCentralCache && /usr/share/lemonldap-ng/bin/purgeCentralCache
*/10 * * * * www-data [ -x /usr/share/lemonldap-ng/bin/purgeCentralCache ] && /usr/share/lemonldap-ng/bin/purgeCentralCache

View File

@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "llng-fastcgi-server 1"
.TH llng-fastcgi-server 1 "2019-04-16" "perl v5.28.1" "User Contributed Perl Documentation"
.TH llng-fastcgi-server 1 "2019-04-23" "perl v5.28.1" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l

View File

@ -1,4 +1,4 @@
#
# Regular cron jobs for LemonLDAP::NG
# Regular cron jobs for LemonLDAP::NG Handler
#
1 * * * * __APACHEUSER__ [ -x __BINDIR__/purgeLocalCache ] && __BINDIR__/purgeLocalCache
1 * * * * __APACHEUSER__ [ -x __BINDIR__/purgeLocalCache ] && __BINDIR__/purgeLocalCache

View File

@ -130,7 +130,7 @@ sub scanTree {
|| '_whatToTrace' } // "anonymous";
$self->newConf->{cfgAuthorIP} = $self->req->address;
$self->newConf->{cfgDate} = time;
$self->newConf->{cfgVersion} = $VERSION;
$self->newConf->{cfgVersion} = $Lemonldap::NG::Manager::VERSION;
$self->newConf->{key} ||= join( '',
map { chr( int( ord( Crypt::URandom::urandom(1) ) * 94 / 256 ) + 33 ) }
( 1 .. 16 ) );

View File

@ -330,7 +330,7 @@ llapp.controller 'SessionsExplorerCtrl', ['$scope', '$translator', '$location',
console.log element, '-> real attribute'
real.push element
else
console.log element, '-> spoofed attribute'
#console.log element, '-> spoofed attribute'
spoof.push element
tmp = spoof.concat real
@ -353,14 +353,23 @@ llapp.controller 'SessionsExplorerCtrl', ['$scope', '$translator', '$location',
d = new Date(s * 1000)
return d.toLocaleString()
$scope.isValid = (epoch) ->
$scope.isValid = (epoch, type) ->
path = $location.path()
now = Date.now() / 1000
valid = now - epoch < $scope.sessionTTL
console.log "session epoch", epoch
console.log "current date", now
console.log "sessions TTL", sessionTTL
console.log "Valid ?", valid
return valid
console.log "Path", path
console.log "Session epoch", epoch
console.log "Current date", now
console.log "Session TTL", sessionTTL
isValid = now - epoch < sessionTTL || $location.path().match(/^\/persistent/)
if type == 'msg'
console.log "Return msg"
if isValid then return "info" else return "warning"
else if type == 'style'
console.log "Return style"
if isValid then return {} else return {'color': '#627990', 'font-style': 'italic'}
else
console.log "Return isValid"
return isValid
$scope.strToLocaleDate = (s) ->
arrayDate = s.match /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/
@ -459,6 +468,8 @@ llapp.controller 'SessionsExplorerCtrl', ['$scope', '$translator', '$location',
$scope.init = ->
$scope.waiting = true
$scope.data = []
$scope.currentScope = null
$scope.currentSession = null
$q.all [
$translator.init $scope.lang
$scope.updateTree '', $scope.data, 0, 0

View File

@ -406,7 +406,6 @@
console.log(element, '-> real attribute');
real.push(element);
} else {
console.log(element, '-> spoofed attribute');
spoof.push(element);
}
}
@ -433,15 +432,36 @@
d = new Date(s * 1000);
return d.toLocaleString();
};
$scope.isValid = function(epoch) {
var now, valid;
$scope.isValid = function(epoch, type) {
var isValid, now, path;
path = $location.path();
now = Date.now() / 1000;
valid = now - epoch < $scope.sessionTTL;
console.log("session epoch", epoch);
console.log("current date", now);
console.log("sessions TTL", sessionTTL);
console.log("Valid ?", valid);
return valid;
console.log("Path", path);
console.log("Session epoch", epoch);
console.log("Current date", now);
console.log("Session TTL", sessionTTL);
isValid = now - epoch < sessionTTL || $location.path().match(/^\/persistent/);
if (type === 'msg') {
console.log("Return msg");
if (isValid) {
return "info";
} else {
return "warning";
}
} else if (type === 'style') {
console.log("Return style");
if (isValid) {
return {};
} else {
return {
'color': '#627990',
'font-style': 'italic'
};
}
} else {
console.log("Return isValid");
return isValid;
}
};
$scope.strToLocaleDate = function(s) {
var arrayDate, d;
@ -522,6 +542,8 @@
$scope.init = function() {
$scope.waiting = true;
$scope.data = [];
$scope.currentScope = null;
$scope.currentSession = null;
$q.all([$translator.init($scope.lang), $scope.updateTree('', $scope.data, 0, 0)]).then(function() {
return $scope.waiting = false;
}, function(resp) {

File diff suppressed because one or more lines are too long

View File

@ -716,6 +716,7 @@
"session_s":"جلسة( أو جلسات )",
"sessionDataToRemember":"بيانات الجلسة التي سيتم تخزينها",
"sessionDeleted":"تم حذف الجلسة",
"sessionExpired":"The session is expired",
"sessionParams":"الجلسات",
"sessionStartedAt":"بدأت الجلسة",
"sessionStorage":"تخزين الجلسات",

View File

@ -716,6 +716,7 @@
"session_s":"session(s)",
"sessionDataToRemember":"Session data to store",
"sessionDeleted":"The session was deleted",
"sessionExpired":"The session is expired",
"sessionParams":"Sessions",
"sessionStartedAt":"Session started on",
"sessionStorage":"Sessions Storage",

View File

@ -716,6 +716,7 @@
"session_s":"session(s)",
"sessionDataToRemember":"Session data to store",
"sessionDeleted":"The session was deleted",
"sessionExpired":"The session is expired",
"sessionParams":"Sessions",
"sessionStartedAt":"Session started on",
"sessionStorage":"Sessions Storage",

View File

@ -716,6 +716,7 @@
"session_s":"session(s)",
"sessionDataToRemember":"Données de session à conserver",
"sessionDeleted":"La session a été supprimée",
"sessionExpired":"La session est expirée",
"sessionParams":"Sessions",
"sessionStartedAt":"Session démarrée le ",
"sessionStorage":"Stockage des sessions",

View File

@ -716,6 +716,7 @@
"session_s":"sessione(i)",
"sessionDataToRemember":"Dati di sessione da memorizzare",
"sessionDeleted":"La sessione è stata rimossa",
"sessionExpired":"The session is expired",
"sessionParams":"Sessioni",
"sessionStartedAt":"La sessione è stata avviata",
"sessionStorage":"Conservazione di sessioni",

View File

@ -716,6 +716,7 @@
"session_s":"session (s)",
"sessionDataToRemember":"Dữ liệu phiên để lưu trữ",
"sessionDeleted":"Phiên đã bị xóa",
"sessionExpired":"The session is expired",
"sessionParams":"Phiên",
"sessionStartedAt":"Phiên bắt đầu lúc",
"sessionStorage":"Sessions lưu trữ",

View File

@ -716,6 +716,7 @@
"session_s":"session(s)",
"sessionDataToRemember":"Session data to store",
"sessionDeleted":"The session was deleted",
"sessionExpired":"The session is expired",
"sessionParams":"Sessions",
"sessionStartedAt":"Session started on",
"sessionStorage":"Sessions Storage",

View File

@ -69,9 +69,12 @@
<h1 class="panel-title text-center">{{translate("sessionTitle")}} {{currentSession.id}}</h1>
</div>
<div class="panel-body">
<div class="alert alert-info">
<div class="alert alert-{{isValid(currentSession._utime, 'msg')}}">
<strong>{{translate("sessionStartedAt")}}</strong>
{{localeDate(currentSession._utime)}}
<span ng-if="!isValid(currentSession._utime)">
<b>*** {{translate("sessionExpired")}} ***</b>
</span>
</div>
<div ng-model="currentSession.nodes">
<div ng-repeat="node in currentSession.nodes" ng-include="'session_attr.html'"></div>
@ -118,12 +121,7 @@
<a class="btn btn-node btn-sm" ng-click="displaySession(this)">
<span class="glyphicon glyphicon-eye-open"></span>
</a>
<span ng-if="isValid(node.date)">
<span id="s-{{node.session}}" ng-click="displaySession(this)">{{localeDate(node.date)}}</span>
</span>
<span ng-if="!isValid(node.date)">
<span id="s-{{node.session}}" ng-click="displaySession(this)" ng-style="{color: '#337Ab7'}">{{localeDate(node.date)}}</span>
</span>
<span id="s-{{node.session}}" ng-click="displaySession(this)" ng-style="isValid(node.date, 'style')">{{localeDate(node.date)}} </span>
</span>
</div>
<ol ui-tree-nodes="" ng-model="node.nodes" ng-class="{hidden: collapsed}">

View File

@ -72,7 +72,7 @@ sub run {
)
{
$self->logger->error("External send command failed (code $c)");
return $self->p->do( $req, [ sub { PE_ERROR } ] );
return PE_ERROR;
}
# Prepare form
@ -146,6 +146,7 @@ sub launch {
s#\$(\w+)#$session->{$1} // ''#ge;
push @args, $_;
}
$self->logger->debug( "Executing command: " . join( " ", @args ) );
return system @args;
}

View File

@ -52,8 +52,8 @@ sub run {
}
foreach ( sort sortByComment keys %{ $self->rules } ) {
$self->logger->debug( "Grant session condition -> "
. $self->conf->{grantSessionRules}->{$_} );
my $rule = $self->conf->{grantSessionRules}->{$_};
$self->logger->debug("Grant session condition -> $rule");
unless ( $self->rules->{$_}->( $req, $req->sessionInfo ) ) {
$req->userData( {} );
@ -70,6 +70,7 @@ sub run {
return PE_OK;
}
$msg = $msg->( $req, $req->sessionInfo );
$self->logger->debug("Transformed message -> $msg");
$req->info(
$self->loadTemplate(
'simpleInfo', params => { trspan => $msg }
@ -77,7 +78,7 @@ sub run {
);
$self->userLogger->error( 'User '
. $req->sessionInfo->{uid}
. " was not granted to open session (rule -> $msg)" );
. " was not granted to open session (rule -> $rule)" );
$req->urldc( $self->conf->{portal} );
return $req->authResult(PE_SESSIONNOTGRANTED);
}

View File

@ -1,4 +1,4 @@
#
# Regular cron jobs for LemonLDAP::NG
# Regular cron jobs for LemonLDAP::NG Portal
#
10 1/12 * * * __APACHEUSER__ [ -x __BINDIR__/purgeCentralCache ] && __BINDIR__/purgeCentralCache
*/10 * * * * __APACHEUSER__ [ -x __BINDIR__/purgeCentralCache ] && __BINDIR__/purgeCentralCache