From bfab1a6e3b7e36755334dddc0185a3f3a2c0ef55 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Wed, 31 Dec 2008 15:10:02 +0000 Subject: [PATCH] LEMONLDAP::NG Doxygen in progress --- .../lib/Lemonldap/NG/Common/Apache/Session.pm | 7 +++++ .../NG/Common/Apache/Session/SOAP.pm | 26 +++++++++++++++++-- .../lib/Lemonldap/NG/Common/CGI.pm | 23 +++++++++++++--- .../lib/Lemonldap/NG/Common/CGI/SOAPServer.pm | 12 ++++++++- .../lib/Lemonldap/NG/Handler.pm | 8 +++++- .../lib/Lemonldap/NG/Handler/AuthBasic.pm | 2 -- .../lib/Lemonldap/NG/Handler/CDA.pm | 2 -- .../lib/Lemonldap/NG/Handler/CGI.pm | 2 -- .../lib/Lemonldap/NG/Handler/Proxy.pm | 2 -- .../lib/Lemonldap/NG/Handler/SharedConf.pm | 2 -- .../lib/Lemonldap/NG/Handler/Simple.pm | 2 -- .../lib/Lemonldap/NG/Handler/Status.pm | 2 -- .../lib/Lemonldap/NG/Handler/Vhost.pm | 2 -- .../lib/Lemonldap/NG/Portal.pm | 8 +++++- .../lib/Lemonldap/NG/Portal/AuthApache.pm | 2 -- .../lib/Lemonldap/NG/Portal/AuthCAS.pm | 2 -- .../lib/Lemonldap/NG/Portal/AuthLDAP.pm | 2 -- .../lib/Lemonldap/NG/Portal/AuthSSL.pm | 2 -- .../lib/Lemonldap/NG/Portal/CDA.pm | 18 ++++++++----- .../lib/Lemonldap/NG/Portal/Menu.pm | 2 -- .../lib/Lemonldap/NG/Portal/SharedConf.pm | 2 -- .../lib/Lemonldap/NG/Portal/Simple.pm | 2 -- .../lib/Lemonldap/NG/Portal/UserDBLDAP.pm | 2 -- .../lib/Lemonldap/NG/Portal/_LDAP.pm | 23 +++++++++++++--- .../lib/Lemonldap/NG/Portal/_WebForm.pm | 2 -- .../lib/Lemonldap/NG/Portal/_i18n.pm | 18 +++++++++++++ 26 files changed, 125 insertions(+), 52 deletions(-) diff --git a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Apache/Session.pm b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Apache/Session.pm index 879443de1..7b8619e99 100644 --- a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Apache/Session.pm +++ b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Apache/Session.pm @@ -1,3 +1,10 @@ +## @file +# Add get_key_from_all_sessions() function to Apache::Session modules. +# This file is used by Lemonldap::NG::Manager::Status and by the +# purgeCentralCache script. +# +# Warning, this works only with SQL databases, simple or Berkeley files (not +# for Apache::Session::Memcached for example) package Lemonldap::NG::Common::Apache::Session; use Storable qw(thaw); diff --git a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Apache/Session/SOAP.pm b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Apache/Session/SOAP.pm index 4ca4900eb..adfc29411 100644 --- a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Apache/Session/SOAP.pm +++ b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Apache/Session/SOAP.pm @@ -1,3 +1,8 @@ +## @file +# Client side of the SOAP proxy mechanism for Apache::Session modules + +## @class +# Client side of the SOAP proxy mechanism for Apache::Session modules package Lemonldap::NG::Common::Apache::Session::SOAP; use strict; @@ -16,6 +21,9 @@ BEGIN { # PUBLIC INTERFACE +## @cmethod Lemonldap::NG::Common::Apache::Session::SOAP TIEHASH(string session_id, hashRef args) +# Constructor for Perl TIE mechanism. See perltie(3) for more. +# @return Lemonldap::NG::Common::Apache::Session::SOAP object sub TIEHASH { my $class = shift; @@ -100,8 +108,8 @@ sub DESTROY { $self->save; } -# INTERNAL SUBROUTINES - +## @method private SOAP::Lite _connect() +# @return The SOAP::Lite object. Build it at the first call. sub _connect { my $self = shift; return $self->{service} if ( $self->{service} ); @@ -113,29 +121,43 @@ sub _connect { return $self->{service} = SOAP::Lite->ns( $self->{ns} )->proxy(@args); } +## @method private $ _soapCall(string func, @args) +# @param $func remote function to call +# @param @args Functions parameters +# @return Result sub _soapCall { my $self = shift; my $func = shift; return $self->_connect->$func(@_)->result; } +## @method hashRef get(string id) +# @param $id Apache::Session session ID. +# @return User datas sub get { my $self = shift; my $id = shift; return $self->{data} = $self->_soapCall( "get", $id ); } +## @method hashRef newsession() +# Build a new Apache::Session session. +# @return User datas (just the session ID) sub newsession { my $self = shift; return $self->{data} = $self->_soapCall( "newsession" ); } +## @method boolean save() +# Save user datas if modified. sub save { my $self = shift; return unless ($self->{modified}); return $self->_soapCall( "set", $self->{data}->{_session_id}, $self->{data} ); } +## @method boolean delete() +# Deletes the current session. sub delete { my $self = shift; return $self->_soapCall( "delete", $self->{data}->{_session_id} ); diff --git a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/CGI.pm b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/CGI.pm index 5e864123e..f36ee0775 100644 --- a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/CGI.pm +++ b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/CGI.pm @@ -1,10 +1,8 @@ ## @file # Base package for all Lemonldap::NG CGI -# -# @copy 2005, 2006, 2007, 2008, Xavier Guimard <x.guimard@free.fr> ## @class -# Base class for all Lemonldap::NG portal CGI +# Base class for all Lemonldap::NG CGI package Lemonldap::NG::Common::CGI; use strict; @@ -17,6 +15,10 @@ our $VERSION = '0.31'; use base qw(CGI); +## @method void soapTest(string soapFunctions) +# Check if request is a SOAP request. If it is, launch +# Lemonldap::NG::Common::CGI::SOAPServer and exit. Else simply return. +# @param $soapFunctions list of authorized functions. sub soapTest { my $self = shift; my $soapFunctions = shift || $self->{SOAPFunctions}; @@ -33,9 +35,17 @@ sub soapTest { ->handle($self); exit; } - return $self; } +## @method string header_public(string filename) +# Implements the "304 Not Modified" HTTP mechanism. +# If HTTP request contains an "If-Modified-Since" header and if +# $filename was not modified since, prints the "304 Not Modified" response and +# exit. Else, launch CGI::header() with "Cache-Control" and "Last-Modified" +# headers. +# @param $filename Optional name of the reference file. Default +# $ENV{SCRIPT_FILENAME}. +# @return Common Gateway Interface standard response header sub header_public { my $self = shift; my $filename = shift; @@ -80,6 +90,11 @@ sub header_public { ); } +## @method void abort(string title, string text) +# Display an error message and exit. +# Used instead of die() in Lemonldap::NG CGIs. +# @param title Title of the error message +# @param text Optional text. Default: "See Apache's logs" sub abort { my $self = shift; my $cgi = CGI->new; diff --git a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/CGI/SOAPServer.pm b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/CGI/SOAPServer.pm index 92cd8e1bb..0ccf8b019 100644 --- a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/CGI/SOAPServer.pm +++ b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/CGI/SOAPServer.pm @@ -1,9 +1,17 @@ +## @file +# SOAP support for Lemonldap::NG::Common::CGI + +## @class +# SOAP support for Lemonldap::NG::Common::CGI package Lemonldap::NG::Common::CGI::SOAPServer; use SOAP::Transport::HTTP; -use base 'SOAP::Transport::HTTP::Server'; +use base qw(SOAP::Transport::HTTP::Server); sub DESTROY { SOAP::Trace::objects('()') } +## @cmethod Lemonldap::NG::Common::CGI::SOAPServer new(@param) +# @param @param SOAP::Transport::HTTP::Server::new() parameters +# @return Lemonldap::NG::Common::CGI::SOAPServer object sub new { my $self = shift; return $self if ref $self; @@ -15,6 +23,8 @@ sub new { return $self; } +## @method handle(CGI cgi) +# sub handle { my $self = shift->new; my $cgi = shift; diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm index 7dbb9f68b..f8c5a7868 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm @@ -1,7 +1,13 @@ +## @file +# Alias for Lemonldap::NG::Handler::SharedConf + +## @class +# Alias for Lemonldap::NG::Handler::SharedConf package Lemonldap::NG::Handler; our $VERSION = "0.9"; -our @ISA = ('Lemonldap::NG::Handler::SharedConf'); +use Lemonldap::NG::Handler::SharedConf; +use base qw(Lemonldap::NG::Handler::SharedConf); 1; diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/AuthBasic.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/AuthBasic.pm index e66db38de..46d896ff5 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/AuthBasic.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/AuthBasic.pm @@ -1,7 +1,5 @@ ##@file # Auth-basic authentication with Lemonldap::NG rights management -# -#@copy 2008 Xavier Guimard <x.guimard@free.fr> ##@class # Auth-basic authentication with Lemonldap::NG rights management diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/CDA.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/CDA.pm index 40ac585de..355e1cf75 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/CDA.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/CDA.pm @@ -1,7 +1,5 @@ ##@file # Cross-domain mechanism for handler -# -#@copy 2005, 2006, 2007, 2008 Xavier Guimard <x.guimard@free.fr> ##@class # Cross-domain mechanism for handler diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/CGI.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/CGI.pm index ee2ef19bd..e6da08b8d 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/CGI.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/CGI.pm @@ -1,7 +1,5 @@ ## @file # Auto-protected CGI machanism -# -# @copy 2008 Xavier Guimard <x.guimard@free.fr> ## @class # Base class for auto-protected CGI diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Proxy.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Proxy.pm index 60a32536f..0e1e74741 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Proxy.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Proxy.pm @@ -1,7 +1,5 @@ ## @file # Perl based proxy used to replace mod_proxy -# -# @copy 2005, 2006, 2007, 2008 Xavier Guimard <x.guimard@free.fr> ## @class # Perl based proxy used to replace mod_proxy diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/SharedConf.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/SharedConf.pm index bd6d80e75..aac759e6e 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/SharedConf.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/SharedConf.pm @@ -1,7 +1,5 @@ ## @file # Main handler. -# -# @copy 2005, 2006, 2007, 2008 Xavier Guimard <x.guimard@free.fr> ## @class # Main handler. diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm index 893eac77a..a52d97c7d 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm @@ -1,7 +1,5 @@ ## @file # Base file for Lemonldap::NG handlers -# -# @copy 2005, 2006, 2007, 2008 Xavier Guimard <x.guimard@free.fr> ## @class # Base class for Lemonldap::NG handlers. diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Status.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Status.pm index 7ae6efbf5..d7cec2050 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Status.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Status.pm @@ -1,7 +1,5 @@ ## @file # Status process mechanism -# -# @copy 2008 Xavier Guimard <x.guimard@free.fr> package Lemonldap::NG::Handler::Status; diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm index b89c10eb0..67c706954 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm @@ -1,7 +1,5 @@ ## @file # Virtual host support mechanism -# -# @copy 2005, 2006, 2007, 2008 Xavier Guimard <x.guimard@free.fr> ## @class # This class adds virtual host support for Lemonldap::NG handlers. diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm index 90940143c..07a7ae9eb 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm @@ -1,7 +1,13 @@ +## @file +# Alias for Lemonldap::NG::SharedConf + +## @class +# Alias for Lemonldap::NG::SharedConf package Lemonldap::NG::Portal; our $VERSION = "0.86"; -our @ISA = ('Lemonldap::NG::Portal::SharedConf'); +use Lemonldap::NG::Portal::SharedConf; +use base 'Lemonldap::NG::Portal::SharedConf'; 1; diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthApache.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthApache.pm index e55b56650..f91cc0f8f 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthApache.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthApache.pm @@ -1,7 +1,5 @@ ##@file # Apache authentication backend file -# -#@copy 2008, Xavier Guimard <x.guimard@free.fr> ##@class # Apache authentication backend class diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthCAS.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthCAS.pm index 1591911ca..3ccdfcd91 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthCAS.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthCAS.pm @@ -1,7 +1,5 @@ ##@file # CAS authentication backend file -# -#@copy 2008, Xavier Guimard <x.guimard@free.fr> ##@class # CAS authentication backend class diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthLDAP.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthLDAP.pm index dd2b11034..e613e5f17 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthLDAP.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthLDAP.pm @@ -1,7 +1,5 @@ ##@file # LDAP authentication backend file -# -#@copy 2008, Xavier Guimard <x.guimard@free.fr> ##@class # LDAP authentication backend class diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSSL.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSSL.pm index 8483e0911..a58b6c24e 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSSL.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSSL.pm @@ -1,7 +1,5 @@ ##@file # SSL authentication backend file -# -#@copy 2008, Xavier Guimard <x.guimard@free.fr> ##@class # SSL authentication backend class diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/CDA.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/CDA.pm index 6140f8cd0..fd8415a0b 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/CDA.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/CDA.pm @@ -1,3 +1,8 @@ +##@file +# Cross domain extension for Lemonldap::NG portals. + +##@class +# Cross domain extension for Lemonldap::NG portals. package Lemonldap::NG::Portal::CDA; use strict; @@ -14,16 +19,17 @@ use base ('Lemonldap::NG::Portal::SharedConf'); # OVERLOADED SUB # ################## -# 2. Existing sessions are validated so users coming from an other domain -# are not re-prompted +## @method int existingSession() +# Existing sessions must not be reauthenticated in CDA usage +# @return Lemonldap::NG::Portal error code sub existingSession { - my ( $self, $id, $datas ) = @_; PE_DONE; } -# 16. If the user was redirected to the portal, we will now redirect him -# to the requested URL. If it does not come from our domain, we add -# ID in URL +## @method int autoRedirect() +# Same as Lemonldap::NG::Portal::SharedConf::autoRedirect(), but add ID in URL +# if the user was redirected to the portal from another domain. +# @return Lemonldap::NG::Portal error code sub autoRedirect { my $self = shift; my $tmp = $self->{domain}; 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 1784a1dc7..b7ed113f8 100755 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm @@ -1,7 +1,5 @@ ##@file # Menu for Lemonldap::NG portal -# -#@copy 2008 Clement OUDOT <clement@oodo.net> <coudot@linagora.com> ##@class # Menu class for Lemonldap::NG portal diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/SharedConf.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/SharedConf.pm index b113f41a2..6bb5b60e8 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/SharedConf.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/SharedConf.pm @@ -1,7 +1,5 @@ ## @file # Main portal for Lemonldap::NG portal -# -# @copy 2005, 2006, 2007, 2008, Xavier Guimard <x.guimard@free.fr> ## @class # Main portal for Lemonldap::NG portal diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm index 163841194..1c86c449f 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm @@ -1,7 +1,5 @@ ##@file # Base package for Lemonldap::NG portal -# -#@copy 2005, 2006, 2007, 2008, Xavier Guimard <x.guimard@free.fr> ##@class # Base class for Lemonldap::NG portal diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDBLDAP.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDBLDAP.pm index 33c32baa7..c438530b7 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDBLDAP.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDBLDAP.pm @@ -1,7 +1,5 @@ ##@file # LDAP user database backend file -# -#@copy 2008, Xavier Guimard <x.guimard@free.fr> ##@class # LDAP user database backend class 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 19e0058c6..1d627a3ae 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm @@ -1,3 +1,8 @@ +##@file +# LDAP common functions + +##@class +# LDAP common functions package Lemonldap::NG::Portal::_LDAP; use Net::LDAP; @@ -5,6 +10,9 @@ use base qw(Net::LDAP); our $VERSION = '0.1'; +## @cmethod Lemonldap::NG::Portal::_LDAP new(Lemonldap::NG::Portal::Simple portal) +# Build a Net::LDAP object using parameters issued from $portal +# @return Lemonldap::NG::Portal::_LDAP object sub new { my $class = shift; my $portal = shift; @@ -49,13 +57,22 @@ sub new { return $self; } -# 6. LDAP bind with Lemonldap::NG account or anonymous unless defined +## @method Net::LDAP::Message bind(string dn, %args) +# Reimplementation of Net::LDAP::bind(). Connection is done : +# - with $dn and $args->{password} as dn/password if defined, +# - or with Lemonldap::NG account, +# - or with an anonymous bind. +# @param $dn LDAP distinguish name +# @param %args See Net::LDAP(3) manpage for more +# @return Net::LDAP::Message sub bind { my $self = shift; my $mesg; my ( $dn, %args ) = @_; - $dn ||= $self->{portal}->{managerDn}; - $args{password} ||= $self->{portal}->{managerPassword}; + unless($dn) [ + $dn = $self->{portal}->{managerDn}; + $args{password} = $self->{portal}->{managerPassword}; + } if ( $dn && $args{password} ) { $mesg = $self->SUPER::bind( $dn, %args ); } diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_WebForm.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_WebForm.pm index 14bcad7c7..267adc665 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_WebForm.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_WebForm.pm @@ -1,7 +1,5 @@ ##@file # Web form authentication backend file -# -#@copy 2008, Xavier Guimard <x.guimard@free.fr> ##@class # Web form authentication backend class 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 8c1045cb8..99373750c 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_i18n.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_i18n.pm @@ -1,3 +1,8 @@ +##@file +# Internationalization for Lemonldap::NG portal + +##@class +# Internationalization for Lemonldap::NG portal package Lemonldap::NG::Portal::_i18n; # Developpers warning : this file must stay UTF-8 encoded @@ -5,6 +10,10 @@ package Lemonldap::NG::Portal::_i18n; use AutoLoader qw(AUTOLOAD); our $VERSION = '0.3'; +## @fn string error(int error,string lang) +# @param $error Number of error to resolve +# @param $lang Language or Accepted-Language HTTP header string +# @return Error string for the $code in the $lang language sub error { my ( $error, $lang ) = @_; $lang = lc($lang); @@ -70,6 +79,9 @@ __END__ # * PE_DONE -1 # * PE_REDIRECT -2 +## @fn private arrayRef error_fr() +# French translation. +# @return Array of error messages sub error_fr { use utf8; [ @@ -114,6 +126,9 @@ sub error_fr { ]; } +## @fn private arrayRef error_en() +# English translation. +# @return Array of error messages sub error_en { [ "User authenticated", @@ -157,6 +172,9 @@ sub error_en { ]; } +## @fn private arrayRef error_ro() +# Romanian translation. +# @return Array of error messages sub error_ro { use utf8; [