Commit ffe34c6d authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Merge branch 'develop' of https://github.com/UPC/ravada into develop

parents 3056c0ab bfa8caf7
......@@ -21,10 +21,12 @@ Initializes the submodules
sub init {
my ($config, $db_con) = @_;
if ($config->{ldap}) {
if ($config->{ldap} && (!defined $LDAP_OK || $LDAP_OK) ) {
eval {
$LDAP_OK = 0;
require Ravada::Auth::LDAP;
Ravada::Auth::LDAP::init($config);
Ravada::Auth::LDAP::_connect_ldap();
$LDAP_OK = 1;
};
warn $@ if $@;
......
......@@ -537,6 +537,7 @@ sub test_pass_storage($with_posix_group) {
my @args = ( $name, $with_posix_group, $$, $storage);
push @args, ($algorithm) if $algorithm;
$Ravada::Auth::LDAP_OK=undef;
Ravada::Auth::LDAP::init();
my $user = test_user(@args);
......
......@@ -478,6 +478,7 @@ for my $vm_name ( vm_names() ) {
}
my $ldap;
$Ravada::Auth::LDAP_OK = undef;
eval { $ldap = Ravada::Auth::LDAP::_init_ldap_admin() } if $vm;
if ($@ =~ /Bad credentials/) {
......
......@@ -1829,7 +1829,7 @@ sub init_ldap_config($file_config='t/etc/ravada_ldap.conf'
$config->{vm}=['KVM','Void'];
delete $config->{ldap}->{ravada_posix_group} if !$with_posix_group;
my $fly_config = "/var/tmp/ravada_".base_domain_name().".conf";
my $fly_config = "/var/tmp/ravada_".base_domain_name().".$$.conf";
DumpFile($fly_config, $config);
$RVD_BACK = undef;
......
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