From 465f8ed1b317afb1c7aefde04e53118a19be1a18 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 29 Jan 2013 21:44:24 +0100 Subject: Finished the factoring of localpart-related methods. --- lib/Fripost/Panel/Login.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/Fripost/Panel/Login.pm') diff --git a/lib/Fripost/Panel/Login.pm b/lib/Fripost/Panel/Login.pm index 22a870a..3b2846a 100644 --- a/lib/Fripost/Panel/Login.pm +++ b/lib/Fripost/Panel/Login.pm @@ -19,7 +19,6 @@ use CGI::Application::Plugin::Redirect; use CGI::Application::Plugin::ConfigAuto 'cfg'; use Fripost::Schema; -use Fripost::Schema::Util 'split_addr'; use HTML::Entities 'encode_entities'; use URI::Escape::XS 'decodeURIComponent'; @@ -60,8 +59,8 @@ sub cgiapp_init { $CFG{default_realm} // return 0; $u .= '@'.$CFG{default_realm}; } - my $fp = Fripost::Schema::->auth($u, $p, %CFG, -die => 0); - return 0 unless defined $fp; + my $fp = Fripost::Schema::->auth($u, $p, %CFG, -error => undef) + // return 0; $fp->done; return $u; } ], @@ -223,8 +222,8 @@ sub split_path { $script =~ s@/$@@s; # Strip the trailing '/' off the script name my $uri = $self->query->request_uri; - $uri =~ s/^$script//s; # Strip the facing CGI script name - $uri =~ s/\?.*//s; # Strip the query + $uri =~ s/^\Q$script\E\b//s; # Strip the facing CGI script name + $uri =~ s/\?.*//s; # Strip the query map { my $x = decodeURIComponent($_); Encode::_utf8_on($x); $x } (split '/', $uri); -- cgit v1.2.3