Commit 294066c9 authored by salaun's avatar salaun
Browse files

Fix previous changes: still requires "require xxx"


git-svn-id: https://subversion.renater.fr/sympa/trunk@2205 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 7fa67123
...@@ -153,15 +153,19 @@ sub ldap_authentication { ...@@ -153,15 +153,19 @@ sub ldap_authentication {
do_log ('err',"Unable to use LDAP library, Net::LDAP required, install perl-ldap (CPAN) first"); do_log ('err',"Unable to use LDAP library, Net::LDAP required, install perl-ldap (CPAN) first");
return undef; return undef;
} }
require Net::LDAP;
unless (eval "require Net::LDAP::Entry") { unless (eval "require Net::LDAP::Entry") {
do_log ('err',"Unable to use LDAP library,Net::LDAP::Entry required install perl-ldap (CPAN) first"); do_log ('err',"Unable to use LDAP library,Net::LDAP::Entry required install perl-ldap (CPAN) first");
return undef; return undef;
} }
require Net::LDAP::Entry;
unless (eval "require Net::LDAP::Message") { unless (eval "require Net::LDAP::Message") {
do_log ('err',"Unable to use LDAP library,Net::LDAP::Entry required install perl-ldap (CPAN) first"); do_log ('err',"Unable to use LDAP library,Net::LDAP::Entry required install perl-ldap (CPAN) first");
return undef; return undef;
} }
require Net::LDAP::Message;
foreach my $ldap (@{$Conf{'auth_services'}}){ foreach my $ldap (@{$Conf{'auth_services'}}){
# only ldap service are to be applied here # only ldap service are to be applied here
...@@ -186,6 +190,7 @@ sub ldap_authentication { ...@@ -186,6 +190,7 @@ sub ldap_authentication {
do_log ('err',"Unable to use LDAPS library, Net::LDAPS required"); do_log ('err',"Unable to use LDAPS library, Net::LDAPS required");
return undef; return undef;
} }
require Net::LDAPS;
my %param; my %param;
$param{'timeout'} = $ldap->{'timeout'} if ($ldap->{'timeout'}); $param{'timeout'} = $ldap->{'timeout'} if ($ldap->{'timeout'});
...@@ -239,6 +244,7 @@ sub ldap_authentication { ...@@ -239,6 +244,7 @@ sub ldap_authentication {
do_log ('err',"Unable to use LDAPS library, Net::LDAPS required"); do_log ('err',"Unable to use LDAPS library, Net::LDAPS required");
return undef; return undef;
} }
require Net::LDAPS;
my %param; my %param;
$param{'timeout'} = $ldap->{'timeout'} if ($ldap->{'timeout'}); $param{'timeout'} = $ldap->{'timeout'} if ($ldap->{'timeout'});
...@@ -334,16 +340,19 @@ sub cas_get_email_by_net_id { ...@@ -334,16 +340,19 @@ sub cas_get_email_by_net_id {
do_log ('err',"Unable to use LDAP library, Net::LDAP required, install perl-ldap (CPAN) first"); do_log ('err',"Unable to use LDAP library, Net::LDAP required, install perl-ldap (CPAN) first");
return undef; return undef;
} }
require Net::LDAP;
unless (eval "require Net::LDAP::Entry") { unless (eval "require Net::LDAP::Entry") {
do_log ('err',"Unable to use LDAP library,Net::LDAP::Entry required install perl-ldap (CPAN) first"); do_log ('err',"Unable to use LDAP library,Net::LDAP::Entry required install perl-ldap (CPAN) first");
return undef; return undef;
} }
require Net::LDAP::Entry;
unless (eval "require Net::LDAP::Message") { unless (eval "require Net::LDAP::Message") {
do_log ('err',"Unable to use LDAP library,Net::LDAP::Entry required install perl-ldap (CPAN) first"); do_log ('err',"Unable to use LDAP library,Net::LDAP::Entry required install perl-ldap (CPAN) first");
return undef; return undef;
} }
require Net::LDAP::Message;
my $ldap = @{$Conf{'auth_services'}}[$auth_id]; my $ldap = @{$Conf{'auth_services'}}[$auth_id];
my $filter = $ldap->{'ldap_get_email_by_uid_filter'} ; my $filter = $ldap->{'ldap_get_email_by_uid_filter'} ;
...@@ -368,6 +377,7 @@ sub cas_get_email_by_net_id { ...@@ -368,6 +377,7 @@ sub cas_get_email_by_net_id {
do_log ('err',"Unable to use LDAPS library, Net::LDAPS required"); do_log ('err',"Unable to use LDAPS library, Net::LDAPS required");
return undef; return undef;
} }
require Net::LDAPS;
$ldap_anonymous = Net::LDAPS->new($host,%param); $ldap_anonymous = Net::LDAPS->new($host,%param);
}else { }else {
......
...@@ -298,6 +298,7 @@ sub valid_email { ...@@ -298,6 +298,7 @@ sub valid_email {
# create a cipher # create a cipher
sub ciphersaber_installed { sub ciphersaber_installed {
if (eval "require Crypt::CipherSaber") { if (eval "require Crypt::CipherSaber") {
require Crypt::CipherSaber;
return &Crypt::CipherSaber->new($Conf{'cookie'}); return &Crypt::CipherSaber->new($Conf{'cookie'});
}else{ }else{
return ('no_cipher'); return ('no_cipher');
......
...@@ -382,6 +382,7 @@ my $pinfo = &List::_apply_defaults(); ...@@ -382,6 +382,7 @@ my $pinfo = &List::_apply_defaults();
my $zip_is_installed ; my $zip_is_installed ;
if (eval "require Archive::Zip") { if (eval "require Archive::Zip") {
require Archive::Zip;
$zip_is_installed = 1; $zip_is_installed = 1;
} }
...@@ -1774,6 +1775,7 @@ sub do_sso_login_succeeded { ...@@ -1774,6 +1775,7 @@ sub do_sso_login_succeeded {
do_log ('err',"Unable to use LDAP library, Net::LDAP required,install perl-ldap (CPAN) first"); do_log ('err',"Unable to use LDAP library, Net::LDAP required,install perl-ldap (CPAN) first");
return undef; return undef;
} }
require Net::LDAP;
my ($ldap_anonymous,$host,$filter); my ($ldap_anonymous,$host,$filter);
...@@ -1809,6 +1811,7 @@ sub do_sso_login_succeeded { ...@@ -1809,6 +1811,7 @@ sub do_sso_login_succeeded {
do_log ('err',"Unable to use LDAPS library, Net::LDAPS required"); do_log ('err',"Unable to use LDAPS library, Net::LDAPS required");
return undef; return undef;
} }
require Net::LDAPS;
my %param; my %param;
$param{'timeout'} = $ldap->{'timeout'} if ($ldap->{'timeout'}); $param{'timeout'} = $ldap->{'timeout'} if ($ldap->{'timeout'});
...@@ -4826,6 +4829,8 @@ sub do_set_pending_list_request { ...@@ -4826,6 +4829,8 @@ sub do_set_pending_list_request {
do_log ('err',"Unable to use Net library, Net::SMTP required, install it (CPAN) first"); do_log ('err',"Unable to use Net library, Net::SMTP required, install it (CPAN) first");
return undef; return undef;
} }
require Net::SMTP;
if( $smtp = Net::SMTP->new($smtp_relay, if( $smtp = Net::SMTP->new($smtp_relay,
Hello => $smtp_relay, Hello => $smtp_relay,
Timeout => 30) ) { Timeout => 30) ) {
......
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