small panels cleanup

tags/ipasserelle-base-0.2.65-1
Daniel Berteaud 13 years ago
parent d95669e6e6
commit c2547531f2
  1. 21
      root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userinfo.pm
  2. 4
      root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userpanelViewgroups.pm

@ -62,8 +62,7 @@ sub print_user_table {
my @users = $accountdb->get('admin'); my @users = $accountdb->get('admin');
push @users, $accountdb->users(); push @users, $accountdb->users();
unless ( scalar @users ) unless ( scalar @users ) {
{
print $q->Tr($q->td($self->localise('NO_USER_ACCOUNTS'))); print $q->Tr($q->td($self->localise('NO_USER_ACCOUNTS')));
return ""; return "";
} }
@ -125,8 +124,7 @@ sub modify_user {
my $acct = $accountdb->get($acctName); my $acct = $accountdb->get($acctName);
my $acctType = $acct->prop('type'); my $acctType = $acct->prop('type');
if ($acctType eq "user" || $acctName eq 'admin') if ($acctType eq "user" || $acctName eq 'admin') {
{
$accountdb->remove_user_auto_pseudonyms($acctName); $accountdb->remove_user_auto_pseudonyms($acctName);
my %newProperties = ( my %newProperties = (
'FirstName' => $self->{cgi}->param('FirstName'), 'FirstName' => $self->{cgi}->param('FirstName'),
@ -193,26 +191,21 @@ sub pseudonym_clash {
my $da = $dp->prop('Account') if $dp; my $da = $dp->prop('Account') if $dp;
my $ua = $up->prop('Account') if $up; my $ua = $up->prop('Account') if $up;
if ($dp and $da and $da ne $acctName) if ($dp and $da and $da ne $acctName) {
{ return $self->localise('PSEUDONYM_CLASH', {
return $self->localise('PSEUDONYM_CLASH',
{
acctName => $acctName, acctName => $acctName,
clashName => $da, clashName => $da,
pseudonym => $dp->key pseudonym => $dp->key
}); });
} }
elsif ($up and $ua and $ua ne $acctName) elsif ($up and $ua and $ua ne $acctName) {
{ return $self->localise('PSEUDONYM_CLASH', {
return $self->localise('PSEUDONYM_CLASH',
{
acctName => $acctName, acctName => $acctName,
clashName => $ua, clashName => $ua,
pseudonym => $up->key pseudonym => $up->key
}); });
} }
else else {
{
return "OK"; return "OK";
} }
} }

@ -14,7 +14,6 @@ use Carp;
our @ISA = qw(esmith::FormMagick Exporter); our @ISA = qw(esmith::FormMagick Exporter);
our @EXPORT = qw( our @EXPORT = qw(
show_initial show_initial
genUsers genUsers
get_accounts_prop get_accounts_prop
@ -72,7 +71,7 @@ sub get_description {
=head2 get_group_mail =head2 get_group_mail
Get the mail address for the group named in the CGI argument "GroupName" Get the mail address for the group named in the CGI argument "groupName"
=cut =cut
@ -189,3 +188,4 @@ sub genUsers () {
return $out; return $out;
} }
1;

Loading…
Cancel
Save