Commit 673172be authored by olivier.salaun's avatar olivier.salaun
Browse files

Generalize "use strict vars"


git-svn-id: https://subversion.renater.fr/sympa/trunk@4774 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 3447a331
......@@ -23,6 +23,8 @@
package Conf;
use strict "vars";
use Log;
use Language;
use wwslib;
......@@ -31,8 +33,8 @@ use CAS;
require Exporter;
use Carp;
@ISA = qw(Exporter);
@EXPORT = qw(%Conf DAEMON_MESSAGE DAEMON_COMMAND DAEMON_CREATION DAEMON_ALL);
our @ISA = qw(Exporter);
our @EXPORT = qw(%Conf DAEMON_MESSAGE DAEMON_COMMAND DAEMON_CREATION DAEMON_ALL);
require 'tools.pl';
......@@ -82,7 +84,7 @@ my %old_options = ('trusted_ca_options' => 'capath,cafile',
);
## These parameters now have a hard-coded value
## Customized value can be accessed though as %Ignored_Conf
%Ignored_Conf;
my %Ignored_Conf;
my %hardcoded_options = ('filesystem_encoding' => 'utf8');
my %valid_options = ();
......@@ -293,7 +295,7 @@ my %trusted_applications = ('trusted_application' => {'occurrence' => '0-n',
my $wwsconf;
%Conf = ();
our %Conf = ();
## Loads and parses the configuration file. Reports errors if any.
sub load {
......@@ -509,7 +511,7 @@ sub load_nrcpt_by_domain {
my $config = $Conf{'etc'}.'/nrcpt_by_domain.conf';
my $line_num = 0;
my $config_err = 0;
my %nrcpt_by_domain ;
my $nrcpt_by_domain ;
my $valid_dom = 0;
......@@ -545,7 +547,7 @@ sub load_nrcpt_by_domain {
## load each virtual robots configuration files
sub load_robots {
my %robot_conf ;
my $robot_conf ;
my %valid_robot_key_words = ( 'http_host' => 1,
'allow_subscribe_if_pending' => 1,
listmaster => 1,
......@@ -617,7 +619,7 @@ sub load_robots {
$robot_conf->{$Conf{'domain'}}{$key} = $Conf{$key};
}
foreach $robot (readdir(DIR)) {
foreach my $robot (readdir(DIR)) {
next unless (-d "$Conf{'etc'}/$robot");
next unless (-f "$Conf{'etc'}/$robot/robot.conf");
......@@ -726,6 +728,7 @@ sub load_robots {
## Check required files and create them if required
sub checkfiles_as_root {
my $config_err = 0;
## Check aliases file
unless (-f $Conf{'sendmail_aliases'}) {
......@@ -1115,7 +1118,7 @@ sub _load_auth {
next;
}
my %cas_param = (casUrl => $current_paragraph->{'base_url'});
my $cas_param = {casUrl => $current_paragraph->{'base_url'}};
## Optional parameters
## We should also cope with X509 CAs
......@@ -1130,7 +1133,7 @@ sub _load_auth {
$cas_param->{'proxyValidatePath'} = $current_paragraph->{'proxy_validate_path'}
if (defined $current_paragraph->{'proxy_validate_path'});
$current_paragraph->{'cas_server'} = new CAS(%cas_param);
$current_paragraph->{'cas_server'} = new CAS(%{$cas_param});
unless (defined $current_paragraph->{'cas_server'}) {
&do_log('err', 'Failed to create CAS object for %s : %s',
$current_paragraph->{'base_url'}, &CAS::get_errors());
......
......@@ -23,10 +23,12 @@
package WebAgent;
use strict "vars";
use LWP::UserAgent;
## Good documentation : http://articles.mongueurs.net/magazines/linuxmag57.html
@ISA = qw (LWP::UserAgent);
our @ISA = qw (LWP::UserAgent);
my ($web_user, $web_passwd);
......@@ -43,8 +45,8 @@ sub set_basic_credentials {
package Fetch;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw();
our @ISA = qw(Exporter);
our @EXPORT = qw();
use Log;
......@@ -138,9 +140,9 @@ sub get_https2{
my $ssl_data= shift;
my $trusted_ca_file = $ssl_data->{'cafile'};
$trusted_ca_file ||= $Conf{'cafile'};
$trusted_ca_file ||= $Conf::Conf{'cafile'};
my $trusted_ca_path = $ssl_data->{'capath'};
$trusted_ca_path ||= $Conf{'capath'};
$trusted_ca_path ||= $Conf::Conf{'capath'};
do_log ('debug','Fetch::get_https2 (%s,%s,%s,%s,%s)',$host,$port,$path,$trusted_ca_file,$trusted_ca_path );
......
......@@ -21,12 +21,14 @@
package Ldap;
use strict "vars";
use Conf;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(%Ldap);
our @ISA = qw(Exporter);
our @EXPORT = qw(%Ldap);
my @valid_options = qw(host suffix filter scope bind_dn bind_password);
my @required_options = qw(host suffix filter);
......@@ -46,7 +48,7 @@ my %Default_Conf =
'bind_password' => undef
);
%Ldap = ();
my %Ldap = ();
## Loads and parses the configuration file. Reports errors if any.
sub load {
......
......@@ -23,14 +23,16 @@
package Log;
use strict "vars";
require Exporter;
use Sys::Syslog;
use Carp;
use POSIX qw/mktime/;
use Encode;
@ISA = qw(Exporter);
@EXPORT = qw(fatal_err do_log do_openlog $log_level);
our @ISA = qw(Exporter);
our @EXPORT = qw(fatal_err do_log do_openlog $log_level);
my ($log_facility, $log_socket_type, $log_service,$sth,@sth_stack,$rows_nb);
# When logs are not available, period of time to wait before sending another warning to listmaster.
......@@ -273,7 +275,7 @@ sub db_log {
# delete logs in RDBMS
sub db_log_del {
my $exp = &Conf::get_robot_conf($Conf{'host'},'logs_expiration_period');
my $exp = &Conf::get_robot_conf($Conf::Conf{'host'},'logs_expiration_period');
my $date = time - ($exp * 30 * 24 * 60 * 60);
my $dbh = &List::db_get_handler();
......
......@@ -21,14 +21,16 @@
package Version;
use strict "vars";
require Exporter;
use Carp;
@ISA = qw(Exporter);
@EXPORT = qw($Version);
our @ISA = qw(Exporter);
our @EXPORT = qw($Version);
$Version = '--SYMPA_VERSION--';
our $Version = '--SYMPA_VERSION--';
1;
......
......@@ -23,6 +23,8 @@
package parser;
use strict "vars";
use FileHandle;
use Log;
......@@ -34,8 +36,7 @@ my ($index, @t, $data, $internal, $previous_file, %option, $current_output);
## template : a filename or a ARRAY ref that contains the template
## output : a Filedescriptor or a ARRAY ref for the output
sub parse_tpl {
my ($template, $output);
($data, $template, $output, $recurse) = @_;
my ($data, $template, $output, $recurse) = @_;
&do_log('debug2','Parser [%d] parse_tpl(%s)', $index, $template);
......@@ -240,6 +241,7 @@ sub do_foreach {
&do_log('debug3','Parser [%d] do_foreach(%s)', $index, $t[$index]);
if (/\[\s*FOREACH\s+(\w+)\s+IN\s+(\w+)(\->(\w+))?\s*\]/i) {
my ($key, $key2);
($var, $key, $key2) = ($1, $2, $4);
$start = $index;
......
......@@ -24,8 +24,8 @@ package Auth;
use lib '--LIBDIR--';
use Exporter;
@ISA = ('Exporter');
@EXPORT = ();
our @ISA = ('Exporter');
our @EXPORT = ();
use Log;
use Conf;
......
......@@ -40,6 +40,7 @@ This fcgi script completely handles all aspects of the Sympa web interface
 
## Change this to point to your Sympa bin directory
use lib '--LIBDIR--';
use Getopt::Long;
use Archive::Zip;
 
......
Supports Markdown
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