From 78b756571cddfbf45cb7d3cef2513d5cb671f2e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Thu, 28 Jan 2010 10:09:02 +0000 Subject: [PATCH] Manager: resolve bug on help message language --- .../lib/Lemonldap/NG/Manager.pm | 26 ++++++++++--------- .../lib/Lemonldap/NG/Manager/Help.pm | 9 ++++--- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm index 0c0bf5e16..10dacb085 100644 --- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm +++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm @@ -20,10 +20,6 @@ our @ISA = qw( Lemonldap::NG::Manager::_i18n ); -BEGIN { - *process = *doall; -} - ## @cmethod Lemonldap::NG::Manager new(hashRef args) # Class constructor. #@param args hash reference @@ -36,33 +32,39 @@ sub new { # Try to load local configuration parameters my $conf = Lemonldap::NG::Common::Conf->new( $self->{configStorage} ); - my $localconf = $conf->getLocalConf( MANAGERSECTION ); - if ( $localconf ) { - $self->{$_} = $args->{$_} || $localconf->{$_} foreach ( keys %$localconf ); + my $localconf = $conf->getLocalConf(MANAGERSECTION); + if ($localconf) { + $self->{$_} = $args->{$_} || $localconf->{$_} + foreach ( keys %$localconf ); } # Default values $self->{managerSkin} = "default" unless defined $self->{managerSkin}; $self->{managerCss} = "accordion.css" unless defined $self->{managerCss}; - $self->{managerTreeAutoClose} = "true" unless defined $self->{managerTreeAutoClose}; - $self->{managerTreeJqueryCss} = "true" unless defined $self->{managerTreeJqueryCss}; + $self->{managerTreeAutoClose} = "true" + unless defined $self->{managerTreeAutoClose}; + $self->{managerTreeJqueryCss} = "true" + unless defined $self->{managerTreeJqueryCss}; + # Display help if ?help= if ( $self->param('help') ) { print $self->header_public( $ENV{SCRIPT_FILENAME}, -type => 'text/html; charset=utf8' ); - Lemonldap::NG::Manager::Help::import( $self->{language} - || $ENV{HTTP_ACCEPT_LANGUAGE} ) - unless ( $self->can('help_groups') ); + &Lemonldap::NG::Manager::Help::import( $self->{language} ); my $chap = $self->param('help'); eval { no strict "refs"; &{"help_$chap"} }; $self->quit(); } + + # Save conf if ?data= elsif ( my $rdata = $self->rparam('data') ) { require Lemonldap::NG::Manager::Uploader; #inherits $self->confUpload($rdata); $self->quit(); } + + # Else load conf require Lemonldap::NG::Manager::Downloader; #inherits $self->{cfgNum} = $self->param('cfgNum') diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Help.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Help.pm index aa8b73c36..de0743d63 100644 --- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Help.pm +++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Help.pm @@ -10,10 +10,11 @@ our $VERSION = '0.5'; ## @fn void import(string lang) # Import help messages subroutines in Lemonldap::NG::Manager in the wanted language. -# @param $lang Language string of "Accept-Language" HTTP header value +# @param $lang language, or $ENV{HTTP_ACCEPT_LANGUAGE} by default +# @return nothing sub import { my ($caller_package) = caller; - my $lang = shift; + my $lang = shift || $ENV{HTTP_ACCEPT_LANGUAGE}; $lang = lc($lang); foreach ( split( /[,;]/, $lang ) ) { next if /=/; @@ -24,7 +25,7 @@ sub import { last; } } - $l ||= "en"; + $l ||= en; foreach $h ( qw(authParams cookieName domain groups ldap macros storage timeout vars whatToTrace virtualHosts portalForceAuthn default) @@ -686,7 +687,7 @@ sub help_portalForceAuthn_fr {

Forcer l'authentification sur le portail

Par défaut, lorsqu'un utilisateur est authentifié sur le portail, lorsqu'il y revient son authentification est conservée et le menu est affiché.

L'activation de cette option forcera l'utilisateur à s'authentifier de nouveau et sa session sera alors mise à jour.

-

L'identifiant et la date de création de la session ne sont pas modifiés. La date de mise à jour est indiquée dans le champ updateDate. Les autres inforations son mises à jour.

+

L'identifiant et la date de création de la session ne sont pas modifiés. La date de mise à jour est indiquée dans le champ updateDate. Les autres informations son mises à jour.

Valeur par défaut : 0

EOT }