diff --git a/modules/lemonldap-ng-portal/MANIFEST b/modules/lemonldap-ng-portal/MANIFEST index 4e17faa8d..2ae3e14dc 100644 --- a/modules/lemonldap-ng-portal/MANIFEST +++ b/modules/lemonldap-ng-portal/MANIFEST @@ -104,4 +104,5 @@ t/21-Lemonldap-NG-Portal-AuthSSL.t t/22-Lemonldap-NG-Portal-AuthCAS.t t/23-Lemonldap-NG-Portal-AuthLA.t t/40-Lemonldap-NG-Portal-CDA.t +t/50-Lemonldap-NG-Portal-Menu.t t/99-pod.t diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm index 1794034e6..f7a48180b 100755 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm @@ -2,6 +2,7 @@ package Lemonldap::NG::Portal::Menu; use strict; use warnings; +require Lemonldap::NG::Common::CGI; use Lemonldap::NG::Portal::SharedConf; use Lemonldap::NG::Portal::_LDAP; use XML::LibXML; @@ -49,10 +50,11 @@ sub new { # Get configuration $self->Lemonldap::NG::Portal::Simple::getConf(@_) - or $self->abort("Unable to get configuration"); + or Lemonldap::NG::Common::CGI->abort("Unable to read $class->new() parameters"); # Portal is required - $self->abort("Portal object required") unless ( $self->{portalObject} ); + Lemonldap::NG::Common::CGI->abort("Portal object required") unless ( $self->{portalObject} ); + # Fill sessionInfo &Lemonldap::NG::Portal::Simple::getSessionInfo( $self->{portalObject} ); diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_i18n.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_i18n.pm index fdc057226..8c1045cb8 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_i18n.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_i18n.pm @@ -185,18 +185,18 @@ sub error_ro { "Parola dvs. a expirat", "Certificat cerut", 'Eroare', - 'Password has been reset and now must be changed', - 'Password may not be modified', - 'Old password must also be supplied when setting a new password', - 'Insufficient password quality', - 'Password too short', - 'Password too young', - 'Password used too recently', - ' authentications remaining, change your password!', - ' seconds before password expiration, change it!', - 'Passwords mismatch', - 'Password successfully changed', - 'You have a new message', - 'Bad URL', + 'Parola a fost de resetare şi acum trebuie să fie schimbat', + 'Parola nu poate fi modificat', + 'Vechea parolă trebuie să fi, de asemenea, furnizate atunci când stabilesc o nouă parolă', + 'Calitate parola insuficiente', + 'Parola prea scurt', + 'Prea parolă nouă', + 'Parola folosit prea recent', + ' authentications rămase, schimbaţi-vă parola!', + ' secunde înainte de expirarea parola dvs., asiguraţi-vă pentru a schimba!', + 'Parolele nu se potrivesc', + 'Parola a fost schimbată', + 'Ai un mesaj nou', + 'Rea URL', ]; } diff --git a/modules/lemonldap-ng-portal/t/01-Lemonldap-NG-Portal-Simple.t b/modules/lemonldap-ng-portal/t/01-Lemonldap-NG-Portal-Simple.t index c4c0a7174..8e66025d1 100644 --- a/modules/lemonldap-ng-portal/t/01-Lemonldap-NG-Portal-Simple.t +++ b/modules/lemonldap-ng-portal/t/01-Lemonldap-NG-Portal-Simple.t @@ -67,7 +67,7 @@ ok( $p->{error} == PE_FORMEMPTY, 'Error code: missing password' ); # No ldap $p->{extractFormInfo} = sub { my $self = shift; - $self->{user} = 'user'; + $self->{user} = 'user'; $self->{password} = ''; PE_OK; }; @@ -79,11 +79,16 @@ $p->{setSessionInfo} = sub { PE_OK }; $p->{unbind} = sub { PE_OK }; $p->{store} = sub { PE_OK }; $p->{authenticate} = sub { PE_OK }; -ok( $p->process >0 , 'User OK' ); +ok( $p->process > 0, 'User OK' ); # Cookie test $p->{id} = 1; ok( $p->buildCookie == PE_OK, 'Cookie build' ); -ok( ( ref( $p->{cookie} ) eq 'ARRAY' and $p->{cookie}->[0]->isa('CGI::Cookie') ), 'Valid cookie' ); +ok( + ( + ref( $p->{cookie} ) eq 'ARRAY' and $p->{cookie}->[0]->isa('CGI::Cookie') + ), + 'Valid cookie' +); ok( $p->{cookie}->[0]->value eq '1', 'Cookie value' ); diff --git a/modules/lemonldap-ng-portal/t/02-Lemonldap-NG-Portal-SharedConf.t b/modules/lemonldap-ng-portal/t/02-Lemonldap-NG-Portal-SharedConf.t index 668ac7e98..dd870d3bd 100644 --- a/modules/lemonldap-ng-portal/t/02-Lemonldap-NG-Portal-SharedConf.t +++ b/modules/lemonldap-ng-portal/t/02-Lemonldap-NG-Portal-SharedConf.t @@ -13,4 +13,3 @@ 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. - 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 new file mode 100644 index 000000000..e6a2b1169 --- /dev/null +++ b/modules/lemonldap-ng-portal/t/50-Lemonldap-NG-Portal-Menu.t @@ -0,0 +1,32 @@ +# 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 => 4; +BEGIN { use_ok('Lemonldap::NG::Portal::Menu') } + +######################### + +# 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 $tmp; + +my $perl = "perl -I" . join( ' -I', @INC ); + +$tmp = +`$perl -MLemonldap::NG::Portal::Menu -e '\$a=Lemonldap::NG::Portal::Menu->new()'`; +ok( $tmp =~ /Portal object required/, 'Portal object required' ); + +my ( $m, $p ); + +$p = bless { cookieName => 'lemonldap', }, 'Lemonldap::NG::Portal::SharedConf'; + +ok( $m = Lemonldap::NG::Portal::Menu->new( { portalObject => $p } ), + 'constructor' ); + +ok( $m->isa('Lemonldap::NG::Portal::Menu'), 'object returned' ); +