From 4091fbbb0b280120407e0625dd49e741e481a528 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 30 Sep 2012 17:27:56 +0200 Subject: wibble --- INSTALL | 2 ++ cgi-bin/index.fcgi | 4 ++++ css/style.css | 4 ++++ lib/Fripost/Panel/Interface.pm | 15 +++++++++------ template/add-alias.html | 4 ++-- template/add-list.html | 2 +- template/add-mailbox.html | 4 ++-- template/edit-alias.html | 4 ++-- template/edit-list.html | 2 +- template/edit-mailbox.html | 4 ++-- template/list-locals.html | 10 ++++++++-- 11 files changed, 37 insertions(+), 18 deletions(-) diff --git a/INSTALL b/INSTALL index 26a1478..e94f248 100644 --- a/INSTALL +++ b/INSTALL @@ -36,6 +36,8 @@ sudo mkdir -p /etc/fripost-panel/ /var/lib/fripost-panel/gnupg sudo chown fpanel:nogroup /var/lib/fripost-panel/gnupg && sudo chmod 0700 -R /var/lib/fripost-panel/ sudo -u fpanel cp ./config.in /etc/fripost-panel/ && sudo chmod 0600 /etc/fripost-panel/config.in sudo chown -R fpanel:www-data /etc/fripost-panel/ +sudo chown -R root:www-data /opt/fripost-panel/ +sudo ln -s /opt/fripost-panel/bin/fripost-panel /usr/local/sbin/ # Edit /etc/fripost-panel/config.in diff --git a/cgi-bin/index.fcgi b/cgi-bin/index.fcgi index 5c73463..7fbe30d 100755 --- a/cgi-bin/index.fcgi +++ b/cgi-bin/index.fcgi @@ -17,10 +17,14 @@ use lib 'lib'; use Fripost::Panel::Interface; use CGI::Carp 'fatalsToBrowser'; +# Make all warnings fatal. +$SIG{__WARN__} = sub { die @_; }; + my $config_dir = '/etc/fripost-panel'; my @config = catfile ('./', 'default.in'); push @config, catfile ($config_dir, 'config.in') if -f catfile ($config_dir, 'config.in'); + while (my $q = CGI::Fast::->new){ my $cgi = Fripost::Panel::Interface::->new( QUERY => $q, diff --git a/css/style.css b/css/style.css index cee3337..493856a 100644 --- a/css/style.css +++ b/css/style.css @@ -125,6 +125,10 @@ table.list thead th { text-align: center; color:#66a3d3 } +.permlist { + font-size: 9pt; +font-weight: normal; +} .none { font-size: 6pt; color: lightgray; diff --git a/lib/Fripost/Panel/Interface.pm b/lib/Fripost/Panel/Interface.pm index ff9b291..4e5b48e 100644 --- a/lib/Fripost/Panel/Interface.pm +++ b/lib/Fripost/Panel/Interface.pm @@ -44,8 +44,7 @@ sub ListDomains : StartRunmode { $fp->done; my $template = $self->load_tmpl( 'list-domains.html', cache => 1, - , loop_context_vars => 1 - , global_vars => 1 ); + , loop_context_vars => 1 ); $template->param( $self->userInfo ); $template->param( domains => [ map { { &mkLink( domain => $_->{domain}) , isactive => $_->{isactive} @@ -79,8 +78,7 @@ sub ListLocals : Runmode { $fp->done; my $template = $self->load_tmpl( 'list-locals.html', cache => 1, - , loop_context_vars => 1 - , global_vars => 1 ); + , loop_context_vars => 1 ); $template->param( $self->userInfo ); $template->param( domain => encode_entities($domain{domain}) @@ -109,6 +107,9 @@ sub ListLocals : Runmode { # Can the user add aliases? $template->param( canAddalias => $domain{permissions} =~ /[aop]/ ); + $template->param( listCanAddAlias => [ map { {user => encode_entities($_)} } + @{$domain{canCreateAlias}} ] ) + if $domain{permissions} =~ /[op]/; # Should we list aliases? $template->param( listAliases => $#aliases >= 0 || $domain{permissions} =~ /[aop]/ ); @@ -128,6 +129,9 @@ sub ListLocals : Runmode { # Can the user add lists? $template->param( canAddList => $domain{permissions} =~ /[lop]/ ); + $template->param( listCanAddList => [ map { {user => encode_entities($_)} } + @{$domain{canCreateList}} ] ) + if $domain{permissions} =~ /[op]/; # Should we list lists? $template->param( listLists => $#lists >= 0 || $domain{permissions} =~ /[lop]/ ); $template->param( lists => [ @@ -176,8 +180,7 @@ sub EditDomain : Runmode { $fp->done; my $template = $self->load_tmpl( 'edit-domain.html', cache => 1, - , loop_context_vars => 1 - , global_vars => 1 ); + , loop_context_vars => 1 ); $template->param( $self->userInfo ); $template->param( domain => encode_entities($d) , isPostmaster => $domain{permissions} eq 'p'); diff --git a/template/add-alias.html b/template/add-alias.html index 43ad960..3283a59 100644 --- a/template/add-alias.html +++ b/template/add-alias.html @@ -53,7 +53,7 @@

Description

- +
An optional description. (HTML tags are allowed.)
@@ -61,7 +61,7 @@

Destination(s)

- +
The list of destinations (one e-mail address per line) that will receive mail for this alias. diff --git a/template/add-list.html b/template/add-list.html index 221d66a..59ca226 100644 --- a/template/add-list.html +++ b/template/add-list.html @@ -73,7 +73,7 @@

Description

- +
An optional description. (HTML tags are allowed.)
diff --git a/template/add-mailbox.html b/template/add-mailbox.html index 64d116f..7fc2239 100644 --- a/template/add-mailbox.html +++ b/template/add-mailbox.html @@ -68,7 +68,7 @@

Description

- +
An optional description. (HTML tags are allowed.)
@@ -76,7 +76,7 @@

Mail forwarding

- +
An optional list of destinations (one e-mail address per line) that will also receive mail delivered to this mailbox. diff --git a/template/edit-alias.html b/template/edit-alias.html index ec8e10c..60a7d2b 100644 --- a/template/edit-alias.html +++ b/template/edit-alias.html @@ -54,7 +54,7 @@

Description

- +
An optional description. (HTML tags are allowed.)
@@ -62,7 +62,7 @@

Destination(s)

- +
The list of destinations (one e-mail address per line) that will receive mail sent to diff --git a/template/edit-list.html b/template/edit-list.html index 357390e..6eeae7c 100644 --- a/template/edit-list.html +++ b/template/edit-list.html @@ -54,7 +54,7 @@

Description

- +
An optional description. (HTML tags are allowed.)
diff --git a/template/edit-mailbox.html b/template/edit-mailbox.html index 98bd2ea..41fcf45 100644 --- a/template/edit-mailbox.html +++ b/template/edit-mailbox.html @@ -81,7 +81,7 @@

Description

- +
An optional description. (HTML tags are allowed.)
@@ -89,7 +89,7 @@

Mail forwarding

- +
An optional list of destinations (one e-mail address per line) that will receive mail for diff --git a/template/list-locals.html b/template/list-locals.html index d87f4c9..afff04a 100644 --- a/template/list-locals.html +++ b/template/list-locals.html @@ -70,7 +70,10 @@

Alias[add]

+ >
They can also create new aliases: + , . @@ -108,7 +111,10 @@

Lists[add]

+ >
They can also create new lists: + , .
-- cgit v1.2.3