diff options
author | Guilhem Moulin <guilhem.moulin@fripost.org> | 2013-01-19 02:22:17 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@fripost.org> | 2013-01-19 02:22:17 +0100 |
commit | f7701a60f217ab154fe53a5d13bbd223f6182150 (patch) | |
tree | 8334d13eb9a7e58065be7db608718bad605fd07c /lib | |
parent | 145a6fc76882769391e1e9792db868b692bc4538 (diff) |
CanCreate → CanAdd
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Fripost/Panel/Interface.pm | 16 | ||||
-rw-r--r-- | lib/Fripost/Schema/Domain.pm | 30 | ||||
-rw-r--r-- | lib/Fripost/Schema/Util.pm | 4 |
3 files changed, 25 insertions, 25 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'); |