Correctly set permission on the 'home' repo if enabled

tags/0.2.3_el5 0.2.3_el5
Daniel Berteaud 11 years ago
parent 61f5ead07d
commit 247f7506fc
  1. 10
      root/etc/e-smith/events/actions/pydio-user-rights

@ -37,6 +37,9 @@ unlink(</var/lib/pydio/tmp/sess_*>);
# Remove plugin cache
unlink(</var/cache/pydio/plugin*.ser>);
my $pydio = $c->get('pydio') || die "Couldn't find pydio entry in ConfigDB\n";
my $homedir = $pydio->prop('HomeDir') || 'none';
foreach my $user (($a->users),$a->get('admin')){
my $name = $user->key;
my $first = $user->prop('FirstName') || '';
@ -86,6 +89,10 @@ foreach my $user (($a->users),$a->get('admin')){
# Special case: admin has access to everything
$data->{"\0*\0acls"}->{$sharename} = 'rw' if ($name eq 'admin');
}
# Set ACL for the private homedir if enabled
if ($homedir eq 'enabled' || ($homedir eq 'users' && (($user->prop('PydioHomeDir') || 'disabled') eq 'enabled'))){
$data->{"\0*\0acls"}->{'home'} = 'r';
}
# As we're here, lets update the email address and the display name
# First, delete parameter if it's an array (meaning it's empty)
delete $data->{"\0*\0parameters"} if (ref ($data->{"\0*\0parameters"})=~ m/ARRAY/i);
@ -101,9 +108,6 @@ foreach my $user (($a->users),$a->get('admin')){
chown '0', '102', "/var/lib/pydio/plugins/auth.serial/$name/role.ser";
}
my $pydio = $c->get('pydio') || die "Couldn't find pydio entry in ConfigDB\n";
my $homedir = $pydio->prop('HomeDir') || 'none';
if ($homedir eq 'enabled'){
foreach ($a->users){
my $name = $_->key;

Loading…
Cancel
Save