Revision 28bd71eb
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
sql/Pg-upgrade2-auth/clients_webdav.pl | ||
---|---|---|
9 | 9 |
|
10 | 10 |
use parent qw(SL::DBUpgrade2::Base); |
11 | 11 |
|
12 |
use File::Find (); |
|
12 | 13 |
use File::Path qw(make_path); |
13 | 14 |
use IO::Dir; |
14 | 15 |
use List::MoreUtils qw(any all); |
... | ... | |
81 | 82 |
symlink '../' . $client->{id}, "webdav/links/${name}"; |
82 | 83 |
} |
83 | 84 |
|
85 |
sub _webdav_folders_used { |
|
86 |
my ($self, %params) = @_; |
|
87 |
|
|
88 |
my $contains_files = 0; |
|
89 |
my $wanted = sub { |
|
90 |
$contains_files = 1 if -f && !m{/(?:\.gitignore|.dummy|webdav-user)$}; |
|
91 |
}; |
|
92 |
|
|
93 |
File::Find::find({ wanted => $wanted, no_chdir => 1 }, 'webdav'); |
|
94 |
|
|
95 |
return $contains_files; |
|
96 |
} |
|
97 |
|
|
84 | 98 |
sub run { |
85 | 99 |
my ($self) = @_; |
86 | 100 |
|
87 |
# WebDAV not activated? Remove old folders, and we're done.
|
|
88 |
return $self->_unlink_old_folders if !$::lx_office_conf{features}->{webdav};
|
|
101 |
# WebDAV not used? Remove old folders, and we're done.
|
|
102 |
return $self->_unlink_old_folders if !$self->_webdav_folders_used;
|
|
89 | 103 |
|
90 | 104 |
# Ensure at least one client exists. |
91 | 105 |
$self->_ensure_one_client_exists; |
Auch abrufbar als: Unified diff
Mandanten-WebDAV-Upgrade: nicht an Konfigurationseinstellung sondern Existenz von Dateien festmachen