\n \n ";
print $q->start_table ({-CLASS => "sme-border"}),"\n ";
print $q->Tr(
- esmith::cgi::genSmallCell($q, $self->localise($account),"header"),
- esmith::cgi::genSmallCell($q, $self->localise($acctName),"header"),
- esmith::cgi::genSmallCell($q, $self->localise('ACTION'),"header",4));
+ esmith::cgi::genSmallCell($q, $self->localise('ACCOUNT'),"header"),
+ esmith::cgi::genSmallCell($q, $self->localise('USER_NAME'),"header"),
+ esmith::cgi::genSmallCell($q, $self->localise('ACTION'),"header",4)
+ );
my $scriptname = basename($0);
- my $index=0;
foreach my $u (@users) {
my $username = $u->key();
my $first = $u->prop('FirstName');
my $last = $u->prop('LastName');
- my $action1 = "$modify";
+ my $action1 = "" .
+ $self->localise('MODIFY') . "";
+ my $action2 = "" .
+ $self->localise('AUDIT') . "";
print $q->Tr(esmith::cgi::genSmallCell($q, $username,"normal")," ",
esmith::cgi::genSmallCell($q, "$first $last","normal")," ",
- esmith::cgi::genSmallCell($q, "$action1","normal"));
+ esmith::cgi::genSmallCell($q, "$action1","normal")," ",
+ esmith::cgi::genSmallCell($q, "$action2","normal"));
}
print qq( |
\n);
@@ -93,6 +97,69 @@ sub print_user_table {
return "";
}
+sub print_section_bar{
+ my $self = shift;
+ print " \n \n";
+ print " \n";
+ return undef;
+}
+
+sub get_shares {
+ my ($self, $mode) = @_;
+ my $q = $self->{cgi};
+
+ my $user = $q->param('acctName');
+
+ my @read;
+ my @write;
+
+ # Loop through all the ibays to check which ones are accessible
+ foreach my $ibay ($accountdb->ibays){
+ my $name = $ibay->key;
+ my $desc = $ibay->prop('Name');
+ my $group = $ibay->prop('Group');
+ next unless $accountdb->is_user_in_group($user, $group);
+ my $perm = $ibay->prop('UserAccess');
+ if ($perm eq 'wr-admin-rd-group'){
+ push @read, $name . " ($desc)";
+ }
+ else{
+ push @write, $name . " ($desc)";
+ }
+ }
+ # Now check shared folders
+ foreach my $share ($accountdb->get_all_by_prop(type=>'share')){
+ my $name = $share->key;
+ my $desc = $share->prop('Name');
+ foreach my $group (split /[;,]/, ($share->prop('ReadGroups') || '')){
+ push @read, $name . " ($desc)" if $accountdb->is_user_in_group($user, $group);
+ }
+ foreach my $u (split /[;,]/, ($share->prop('ReadUsers') || '')){
+ push @read, $name . " ($desc)" if $user eq $u;
+ }
+ foreach my $group (split /[;,]/, ($share->prop('WriteGroups') || '')){
+ push @write, $name . " ($desc)" if $accountdb->is_user_in_group($user, $group);
+ }
+ foreach my $u (split /[;,]/, ($share->prop('WriteUsers') || '')){
+ push @write, $name . " ($desc)" if $user eq $u;
+ }
+ }
+ @write = uniq @write;
+ @read = uniq @read;
+ my @tmp = ();
+ foreach my $r (@read){
+ push @tmp, $r unless grep { $r eq $_ } @write;
+ }
+ @read = @tmp;
+ my @res = ($mode eq 'write') ? @write : @read;
+ return join " ", @res;
+}
+
+sub get_name {
+ my ($self) = @_;
+ return get_ldap_value($self, 'FirstName') . " " . get_ldap_value($self, 'LastName');
+}
+
sub get_ldap_value {
my ($self, $field) = @_;
@@ -105,8 +172,6 @@ sub print_save_button {
my ($self) = @_;
- my $cgi = $self->{cgi};
-
$self->print_button("SAVE");
}
|