Notifications category in sessions explorer (#339)

environments/ppa-mbqj77/deployments/1
Clément Oudot 15 years ago
parent 7630a12c72
commit 6d4c4b1132
  1. 30
      modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Sessions.pm

@ -25,7 +25,7 @@ use utf8;
our $whatToTrace;
*whatToTrace = \$Lemonldap::NG::Handler::_CGI::whatToTrace;
our $VERSION = '1.0.2';
our $VERSION = '1.1.0';
our @ISA = qw(
Lemonldap::NG::Handler::CGI
@ -559,6 +559,34 @@ sub session {
$res .= '</div>';
}
# Notifications
my $notifempty = 1;
foreach ( keys %session ) {
$notifempty = 0 if $_ =~ /^notification_/;
}
unless ($notifempty) {
$res .= '<div class="ui-corner-all ui-widget-content category">';
$res .= '<h2 class="ui-corner-all ui-widget-header">'
. ucfirst $self->translate('notificationsDone') . '</h2>';
$res .= '<ul>';
foreach ( keys %session ) {
next if $_ !~ /^notification_(.+)/;
$res .=
'<li><strong>'
. $1
. '</strong>: '
. $session{$_} . " ("
. localtime( $session{$_} ) . ")";
# Delete attribute, to hide it
delete $session{$_};
}
$res .= '</ul>';
$res .= '</div>';
}
# Other attributes
$res .= '<div class="ui-corner-all ui-widget-content category">';
$res .= '<h2 class="ui-corner-all ui-widget-header">'

Loading…
Cancel
Save