diff --git a/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/userinfo b/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/userinfo index 78d9dcc..9ac1f5a 100644 --- a/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/userinfo +++ b/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/userinfo @@ -12,6 +12,30 @@ Cette page vous permet de modifier certaines informations liées aux utiliseurs. Ces informations seront publiées dans l'annuaire LDAP. + AUDIT + Audit + + + USER_AUDIT + Audit Utilisateur + + + AUDIT_DESC + Cette page permet d'obtenir la liste des partages auxquels l'utilisateur a accès + + + USER_LOGIN + Identifiant + + + SHARE_READ + Accès en lecture + + + SHARE_WRITE + Accès en écriture + + USER_MODIFIED Utilisateur modifié avec succès diff --git a/root/etc/e-smith/web/functions/userinfo b/root/etc/e-smith/web/functions/userinfo index 7519761..7510750 100644 --- a/root/etc/e-smith/web/functions/userinfo +++ b/root/etc/e-smith/web/functions/userinfo @@ -7,7 +7,7 @@ # navigation : 2000 2100 #---------------------------------------------------------------------- #---------------------------------------------------------------------- -# copyright (C) 2011 Firewall-Services +# Copyright (C) 2011-2014 Firewall-Services # daniel@firewall-services.com # # This program is free software; you can redistribute it and/or modify @@ -34,8 +34,6 @@ use esmith::FormMagick::Panel::userinfo; my $fm = esmith::FormMagick::Panel::userinfo->new(); -use CGI; -my $q = new CGI; $fm->display(); __DATA__ @@ -44,6 +42,24 @@ __DATA__ FIRSTPAGE_DESC + + USER_AUDIT + AUDIT_DESC + + + + + + + + + + + + + + + MODIFY_DESC {cgi}; - my $account = $self->localise('ACCOUNT'); - my $acctName = $self->localise('USER_NAME'); - - my $modify = $self->localise('MODIFY'); my @users = $accountdb->get('admin'); push @users, $accountdb->users(); @@ -69,23 +69,27 @@ sub print_user_table { print " \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"); }