Manager: resolve bug on help message language

environments/ppa-mbqj77/deployments/1
Clément Oudot 16 years ago
parent 760f62e534
commit 78b756571c
  1. 26
      modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
  2. 9
      modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Help.pm

@ -20,10 +20,6 @@ our @ISA = qw(
Lemonldap::NG::Manager::_i18n Lemonldap::NG::Manager::_i18n
); );
BEGIN {
*process = *doall;
}
## @cmethod Lemonldap::NG::Manager new(hashRef args) ## @cmethod Lemonldap::NG::Manager new(hashRef args)
# Class constructor. # Class constructor.
#@param args hash reference #@param args hash reference
@ -36,33 +32,39 @@ sub new {
# Try to load local configuration parameters # Try to load local configuration parameters
my $conf = Lemonldap::NG::Common::Conf->new( $self->{configStorage} ); my $conf = Lemonldap::NG::Common::Conf->new( $self->{configStorage} );
my $localconf = $conf->getLocalConf( MANAGERSECTION ); my $localconf = $conf->getLocalConf(MANAGERSECTION);
if ( $localconf ) { if ($localconf) {
$self->{$_} = $args->{$_} || $localconf->{$_} foreach ( keys %$localconf ); $self->{$_} = $args->{$_} || $localconf->{$_}
foreach ( keys %$localconf );
} }
# Default values # Default values
$self->{managerSkin} = "default" unless defined $self->{managerSkin}; $self->{managerSkin} = "default" unless defined $self->{managerSkin};
$self->{managerCss} = "accordion.css" unless defined $self->{managerCss}; $self->{managerCss} = "accordion.css" unless defined $self->{managerCss};
$self->{managerTreeAutoClose} = "true" unless defined $self->{managerTreeAutoClose}; $self->{managerTreeAutoClose} = "true"
$self->{managerTreeJqueryCss} = "true" unless defined $self->{managerTreeJqueryCss}; unless defined $self->{managerTreeAutoClose};
$self->{managerTreeJqueryCss} = "true"
unless defined $self->{managerTreeJqueryCss};
# Display help if ?help=
if ( $self->param('help') ) { if ( $self->param('help') ) {
print $self->header_public( $ENV{SCRIPT_FILENAME}, print $self->header_public( $ENV{SCRIPT_FILENAME},
-type => 'text/html; charset=utf8' ); -type => 'text/html; charset=utf8' );
Lemonldap::NG::Manager::Help::import( $self->{language} &Lemonldap::NG::Manager::Help::import( $self->{language} );
|| $ENV{HTTP_ACCEPT_LANGUAGE} )
unless ( $self->can('help_groups') );
my $chap = $self->param('help'); my $chap = $self->param('help');
eval { no strict "refs"; &{"help_$chap"} }; eval { no strict "refs"; &{"help_$chap"} };
$self->quit(); $self->quit();
} }
# Save conf if ?data=
elsif ( my $rdata = $self->rparam('data') ) { elsif ( my $rdata = $self->rparam('data') ) {
require Lemonldap::NG::Manager::Uploader; #inherits require Lemonldap::NG::Manager::Uploader; #inherits
$self->confUpload($rdata); $self->confUpload($rdata);
$self->quit(); $self->quit();
} }
# Else load conf
require Lemonldap::NG::Manager::Downloader; #inherits require Lemonldap::NG::Manager::Downloader; #inherits
$self->{cfgNum} = $self->{cfgNum} =
$self->param('cfgNum') $self->param('cfgNum')

@ -10,10 +10,11 @@ our $VERSION = '0.5';
## @fn void import(string lang) ## @fn void import(string lang)
# Import help messages subroutines in Lemonldap::NG::Manager in the wanted language. # 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 { sub import {
my ($caller_package) = caller; my ($caller_package) = caller;
my $lang = shift; my $lang = shift || $ENV{HTTP_ACCEPT_LANGUAGE};
$lang = lc($lang); $lang = lc($lang);
foreach ( split( /[,;]/, $lang ) ) { foreach ( split( /[,;]/, $lang ) ) {
next if /=/; next if /=/;
@ -24,7 +25,7 @@ sub import {
last; last;
} }
} }
$l ||= "en"; $l ||= en;
foreach $h ( foreach $h (
qw(authParams cookieName domain groups ldap macros storage timeout vars qw(authParams cookieName domain groups ldap macros storage timeout vars
whatToTrace virtualHosts portalForceAuthn default) whatToTrace virtualHosts portalForceAuthn default)
@ -686,7 +687,7 @@ sub help_portalForceAuthn_fr {
<h3>Forcer l'authentification sur le portail</h3> <h3>Forcer l'authentification sur le portail</h3>
<p>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é.</p> <p>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é.</p>
<p>L'activation de cette option forcera l'utilisateur à s'authentifier de nouveau et sa session sera alors mise à jour.</p> <p>L'activation de cette option forcera l'utilisateur à s'authentifier de nouveau et sa session sera alors mise à jour.</p>
<p class="info">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 <tt>updateDate</tt>. Les autres inforations son mises à jour.</p> <p class="info">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 <tt>updateDate</tt>. Les autres informations son mises à jour.</p>
<p class="default">Valeur par défaut : 0</p> <p class="default">Valeur par défaut : 0</p>
EOT EOT
} }

Loading…
Cancel
Save