|
|
@ -41,16 +41,28 @@ unlink(</var/cache/ajaxplorer/i18n/*.ser>); |
|
|
|
|
|
|
|
|
|
|
|
foreach my $user (($a->users),$a->get('admin')){ |
|
|
|
foreach my $user (($a->users),$a->get('admin')){ |
|
|
|
my $name = $user->key; |
|
|
|
my $name = $user->key; |
|
|
|
|
|
|
|
my $data; |
|
|
|
mkpath('/var/lib/ajaxplorer/plugins/auth.serial/' . $name); |
|
|
|
mkpath('/var/lib/ajaxplorer/plugins/auth.serial/' . $name); |
|
|
|
chmod 0770, "/var/lib/ajaxplorer/plugins/auth.serial/$name"; |
|
|
|
chmod 0770, "/var/lib/ajaxplorer/plugins/auth.serial/$name"; |
|
|
|
chown '0', '102', "/var/lib/ajaxplorer/plugins/auth.serial/$name"; |
|
|
|
chown '0', '102', "/var/lib/ajaxplorer/plugins/auth.serial/$name"; |
|
|
|
|
|
|
|
|
|
|
|
if (-s "/var/lib/ajaxplorer/plugins/auth.serial/$name/role.ser"){ |
|
|
|
if (-s "/var/lib/ajaxplorer/plugins/auth.serial/$name/role.ser"){ |
|
|
|
open RROLE, "/var/lib/ajaxplorer/plugins/auth.serial/$name/role.ser"; |
|
|
|
open RROLE, "/var/lib/ajaxplorer/plugins/auth.serial/$name/role.ser"; |
|
|
|
my $data = <RROLE>; |
|
|
|
$data = <RROLE>; |
|
|
|
close RROLE; |
|
|
|
close RROLE; |
|
|
|
$data = unserialize($data); |
|
|
|
$data = unserialize($data); |
|
|
|
delete $data->{"\0*\0acls"} if (defined $data->{"\0*\0acls"}); |
|
|
|
delete $data->{"\0*\0acls"} if (defined $data->{"\0*\0acls"}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
# No role yet ? lets create it |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$data->{"\0*\0groupPath"} = undef; |
|
|
|
|
|
|
|
$data->{"\0*\0autoApplies"} = []; |
|
|
|
|
|
|
|
$data->{"\0*\0parameters"} = []; |
|
|
|
|
|
|
|
$data->{"\0*\0roleLabel"} = undef; |
|
|
|
|
|
|
|
$data->{"\0*\0actions"} = []; |
|
|
|
|
|
|
|
$data->{"\0*\0roleId"} = "AJXP_USR_/$name"; |
|
|
|
|
|
|
|
$data = bless $data, 'PHP::Serialization::Object::AJXP_Role'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
# In any case, re-compute the effective permissions |
|
|
|
foreach my $share ($a->get_all_by_prop(type => 'share')){ |
|
|
|
foreach my $share ($a->get_all_by_prop(type => 'share')){ |
|
|
|
my $sharename = $share->key; |
|
|
|
my $sharename = $share->key; |
|
|
|
my $access = $share->prop('Ajaxplorer') || 'disabled'; |
|
|
|
my $access = $share->prop('Ajaxplorer') || 'disabled'; |
|
|
@ -78,7 +90,6 @@ foreach my $user (($a->users),$a->get('admin')){ |
|
|
|
print WROLE serialize($data); |
|
|
|
print WROLE serialize($data); |
|
|
|
close WROLE; |
|
|
|
close WROLE; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
my $ajxp = $c->get('ajaxplorer') || die "Couldn't find ajaxplorer entry in ConfigDB\n"; |
|
|
|
my $ajxp = $c->get('ajaxplorer') || die "Couldn't find ajaxplorer entry in ConfigDB\n"; |
|
|
|
my $homedir = $ajxp->prop('HomeDir') || 'none'; |
|
|
|
my $homedir = $ajxp->prop('HomeDir') || 'none'; |
|
|
|