Commit d32d9646 authored by Yadd's avatar Yadd
Browse files

Menu seems to work (#595)

parent b8181f2e
......@@ -173,6 +173,7 @@ sub sendHtml {
die_on_bad_params => 0,
die_on_missing_include => 1,
cache => 0,
global_vars => 1,
);
# TODO: replace app
......
.bowerrc
bower.json
Changes
eg/index.fcgi
example/cas.pl
example/cdc.pl
example/index.fcgi
example/index.pl
example/index_simple.pl
example/index_skin.pl
......@@ -121,124 +121,127 @@ META.yml
README
REST-API.md
site/coffee/portal.coffee
site/static/bootstrap/css/styles.css
site/static/bootstrap/css/styles.min.css
site/static/bootstrap/js/skin.js
site/static/bootstrap/js/skin.min.js
site/static/bwr/bootstrap/dist/css/bootstrap-theme.css
site/static/bwr/bootstrap/dist/css/bootstrap-theme.css.map
site/static/bwr/bootstrap/dist/css/bootstrap-theme.min.css
site/static/bwr/bootstrap/dist/css/bootstrap.css
site/static/bwr/bootstrap/dist/css/bootstrap.css.map
site/static/bwr/bootstrap/dist/css/bootstrap.min.css
site/static/bwr/bootstrap/dist/fonts/glyphicons-halflings-regular.eot
site/static/bwr/bootstrap/dist/fonts/glyphicons-halflings-regular.svg
site/static/bwr/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf
site/static/bwr/bootstrap/dist/fonts/glyphicons-halflings-regular.woff
site/static/bwr/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2
site/static/bwr/bootstrap/dist/js/bootstrap.js
site/static/bwr/bootstrap/dist/js/bootstrap.min.js
site/static/bwr/jquery-ui/jquery-ui.js
site/static/bwr/jquery-ui/jquery-ui.min.js
site/static/bwr/jquery.cookie/jquery.cookie.js
site/static/bwr/jquery.cookie/jquery.cookie.min.js
site/static/bwr/jquery/dist/jquery.js
site/static/bwr/jquery/dist/jquery.min.js
site/static/bwr/jquery/dist/jquery.min.map
site/static/common/accept.png
site/static/common/Apache.png
site/static/common/application_cascade.png
site/static/common/apps/attach.png
site/static/common/apps/bell.png
site/static/common/apps/bookmark.png
site/static/common/apps/configure.png
site/static/common/apps/database.png
site/static/common/apps/demo.png
site/static/common/apps/docs.png
site/static/common/apps/folder.png
site/static/common/apps/gear.png
site/static/common/apps/help.png
site/static/common/apps/mailappt.png
site/static/common/apps/money.png
site/static/common/apps/network.png
site/static/common/apps/README
site/static/common/apps/terminal.png
site/static/common/apps/thumbnail.png
site/static/common/apps/tools.png
site/static/common/apps/tux.png
site/static/common/apps/web.png
site/static/common/apps/wheels.png
site/static/common/backgrounds/1280px-Anse_Source_d'Argent_2-La_Digue.jpg
site/static/common/backgrounds/1280px-Autumn-clear-water-waterfall-landscape_-_Virginia_-_ForestWander.jpg
site/static/common/backgrounds/1280px-BrockenSnowedTrees.jpg
site/static/common/backgrounds/1280px-Cedar_Breaks_National_Monument_partially.jpg
site/static/common/backgrounds/1280px-Parry_Peak_from_Winter_Park.jpg
site/static/common/backgrounds/Aletschgletscher_mit_Pinus_cembra1.jpg
site/static/common/BrowserID.png
site/static/common/bullet_go.png
site/static/common/calendar.png
site/static/common/cancel.png
site/static/common/CAS.png
site/static/common/css/buttons.css
site/static/common/css/buttons.min.css
site/static/common/css/inputicons.css
site/static/common/css/inputicons.min.css
site/static/common/door_out.png
site/static/common/email.png
site/static/common/error.png
site/static/common/Facebook.png
site/static/common/favicon.ico
site/static/common/Google.png
site/static/common/js/browserid.js
site/static/common/js/browserid.min.js
site/static/common/js/browseridlogin.js
site/static/common/js/browseridlogin.min.js
site/static/common/js/browseridlogout.js
site/static/common/js/browseridlogout.min.js
site/static/common/js/confirm.js
site/static/common/js/confirm.min.js
site/static/common/js/info.js
site/static/common/js/info.min.js
site/static/common/js/portal.js
site/static/common/js/portal.min.js
site/static/common/key.png
site/static/common/lemonldap-ng_square.png
site/static/common/notification.xsl
site/static/common/ok.png
site/static/common/openid-16x16.gif
site/static/common/OpenIDConnect.png
site/static/common/SAML.png
site/static/common/SSL.png
site/static/common/stop.png
site/static/common/Twitter.png
site/static/common/user_suit.png
site/static/common/vcard_edit.png
site/static/common/vcss-blue.gif
site/static/common/warning.png
site/static/common/warning_triangle.png
site/static/common/WebID.png
site/static/common/yubico-icon-small.gif
site/static/dark/css/styles.css
site/static/dark/css/styles.min.css
site/static/dark/images/lock.png
site/static/impact/css/styles.css
site/static/impact/css/styles.min.css
site/static/impact/images/arrow.png
site/static/impact/images/bg.png
site/static/impact/images/llng-logo-32.png
site/static/impact/images/logo-info.png
site/static/impact/images/logo-lock.png
site/static/impact/images/logo-ok.png
site/static/impact/images/logo-warn.png
site/static/impact/README
site/htdocs/index.fcgi
site/htdocs/static/bootstrap/css/styles.css
site/htdocs/static/bootstrap/css/styles.min.css
site/htdocs/static/bootstrap/js/skin.js
site/htdocs/static/bootstrap/js/skin.min.js
site/htdocs/static/bwr/bootstrap/dist/css/bootstrap-theme.css
site/htdocs/static/bwr/bootstrap/dist/css/bootstrap-theme.css.map
site/htdocs/static/bwr/bootstrap/dist/css/bootstrap-theme.min.css
site/htdocs/static/bwr/bootstrap/dist/css/bootstrap.css
site/htdocs/static/bwr/bootstrap/dist/css/bootstrap.css.map
site/htdocs/static/bwr/bootstrap/dist/css/bootstrap.min.css
site/htdocs/static/bwr/bootstrap/dist/fonts/glyphicons-halflings-regular.eot
site/htdocs/static/bwr/bootstrap/dist/fonts/glyphicons-halflings-regular.svg
site/htdocs/static/bwr/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf
site/htdocs/static/bwr/bootstrap/dist/fonts/glyphicons-halflings-regular.woff
site/htdocs/static/bwr/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2
site/htdocs/static/bwr/bootstrap/dist/js/bootstrap.js
site/htdocs/static/bwr/bootstrap/dist/js/bootstrap.min.js
site/htdocs/static/bwr/jquery-ui/jquery-ui.js
site/htdocs/static/bwr/jquery-ui/jquery-ui.min.js
site/htdocs/static/bwr/jquery.cookie/jquery.cookie.js
site/htdocs/static/bwr/jquery.cookie/jquery.cookie.min.js
site/htdocs/static/bwr/jquery/dist/jquery.js
site/htdocs/static/bwr/jquery/dist/jquery.min.js
site/htdocs/static/bwr/jquery/dist/jquery.min.map
site/htdocs/static/common/accept.png
site/htdocs/static/common/Apache.png
site/htdocs/static/common/application_cascade.png
site/htdocs/static/common/apps/attach.png
site/htdocs/static/common/apps/bell.png
site/htdocs/static/common/apps/bookmark.png
site/htdocs/static/common/apps/configure.png
site/htdocs/static/common/apps/database.png
site/htdocs/static/common/apps/demo.png
site/htdocs/static/common/apps/docs.png
site/htdocs/static/common/apps/folder.png
site/htdocs/static/common/apps/gear.png
site/htdocs/static/common/apps/help.png
site/htdocs/static/common/apps/mailappt.png
site/htdocs/static/common/apps/money.png
site/htdocs/static/common/apps/network.png
site/htdocs/static/common/apps/README
site/htdocs/static/common/apps/terminal.png
site/htdocs/static/common/apps/thumbnail.png
site/htdocs/static/common/apps/tools.png
site/htdocs/static/common/apps/tux.png
site/htdocs/static/common/apps/web.png
site/htdocs/static/common/apps/wheels.png
site/htdocs/static/common/backgrounds/1280px-Anse_Source_d'Argent_2-La_Digue.jpg
site/htdocs/static/common/backgrounds/1280px-Autumn-clear-water-waterfall-landscape_-_Virginia_-_ForestWander.jpg
site/htdocs/static/common/backgrounds/1280px-BrockenSnowedTrees.jpg
site/htdocs/static/common/backgrounds/1280px-Cedar_Breaks_National_Monument_partially.jpg
site/htdocs/static/common/backgrounds/1280px-Parry_Peak_from_Winter_Park.jpg
site/htdocs/static/common/backgrounds/Aletschgletscher_mit_Pinus_cembra1.jpg
site/htdocs/static/common/BrowserID.png
site/htdocs/static/common/bullet_go.png
site/htdocs/static/common/calendar.png
site/htdocs/static/common/cancel.png
site/htdocs/static/common/CAS.png
site/htdocs/static/common/css/buttons.css
site/htdocs/static/common/css/buttons.min.css
site/htdocs/static/common/css/inputicons.css
site/htdocs/static/common/css/inputicons.min.css
site/htdocs/static/common/door_out.png
site/htdocs/static/common/email.png
site/htdocs/static/common/error.png
site/htdocs/static/common/Facebook.png
site/htdocs/static/common/favicon.ico
site/htdocs/static/common/Google.png
site/htdocs/static/common/js/browserid.js
site/htdocs/static/common/js/browserid.min.js
site/htdocs/static/common/js/browseridlogin.js
site/htdocs/static/common/js/browseridlogin.min.js
site/htdocs/static/common/js/browseridlogout.js
site/htdocs/static/common/js/browseridlogout.min.js
site/htdocs/static/common/js/confirm.js
site/htdocs/static/common/js/confirm.min.js
site/htdocs/static/common/js/info.js
site/htdocs/static/common/js/info.min.js
site/htdocs/static/common/js/portal.js
site/htdocs/static/common/js/portal.min.js
site/htdocs/static/common/key.png
site/htdocs/static/common/lemonldap-ng_square.png
site/htdocs/static/common/notification.xsl
site/htdocs/static/common/ok.png
site/htdocs/static/common/openid-16x16.gif
site/htdocs/static/common/OpenIDConnect.png
site/htdocs/static/common/SAML.png
site/htdocs/static/common/SSL.png
site/htdocs/static/common/stop.png
site/htdocs/static/common/Twitter.png
site/htdocs/static/common/user_suit.png
site/htdocs/static/common/vcard_edit.png
site/htdocs/static/common/vcss-blue.gif
site/htdocs/static/common/warning.png
site/htdocs/static/common/warning_triangle.png
site/htdocs/static/common/WebID.png
site/htdocs/static/common/yubico-icon-small.gif
site/htdocs/static/dark/css/styles.css
site/htdocs/static/dark/css/styles.min.css
site/htdocs/static/dark/images/lock.png
site/htdocs/static/impact/css/styles.css
site/htdocs/static/impact/css/styles.min.css
site/htdocs/static/impact/images/arrow.png
site/htdocs/static/impact/images/bg.png
site/htdocs/static/impact/images/llng-logo-32.png
site/htdocs/static/impact/images/logo-info.png
site/htdocs/static/impact/images/logo-lock.png
site/htdocs/static/impact/images/logo-ok.png
site/htdocs/static/impact/images/logo-warn.png
site/htdocs/static/impact/README
site/htdocs/static/js/portal.js
site/htdocs/static/js/portal.min.js
site/htdocs/static/languages/en.json
site/htdocs/static/languages/fr.json
site/htdocs/static/pastel/css/styles.css
site/htdocs/static/pastel/css/styles.min.css
site/htdocs/static/pastel/images/hatch.gif
site/htdocs/static/pastel/images/lock.png
site/static/js/portal.js
site/static/js/portal.min.js
site/static/languages/en.json
site/static/languages/fr.json
site/static/pastel/css/styles.css
site/static/pastel/css/styles.min.css
site/static/pastel/images/hatch.gif
site/static/pastel/images/lock.png
site/templates/bootstrap/checklogins.tpl
site/templates/bootstrap/confirm.tpl
site/templates/bootstrap/customfooter.tpl
......@@ -361,6 +364,15 @@ t/70-Lemonldap-NG-Portal-AuthOpenIDConnect.t
t/99-pod.t
t/lmConf-1.js
t/sessions/lock/.exists
t/sessions/lock/Apache-Session-145dba262c1053fd855990d571d5583fe1c75f2ff6910a079f1e44c2b12f5f81.lock
t/sessions/lock/Apache-Session-1e662c0b3103d632d332d9561b6fbbf1f2aacb9a0d55263ee513311ec9ee7712.lock
t/sessions/lock/Apache-Session-32409f452220ef603d5819e1553d980b441474cf4a8f899de1243be2724aa50f.lock
t/sessions/lock/Apache-Session-4797304de2aa18005dc54b56d829477860f4ebadd1fc407af8f6de90edd59a2b.lock
t/sessions/lock/Apache-Session-5ece000315bf915633f75225fcdb11c2754bd254e49783a01f9763887d780c46.lock
t/sessions/lock/Apache-Session-7446b65e4838f5e35d661797c23118ee7afa08d3c673e3fd22c05721bdc5f273.lock
t/sessions/lock/Apache-Session-8e7cd669256eacc113b159e23d3ed1d84c862e9a3782022e50b362e6f3b29bab.lock
t/sessions/lock/Apache-Session-99ae337a06625431c00c76d8f85db2c9fed2afce9bdefba24e47a7f5f67a0f9f.lock
t/sessions/lock/Apache-Session-d44bc6a227a1a33ac7876b5e9d781f232262ec5ff9df68e62be81a38146edea3.lock
t/test-lib.pm
xt/PE_Constants.t
xt/test-weaken-portal.t
../site/htdocs/index.fcgi
\ No newline at end of file
......@@ -12,16 +12,16 @@ has menuModules => (
is => 'rw',
builder => sub {
my $conf = $_[0]->{conf}->{menuModule};
my %res;
my @res;
foreach (qw(Appslist ChangePassword LoginHistory Logout)) {
my $cond = $conf->{"portalDisplay$_"} // 1;
$_[0]
->p->lmLog( "Evaluate condition $cond for module $_", 'debug' );
my $tmp =
$_[0]->{p}->HANDLER->tsv->{jail}->jail_reval("sub{return $cond}");
$res{$_} = $tmp if ($tmp);
push @res, [$_, $tmp] if ($tmp);
}
return \%res;
return \@res;
}
);
......@@ -93,15 +93,15 @@ sub displayModules {
# Foreach module, eval condition
# Store module in result if condition is valid
foreach my $module ( keys %{ $self->menuModules } ) {
$self->lmLog( "Check if $module has to be displayed", 'debug' );
foreach my $module ( @{ $self->menuModules } ) {
$self->lmLog( "Check if $module->[0] has to be displayed", 'debug' );
if ( $self->menuModules->{$module}->() ) {
my $moduleHash = { $module => 1 };
if ( $module eq 'Appslist' ) {
if ( $module->[1]->() ) {
my $moduleHash = { $module->[0] => 1 };
if ( $module->[0] eq 'Appslist' ) {
$moduleHash->{'APPSLIST_LOOP'} = $self->appslist($req);
}
elsif ( $module eq 'LoginHistory' ) {
elsif ( $module->[0] eq 'LoginHistory' ) {
$moduleHash->{'SUCCESS_LOGIN'} =
$self->p->mkSessionArray(
$req->{sessionInfo}->{loginHistory}->{successLogin},
......
......@@ -43,6 +43,12 @@ sub restoreArgs {
return ( %{ $req->params } ? PE_OK : PE_FORMEMPTY );
}
sub importHandlerDatas {
my ( $self, $req ) = @_;
$req->{sessionInfo} = HANDLER->datas;
PE_OK;
}
# Verify url parameter
sub controlUrl {
my ( $self, $req ) = @_;
......
......@@ -83,13 +83,19 @@ sub postLogin {
sub authenticatedRequest {
my ( $self, $req ) = @_;
return $self->do( $req, [ 'controlUrl', @{ $self->forAuthUser } ] );
return $self->do( $req,
[ 'importHandlerDatas', 'controlUrl', @{ $self->forAuthUser } ] );
}
sub postAuthenticatedRequest {
my ( $self, $req ) = @_;
return $self->do( $req,
[ 'restoreArgs', 'controlUrl', @{ $self->forAuthUser } ] );
return $self->do(
$req,
[
'importHandlerDatas', 'restoreArgs',
'controlUrl', @{ $self->forAuthUser }
]
);
}
# RUNNING METHODS
......
......@@ -5,10 +5,10 @@ BEGIN {
$pwd = `pwd`;
chomp $pwd;
eval qq{
use lib "$pwd/../../lemonldap-ng-common/blib/lib";
use lib "$pwd/../../lemonldap-ng-handler/blib/lib";
use lib "$pwd/../../lemonldap-ng-portal/blib/lib";
use lib "$pwd/../../lemonldap-ng-manager/blib/lib";
use lib "$pwd/../../../lemonldap-ng-common/blib/lib";
use lib "$pwd/../../../lemonldap-ng-handler/blib/lib";
use lib "$pwd/../../../lemonldap-ng-portal/blib/lib";
use lib "$pwd/../../../lemonldap-ng-manager/blib/lib";
};
die $@ if ($@);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment