From a4fb637c441cad75350edcbbb2520f7a303b33c2 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 29 Sep 2012 21:17:15 +0200 Subject: Grant the right to create aliases and/or lists. --- lib/Fripost/Panel/Interface.pm | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'lib/Fripost/Panel/Interface.pm') 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<< >> -- cgit v1.2.3