From f7701a60f217ab154fe53a5d13bbd223f6182150 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 19 Jan 2013 02:22:17 +0100 Subject: =?UTF-8?q?CanCreate=20=E2=86=92=20CanAdd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Fripost/Panel/Interface.pm | 16 ++++++++-------- lib/Fripost/Schema/Domain.pm | 30 +++++++++++++++--------------- lib/Fripost/Schema/Util.pm | 4 ++-- templates/edit-domain.html | 8 ++++---- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/Fripost/Panel/Interface.pm b/lib/Fripost/Panel/Interface.pm index c7e892c..d04fa3a 100644 --- a/lib/Fripost/Panel/Interface.pm +++ b/lib/Fripost/Panel/Interface.pm @@ -108,7 +108,7 @@ sub ListLocals : Runmode { # Can the user add aliases? $template->param( canAddalias => $domain{permissions} =~ /[aop]/ ); $template->param( listCanAddAlias => [ map { {user => encode_entities($_)} } - @{$domain{canCreateAlias}} ] ) + @{$domain{canAddAlias}} ] ) if $domain{permissions} =~ /[op]/; # Should we list aliases? $template->param( listAliases => $#aliases >= 0 || @@ -130,7 +130,7 @@ sub ListLocals : Runmode { # Can the user add lists? $template->param( canAddList => $domain{permissions} =~ /[lop]/ ); $template->param( listCanAddList => [ map { {user => encode_entities($_)} } - @{$domain{canCreateList}} ] ) + @{$domain{canAddList}} ] ) if $domain{permissions} =~ /[op]/; # Should we list lists? $template->param( listLists => $#lists >= 0 || $domain{permissions} =~ /[lop]/ ); @@ -172,8 +172,8 @@ sub EditDomain : Runmode { isactive => $q->param('isactive'), description => $q->param('description'), catchalls => $q->param('catchalls'), - canCreateAlias => $q->param('canCreateAlias'), - canCreateList => $q->param('canCreateList') + canAddAlias => $q->param('canAddAlias'), + canAddList => $q->param('canAddList') }, -concat => "(\n|\x{0D}\x{0A})"); } my %domain = $fp->domain->get( $d, -die => 404 ); @@ -189,16 +189,16 @@ sub EditDomain : Runmode { $template->param( isactive => $q->param('isactive') , description => $q->param('description') , catchalls => $q->param('catchalls') - , canCreateAlias => $q->param('canCreateAlias') - , canCreateList => $q->param('canCreateList') + , canAddAlias => $q->param('canAddAlias') + , canAddList => $q->param('canAddList') , error => encode_entities ($error) ); } else { $template->param( isactive => $domain{isactive} , description => &mkFormContent (@{$domain{description}}) , catchalls => &mkFormContentE (@{$domain{catchalls}}) - , canCreateAlias => &mkFormContentE (@{$domain{canCreateAlias}}) - , canCreateList => &mkFormContentE (@{$domain{canCreateList}}) + , canAddAlias => &mkFormContentE (@{$domain{canAddAlias}}) + , canAddList => &mkFormContentE (@{$domain{canAddList}}) ); } $template->param( newChanges => defined $q->param('submit') ); diff --git a/lib/Fripost/Schema/Domain.pm b/lib/Fripost/Schema/Domain.pm index dc16ae0..e86822f 100644 --- a/lib/Fripost/Schema/Domain.pm +++ b/lib/Fripost/Schema/Domain.pm @@ -79,8 +79,8 @@ sub get { attrs => [ qw/fvd description fripostIsStatusActive fripostOptionalMaildrop - fripostCanCreateAlias - fripostCanCreateList + fripostCanAddAlias + fripostCanAddList fripostOwner fripostPostmaster/ ] ); @@ -103,10 +103,10 @@ sub get { , catchalls => concat($concat, map { &_email_to_unicode ($_) } $domain->get_value('fripostOptionalMaildrop')) , permissions => get_perms($domain, $self->whoami) - , canCreateAlias => concat($concat, map { &_email_to_unicode ($self->_dn2fvu($_)) } - $domain->get_value('fripostCanCreateAlias')) - , canCreateList => concat($concat, map { &_email_to_unicode ($self->_dn2fvu($_)) } - $domain->get_value('fripostCanCreateList')) + , canAddAlias => concat($concat, map { &_email_to_unicode ($self->_dn2fvu($_)) } + $domain->get_value('fripostCanAddAlias')) + , canAddList => concat($concat, map { &_email_to_unicode ($self->_dn2fvu($_)) } + $domain->get_value('fripostCanAddList')) ) } @@ -122,7 +122,7 @@ sub replace { my $d = shift; my %options = @_; - foreach (qw/description catchalls canCreateAlias canCreateList/) { + foreach (qw/description catchalls canAddAlias canAddList/) { $d->{$_} = explode ($options{'-concat'}, $d->{$_}) if defined $d->{$_}; } @@ -135,12 +135,12 @@ sub replace { 'TRUE' : 'FALSE' , description => $d->{description} , fripostOptionalMaildrop => $d->{catchalls} - , fripostCanCreateAlias => + , fripostCanAddAlias => [ map $self->_fvu2dn($_), - @{$d->{canCreateAlias}} ] - , fripostCanCreateList => + @{$d->{canAddAlias}} ] + , fripostCanAddList => [ map $self->_fvu2dn($_), - @{$d->{canCreateList}} ] + @{$d->{canAddList}} ] } ); die $mesg->error."\n" if $mesg->code; }; @@ -175,10 +175,10 @@ sub _is_valid { -exact => 1 ); $d->{catchalls} = [ map { email_valid($_, -prefix => 'fake') } @{$d->{catchalls}} ]; - $d->{canCreateAlias} = [ map { email_valid($_, -prefix => 'fake') } - @{$d->{canCreateAlias}} ]; - $d->{canCreateList} = [ map { email_valid($_, -prefix => 'fake') } - @{$d->{canCreateList}} ]; + $d->{canAddAlias} = [ map { email_valid($_, -prefix => 'fake') } + @{$d->{canAddAlias}} ]; + $d->{canAddList} = [ map { email_valid($_, -prefix => 'fake') } + @{$d->{canAddList}} ]; } diff --git a/lib/Fripost/Schema/Util.pm b/lib/Fripost/Schema/Util.pm index 8d75a3a..b26214b 100644 --- a/lib/Fripost/Schema/Util.pm +++ b/lib/Fripost/Schema/Util.pm @@ -67,11 +67,11 @@ sub get_perms { $perms .= 'a' if grep { $dn eq $_ or $dn2 eq $_ } - $entry->get_value ('fripostCanCreateAlias'); + $entry->get_value ('fripostCanAddAlias'); $perms .= 'l' if grep { $dn eq $_ or $dn2 eq $_ } - $entry->get_value ('fripostCanCreateList'); + $entry->get_value ('fripostCanAddList'); $perms = 'o' if grep { $dn eq $_ } $entry->get_value('fripostOwner'); diff --git a/templates/edit-domain.html b/templates/edit-domain.html index dbbdf3c..c814a20 100644 --- a/templates/edit-domain.html +++ b/templates/edit-domain.html @@ -73,8 +73,8 @@
-

Grant right to create aliases

- +

Grant right to create aliases

+
An optional list of e-mails (one address per line) that are allowed to create aliases under your domain @@ -91,8 +91,8 @@
-

Grant right to create lists

- +

Grant right to create lists

+
An optional list of e-mails (one address per line) that are allowed to create mailing lists under your domain -- cgit v1.2.3