{ use PHP::Serialization qw(serialize); use esmith::AccountsDB; my $a = esmith::AccountsDB->open_ro || die "Error opening accounts db\n"; my @s = $a->get_all_by_prop( type => 'share' ); my $data; foreach my $group ($a->groups){ my $groupname = $group->key; foreach my $share (@s){ my $sharename = $share->key; my $access = $share->prop('Ajaxplorer') || 'disabled'; next unless ($access eq 'enabled'); my @read = split(/[;,]/, $share->prop('ReadGroups') || ''); my @write = split(/[;,]/, $share->prop('WriteGroups') || ''); $data->{$groupname}->{"\0*\0acls"}->{$sharename} = 'rw' if ( grep { $groupname eq $_ } @write ); $data->{$groupname}->{"\0*\0acls"}->{$sharename} = 'r' if ( grep { $groupname eq $_ } @read ); $data->{$groupname}->{"\0*\0roleId"} = $groupname; $data->{$groupname} = bless $data->{$groupname},'PHP::Serialization::Object::AJXP_Role'; } } $OUT = serialize($data); }