From a1f02c6dd593f9e31127025e30d551df4b4cfc83 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 26 Jan 2013 03:39:18 +0100 Subject: wibble --- lib/Fripost/Panel/Interface.pm | 13 +++++-------- lib/Fripost/Panel/Login.pm | 2 +- lib/Fripost/Schema/Domain.pm | 9 +++++---- 3 files changed, 11 insertions(+), 13 deletions(-) (limited to 'lib') diff --git a/lib/Fripost/Panel/Interface.pm b/lib/Fripost/Panel/Interface.pm index bb77ad6..79b77aa 100644 --- a/lib/Fripost/Panel/Interface.pm +++ b/lib/Fripost/Panel/Interface.pm @@ -71,7 +71,7 @@ sub AddDomain : Runmode { Encode::_utf8_on($domainname) if defined $domainname; my $session_param; - $session_param = 'AddDomain-owner-emails-' . domain_to_ascii($domainname) + $session_param = 'AddDomain-owner-emails-'.domain_to_ascii($domainname) if defined $domainname; my $error; # Tells whether the change submission has failed. @@ -81,7 +81,7 @@ sub AddDomain : Runmode { if (defined $q->param('owner') and defined $session_param) { # Ensure that the user didn't spoof the domain ownership. - my @owners = split /\0/, $self->session->param($session_param); + my @owners = split "\0", $self->session->param($session_param); $error = "‘".$q->param('owner')."’ was not listed among the domain owners." unless defined $self->session->param($session_param) and grep { $q->param('owner') eq $_ } @owners; @@ -117,7 +117,7 @@ sub AddDomain : Runmode { , loop_context_vars => 1 ); $template->param( $self->userInfo ); $template->param( error => encode_entities ($error) ) if $error; - $template->param( &parse_CGI_query ($q) ); + $template->param( &fill_HTML_template_from_query ($q) ); if (@owners) { # Store the list we font, to ensure the user doesn't send back a @@ -587,13 +587,10 @@ sub fill_HTML_template_from_query { my %rest = @_; my %vars; - my @ok = qw/name isActive description catchAlls - canAddAlias canAddList owner postmaster/; - $params{$_} = encode_entities ($rest{$_}) for keys %rest; foreach my $key (keys %params) { $vars{$key} = $params{$key} // undef - if grep { $key eq $_ } (@single_valued_keys, @multi_valued_keys); + if grep { $key eq $_ } ('name', @single_valued_keys, @multi_valued_keys); } $vars{isActive} //= 1; return %vars; @@ -614,7 +611,7 @@ sub parse_CGI_query { } elsif (grep {$key eq $_} @multi_valued_keys) { $entry->{$key} = $params{$key} ? - [ split /\x{0D}\x{0A}/, $params{$key} ] : + [ split "\x{0D}\x{0A}", $params{$key} ] : []; $entry->{$key} = [ grep {$_} @{$entry->{$key}} ]; } diff --git a/lib/Fripost/Panel/Login.pm b/lib/Fripost/Panel/Login.pm index 09520a4..af40461 100644 --- a/lib/Fripost/Panel/Login.pm +++ b/lib/Fripost/Panel/Login.pm @@ -228,7 +228,7 @@ sub split_path { $uri =~ s/^$script//s; # Strip the facing CGI script name $uri =~ s/\?.*//s; # Strip the query - map { decodeURIComponent($_); Encode::_utf8_on($_); $_ } (split /\//, $uri); + map { decodeURIComponent($_); Encode::_utf8_on($_); $_ } (split '/', $uri); } diff --git a/lib/Fripost/Schema/Domain.pm b/lib/Fripost/Schema/Domain.pm index 738df0c..e8da9a5 100644 --- a/lib/Fripost/Schema/Domain.pm +++ b/lib/Fripost/Schema/Domain.pm @@ -443,9 +443,10 @@ sub list_owner_emails { =item B (I, I) -Add the domain I, represented by a hash reference as explained -above. If no owner is specified in I, the current user is -automatically promoted owner instead. +Add I, represented by a hash reference as explained above. If no +owner is specified in I, the current user is automatically +promoted owner. (If you you want to add a non self-managed domain, +choose an empty string for the owner.) The following options are considered: @@ -604,7 +605,7 @@ sub _domain_to_entry { =item B (I, I, I) -Unlock the pending domain I, locked with I. +Unlock the pending I, locked with I. Errors can be caught with options B<-die> and B<-error>, see B for details. -- cgit v1.2.3