From 819337f47a05ce2ca45aaf6a3ae02335993f71e4 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Sun, 18 Sep 2011 12:44:14 +0000 Subject: [PATCH] Perltidy --- .../lib/Lemonldap/NG/Common/Safe.pm | 3 ++- .../example/notifications.pl | 4 +++- .../lib/Lemonldap/NG/Portal/Notification.pm | 2 ++ .../lib/Lemonldap/NG/Portal/_LDAP.pm | 2 +- .../lib/Lemonldap/NG/Portal/_SAML.pm | 3 ++- .../t/05-Lemonldap-NG-Portal-Safe.t | 22 ++++++++++++------- .../t/50-Lemonldap-NG-Portal-Menu.t | 4 ++-- 7 files changed, 26 insertions(+), 14 deletions(-) diff --git a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Safe.pm b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Safe.pm index e7d0731e8..f6390453f 100644 --- a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Safe.pm +++ b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Safe.pm @@ -82,7 +82,8 @@ sub reval { # Catch errors if ($@) { - $self->{p}->lmLog( "Error while evaluating the expression: $@", 'warn' ); + $self->{p} + ->lmLog( "Error while evaluating the expression: $@", 'warn' ); return; } diff --git a/modules/lemonldap-ng-manager/example/notifications.pl b/modules/lemonldap-ng-manager/example/notifications.pl index c94fe614f..24561a344 100755 --- a/modules/lemonldap-ng-manager/example/notifications.pl +++ b/modules/lemonldap-ng-manager/example/notifications.pl @@ -25,7 +25,9 @@ my $cgi = Lemonldap::NG::Manager::Notifications->new( # directory => '/usr/local/lemonlda-ng/conf/' #}, } -) or Lemonldap::NG::Common::CGI->abort('Unable to start notifications explorer'); + ) + or + Lemonldap::NG::Common::CGI->abort('Unable to start notifications explorer'); my $skin = $cgi->{managerSkin} or $cgi->abort('managerSkin is not defined'); my $css = 'tree.css'; diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Notification.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Notification.pm index 3efc8434e..a4873bced 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Notification.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Notification.pm @@ -425,6 +425,8 @@ sub purge { sub _get { no strict 'refs'; my $self = $_[0]; + + # Debug lines. Must be removed ? die ref($self) unless ( ref($self) eq 'Lemonldap::NG::Portal::Notification' ); return &{ $_[0]->{type} . '::get' }(@_); diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm index 1fe2e4a91..ca4ebe796 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm @@ -422,7 +422,7 @@ sub searchGroups { my $searchFilter = "(&(objectClass=" . $portal->{ldapGroupObjectClass} . ")(|"; foreach ( split( $portal->{multiValuesSeparator}, $value ) ) { - $searchFilter .= "(" . $key . "=" . escape_filter_value($_) . ")"; + $searchFilter .= "(" . $key . "=" . escape_filter_value($_) . ")"; } $searchFilter .= "))"; diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_SAML.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_SAML.pm index 6d379ad3a..749552e77 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_SAML.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_SAML.pm @@ -154,7 +154,8 @@ sub loadService { # Create Lasso server with service metadata my $server = $self->createServer( $service_metadata->serviceToXML( - $self->getApacheHtdocsPath() . "/skins/common/saml2-metadata.tpl", $self + $self->getApacheHtdocsPath() . "/skins/common/saml2-metadata.tpl", + $self ), $privateKeySig, $privateKeySigPwd, diff --git a/modules/lemonldap-ng-portal/t/05-Lemonldap-NG-Portal-Safe.t b/modules/lemonldap-ng-portal/t/05-Lemonldap-NG-Portal-Safe.t index d8bff9a64..27eccfa0f 100644 --- a/modules/lemonldap-ng-portal/t/05-Lemonldap-NG-Portal-Safe.t +++ b/modules/lemonldap-ng-portal/t/05-Lemonldap-NG-Portal-Safe.t @@ -14,16 +14,14 @@ BEGIN { use_ok( 'Lemonldap::NG::Portal::Simple', ':all' ) } # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. - - # Create portal object with Safe jail (the default) my $p; $ENV{REQUEST_METHOD} = "GET"; ok( $p = Lemonldap::NG::Portal::Simple->new( { - globalStorage => 'Apache::Session::File', - domain => 'example.com', + globalStorage => 'Apache::Session::File', + domain => 'example.com', } ), 'Portal object with Safe jail' @@ -38,8 +36,12 @@ $ENV{REMOTE_ADDR} = $envData; # Real Safe jail ok( $p->{useSafeJail} == 1, 'Safe jail on' ); ok( $p->safe->reval('$uid') eq $sessionData, 'Safe jail on - session data' ); -ok( $p->safe->reval('$ENV{REMOTE_ADDR}') eq $envData, 'Safe jail on - env data' ); -ok( defined $p->safe->reval('checkDate(0,1)'), 'Safe jail on - extended function' ); +ok( $p->safe->reval('$ENV{REMOTE_ADDR}') eq $envData, + 'Safe jail on - env data' ); +ok( + defined $p->safe->reval('checkDate(0,1)'), + 'Safe jail on - extended function' +); # Reset safe object $Lemonldap::NG::Portal::Simple::safe = undef; @@ -48,6 +50,10 @@ $p->{useSafeJail} = 0; # Fake Safe jail ok( $p->{useSafeJail} == 0, 'Safe jail off' ); ok( $p->safe->reval('$uid') eq $sessionData, 'Safe jail off - session data' ); -ok( $p->safe->reval('$ENV{REMOTE_ADDR}') eq $envData, 'Safe jail off - env data' ); -ok( defined $p->safe->reval('checkDate(0,1)'), 'Safe jail off - extended function' ); +ok( $p->safe->reval('$ENV{REMOTE_ADDR}') eq $envData, + 'Safe jail off - env data' ); +ok( + defined $p->safe->reval('checkDate(0,1)'), + 'Safe jail off - extended function' +); diff --git a/modules/lemonldap-ng-portal/t/50-Lemonldap-NG-Portal-Menu.t b/modules/lemonldap-ng-portal/t/50-Lemonldap-NG-Portal-Menu.t index 628791181..c1df2bcb7 100644 --- a/modules/lemonldap-ng-portal/t/50-Lemonldap-NG-Portal-Menu.t +++ b/modules/lemonldap-ng-portal/t/50-Lemonldap-NG-Portal-Menu.t @@ -129,7 +129,7 @@ ok( $displayNok == 0, 'Display auto nok' ); # Connect as another user with different rights $p->{sessionInfo}->{uid} = "toto"; -my $appLoop2 = $p->appslist(); +my $appLoop2 = $p->appslist(); my $displayOk2 = 0; foreach (@$appLoop2) { @@ -140,5 +140,5 @@ foreach (@$appLoop2) { } } -ok( $displayOk2 != 0, 'Display auto ok for different user' ); +ok( $displayOk2 != 0, 'Display auto ok for different user' );