This commit is contained in:
Xavier Guimard 2011-09-18 12:44:14 +00:00
parent edbe375c63
commit 819337f47a
7 changed files with 26 additions and 14 deletions

View File

@ -82,7 +82,8 @@ sub reval {
# Catch errors # Catch errors
if ($@) { if ($@) {
$self->{p}->lmLog( "Error while evaluating the expression: $@", 'warn' ); $self->{p}
->lmLog( "Error while evaluating the expression: $@", 'warn' );
return; return;
} }

View File

@ -25,7 +25,9 @@ my $cgi = Lemonldap::NG::Manager::Notifications->new(
# directory => '/usr/local/lemonlda-ng/conf/' # 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 $skin = $cgi->{managerSkin} or $cgi->abort('managerSkin is not defined');
my $css = 'tree.css'; my $css = 'tree.css';

View File

@ -425,6 +425,8 @@ sub purge {
sub _get { sub _get {
no strict 'refs'; no strict 'refs';
my $self = $_[0]; my $self = $_[0];
# Debug lines. Must be removed ?
die ref($self) die ref($self)
unless ( ref($self) eq 'Lemonldap::NG::Portal::Notification' ); unless ( ref($self) eq 'Lemonldap::NG::Portal::Notification' );
return &{ $_[0]->{type} . '::get' }(@_); return &{ $_[0]->{type} . '::get' }(@_);

View File

@ -422,7 +422,7 @@ sub searchGroups {
my $searchFilter = my $searchFilter =
"(&(objectClass=" . $portal->{ldapGroupObjectClass} . ")(|"; "(&(objectClass=" . $portal->{ldapGroupObjectClass} . ")(|";
foreach ( split( $portal->{multiValuesSeparator}, $value ) ) { foreach ( split( $portal->{multiValuesSeparator}, $value ) ) {
$searchFilter .= "(" . $key . "=" . escape_filter_value($_) . ")"; $searchFilter .= "(" . $key . "=" . escape_filter_value($_) . ")";
} }
$searchFilter .= "))"; $searchFilter .= "))";

View File

@ -154,7 +154,8 @@ sub loadService {
# Create Lasso server with service metadata # Create Lasso server with service metadata
my $server = $self->createServer( my $server = $self->createServer(
$service_metadata->serviceToXML( $service_metadata->serviceToXML(
$self->getApacheHtdocsPath() . "/skins/common/saml2-metadata.tpl", $self $self->getApacheHtdocsPath() . "/skins/common/saml2-metadata.tpl",
$self
), ),
$privateKeySig, $privateKeySig,
$privateKeySigPwd, $privateKeySigPwd,

View File

@ -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 # 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. # its man page ( perldoc Test::More ) for help writing this test script.
# Create portal object with Safe jail (the default) # Create portal object with Safe jail (the default)
my $p; my $p;
$ENV{REQUEST_METHOD} = "GET"; $ENV{REQUEST_METHOD} = "GET";
ok( ok(
$p = Lemonldap::NG::Portal::Simple->new( $p = Lemonldap::NG::Portal::Simple->new(
{ {
globalStorage => 'Apache::Session::File', globalStorage => 'Apache::Session::File',
domain => 'example.com', domain => 'example.com',
} }
), ),
'Portal object with Safe jail' 'Portal object with Safe jail'
@ -38,8 +36,12 @@ $ENV{REMOTE_ADDR} = $envData;
# Real Safe jail # Real Safe jail
ok( $p->{useSafeJail} == 1, 'Safe jail on' ); ok( $p->{useSafeJail} == 1, 'Safe jail on' );
ok( $p->safe->reval('$uid') eq $sessionData, 'Safe jail on - session data' ); 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( $p->safe->reval('$ENV{REMOTE_ADDR}') eq $envData,
ok( defined $p->safe->reval('checkDate(0,1)'), 'Safe jail on - extended function' ); 'Safe jail on - env data' );
ok(
defined $p->safe->reval('checkDate(0,1)'),
'Safe jail on - extended function'
);
# Reset safe object # Reset safe object
$Lemonldap::NG::Portal::Simple::safe = undef; $Lemonldap::NG::Portal::Simple::safe = undef;
@ -48,6 +50,10 @@ $p->{useSafeJail} = 0;
# Fake Safe jail # Fake Safe jail
ok( $p->{useSafeJail} == 0, 'Safe jail off' ); ok( $p->{useSafeJail} == 0, 'Safe jail off' );
ok( $p->safe->reval('$uid') eq $sessionData, 'Safe jail off - session data' ); 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( $p->safe->reval('$ENV{REMOTE_ADDR}') eq $envData,
ok( defined $p->safe->reval('checkDate(0,1)'), 'Safe jail off - extended function' ); 'Safe jail off - env data' );
ok(
defined $p->safe->reval('checkDate(0,1)'),
'Safe jail off - extended function'
);

View File

@ -129,7 +129,7 @@ ok( $displayNok == 0, 'Display auto nok' );
# Connect as another user with different rights # Connect as another user with different rights
$p->{sessionInfo}->{uid} = "toto"; $p->{sessionInfo}->{uid} = "toto";
my $appLoop2 = $p->appslist(); my $appLoop2 = $p->appslist();
my $displayOk2 = 0; my $displayOk2 = 0;
foreach (@$appLoop2) { 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' );