Unverified Commit 55f301c4 authored by IKEDA Soji's avatar IKEDA Soji Committed by GitHub
Browse files

Merge pull request #421 from k0lter/sympa-6.2 by k0lter

Create ${expldir}/${robot} directory if it does not exists
parents ea788a49 57878b46
...@@ -842,6 +842,9 @@ sub load { ...@@ -842,6 +842,9 @@ sub load {
## Set of initializations ; only performed when the config is first loaded ## Set of initializations ; only performed when the config is first loaded
if ($options->{'first_access'}) { if ($options->{'first_access'}) {
if ($robot && (! -d "$Conf::Conf{'home'}/$robot")) {
mkdir "$Conf::Conf{'home'}/$robot", 0775
}
if ($robot && (-d "$Conf::Conf{'home'}/$robot")) { if ($robot && (-d "$Conf::Conf{'home'}/$robot")) {
$self->{'dir'} = "$Conf::Conf{'home'}/$robot/$name"; $self->{'dir'} = "$Conf::Conf{'home'}/$robot/$name";
} elsif (lc($robot) eq lc($Conf::Conf{'domain'})) { } elsif (lc($robot) eq lc($Conf::Conf{'domain'})) {
...@@ -8045,8 +8048,7 @@ sub get_robots { ...@@ -8045,8 +8048,7 @@ sub get_robots {
} }
my $use_default_robot = 1; my $use_default_robot = 1;
foreach $r (sort readdir(DIR)) { foreach $r (sort readdir(DIR)) {
next unless (($r !~ /^\./o) && (-d "$Conf::Conf{'home'}/$r")); next unless (($r !~ /^\./o) && (-r "$Conf::Conf{'etc'}/$r/robot.conf"));
next unless (-r "$Conf::Conf{'etc'}/$r/robot.conf");
push @robots, $r; push @robots, $r;
undef $use_default_robot if ($r eq $Conf::Conf{'domain'}); undef $use_default_robot if ($r eq $Conf::Conf{'domain'});
} }
......
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