aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Fripost/Panel
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@fripost.org>2012-09-29 21:17:15 +0200
committerGuilhem Moulin <guilhem.moulin@fripost.org>2012-09-29 21:17:15 +0200
commita4fb637c441cad75350edcbbb2520f7a303b33c2 (patch)
tree7761e4104a6c3cb64b0930293bc2a748e0c52c11 /lib/Fripost/Panel
parent58825808fb1fd2d9950e8f7a81ad62db18be4aa7 (diff)
Grant the right to create aliases and/or lists.
Diffstat (limited to 'lib/Fripost/Panel')
-rw-r--r--lib/Fripost/Panel/Interface.pm27
1 files changed, 20 insertions, 7 deletions
diff --git a/lib/Fripost/Panel/Interface.pm b/lib/Fripost/Panel/Interface.pm
index f102a21..ff9b291 100644
--- a/lib/Fripost/Panel/Interface.pm
+++ b/lib/Fripost/Panel/Interface.pm
@@ -167,7 +167,9 @@ sub EditDomain : Runmode {
domain => $d,
isactive => $q->param('isactive'),
description => $q->param('description'),
- catchalls => $q->param('catchalls')
+ catchalls => $q->param('catchalls'),
+ canCreateAlias => $q->param('canCreateAlias'),
+ canCreateList => $q->param('canCreateList')
}, -concat => "(\n|\x{0D}\x{0A})");
}
my %domain = $fp->domain->get( $d, -die => 404 );
@@ -177,21 +179,24 @@ sub EditDomain : Runmode {
, loop_context_vars => 1
, global_vars => 1 );
$template->param( $self->userInfo );
- $template->param( domain => encode_entities($d) );
+ $template->param( domain => encode_entities($d)
+ , isPostmaster => $domain{permissions} eq 'p');
if ($error) {
# Preserve the (incorrect) form
$template->param( isactive => $q->param('isactive')
, description => $q->param('description')
, catchalls => $q->param('catchalls')
+ , canCreateAlias => $q->param('canCreateAlias')
+ , canCreateList => $q->param('canCreateList')
, error => encode_entities ($error) );
}
else {
$template->param( isactive => $domain{isactive}
- , description => join ("\x{0D}\x{0A}",
- @{$domain{description}})
- , catchalls => join ("\x{0D}\x{0A}",
- map { encode_entities ($_) }
- @{$domain{catchalls}}) );
+ , description => &mkFormContent (@{$domain{description}})
+ , catchalls => &mkFormContentE (@{$domain{catchalls}})
+ , canCreateAlias => &mkFormContentE (@{$domain{canCreateAlias}})
+ , canCreateList => &mkFormContentE (@{$domain{canCreateList}})
+ );
}
$template->param( newChanges => defined $q->param('submit') );
return $template->output;
@@ -458,6 +463,14 @@ sub userInfo {
)
}
+sub mkFormContentE {
+ &mkFormContent (map { encode_entities ($_) } @_);
+}
+
+sub mkFormContent {
+ join ("\x{0D}\x{0A}", @_);
+}
+
=head1 AUTHOR
Guilhem Moulin C<< <guilhem at fripost.org> >>