Commit dfc4b52e authored by Xavier Guimard's avatar Xavier Guimard

LEMONLDAP::NG : Bug fix in other authentication scheme than default (ldap)

parent e502a3dc
Revision history for Perl extension Lemonldap::NG::Portal.
0.72 Sat Apr 14 22:35:45 2007
- Bug fix in authentication other than 'ldap'
- More tests
0.71 Sun Apr 1 22:20:41 2007
- New authentication scheme: AuthApache.pm
......
......@@ -2,7 +2,7 @@ package Lemonldap::NG::Portal;
print STDERR
"See Lemonldap::NG::Portal(3) to know which Lemonldap::NG::Portal::* module to use.";
our $VERSION = "0.71";
our $VERSION = "0.72";
1;
......
......@@ -13,7 +13,7 @@ use CGI::Cookie;
require POSIX;
use Lemonldap::NG::Portal::_i18n;
our $VERSION = '0.7';
our $VERSION = '0.72';
our @ISA = qw(CGI Exporter);
......@@ -66,10 +66,16 @@ sub new {
$self->{cookieName} ||= "lemonldap";
if ( $self->{authentication} and $self->{authentication} ne "ldap" ) {
require "Lemonldap::NG::Portal::Auth".$self->{authentication};
# $Lemonldap::NG::Portal::AuthSSL::OVERRIDE does not overload $self
# variables: if the administrator has defined a sub, we respect it
%$self = ( %${"Lemonldap::NG::Portal::Auth".$self->{authentication}."::OVERRIDE"}, %$self );
my $tmp = 'require Lemonldap::NG::Portal::Auth'
. $self->{authentication}
. '; $tmp = $Lemonldap::NG::Portal::Auth'
. $self->{authentication}
. '::OVERRIDE;';
eval $tmp;
die($@) if($@);
%$self = ( %$tmp, %$self );
}
return $self;
}
......
......@@ -5,12 +5,18 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
BEGIN { use_ok('Lemonldap::NG::Portal::AuthApache') };
use Test::More tests => 2;
BEGIN { use_ok('Lemonldap::NG::Portal::Simple') };
#########################
# 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.
my $p;
ok( $p = Lemonldap::NG::Portal::Simple->new( {
globalStorage => 'Apache::Session::File',
domain => 'example.com',
authentication => 'Apache',
} ) );
......@@ -5,17 +5,24 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
use Test::More tests => 2;
#########################
# 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.
# SOAP::Lite is not required, so Lemonldap::NG::Manager::Conf::SOAP may
# not run.
SKIP: {
eval { require AuthCAS };
skip "AuthCAS is not installed, so Lemonldap::NG::Portal::AuthCAS will not be useable", 1 if($@);
use_ok('Lemonldap::NG::Portal::AuthCAS');
use_ok('Lemonldap::NG::Portal::Simple');
my $p;
ok( $p = Lemonldap::NG::Portal::Simple->new( {
globalStorage => 'Apache::Session::File',
domain => 'example.com',
authentication => 'CAS',
} ) );
}
#########################
# 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.
......@@ -5,12 +5,18 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
BEGIN { use_ok('Lemonldap::NG::Portal::AuthSSL') };
use Test::More tests => 2;
BEGIN { use_ok('Lemonldap::NG::Portal::Simple') };
#########################
# 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.
my $p;
ok( $p = Lemonldap::NG::Portal::Simple->new( {
globalStorage => 'Apache::Session::File',
domain => 'example.com',
authentication => 'SSL',
} ) );
......@@ -5,7 +5,7 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
use Test::More tests => 3;
BEGIN { use_ok('Lemonldap::NG::Portal::SharedConf') };
#########################
......@@ -13,5 +13,7 @@ BEGIN { use_ok('Lemonldap::NG::Portal::SharedConf') };
# 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.
my $p = bless {}, 'Lemonldap::NG::Portal::SharedConf';
ok( ! $p->scanexpr ( '1 == 0' ) );
ok( $p->scanexpr ( '1 == 1' ) );
......@@ -5,11 +5,22 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
BEGIN { use_ok('Lemonldap::NG::Portal::Simple') };
use Test::More tests => 5;
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.
my $p;
ok( $p = Lemonldap::NG::Portal::Simple->new( {
globalStorage => 'Apache::Session::File',
domain => 'example.com',
} ) );
ok( $p->process == 0 );
ok( $p->{error} == PE_FIRSTACCESS );
$p->{id} = 1;
ok( $p->buildCookie == PE_OK );
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Portal.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 31;
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.
my $p = bless {}, 'Lemonldap::NG::Portal::Simple';
foreach my $i (1..10) {
$p->{error} = $i;
ok( $p->error('fr;en') );
ok( $p->error('en') );
ok( $p->error('') );
}
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