diff options
Diffstat (limited to 'lib/Fripost/Panel/Interface.pm')
-rw-r--r-- | lib/Fripost/Panel/Interface.pm | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/Fripost/Panel/Interface.pm b/lib/Fripost/Panel/Interface.pm index 02f3f4b..18b9a48 100644 --- a/lib/Fripost/Panel/Interface.pm +++ b/lib/Fripost/Panel/Interface.pm @@ -14,6 +14,7 @@ Interface.pm - use parent 'Fripost::Panel::Login'; use Fripost::Schema; +use Fripost::Schema::Misc 'split_addr'; use Fripost::Password; use HTML::Entities 'encode_entities'; use URI::Escape::XS 'encodeURIComponent'; @@ -37,7 +38,7 @@ sub ListDomains : StartRunmode { my $self = shift; my %CFG = $self->cfg; - my ($ul,$ud) = split /\@/, email_to_unicode($self->authen->username), 2; + my ($ul,$ud) = split_addr( $self->authen->username, -encoding => 'unicode' ); my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG ); my @domains = $fp->domain->search( -concat => "\n", -die => 403); @@ -61,7 +62,7 @@ sub ListLocals : Runmode { my $self = shift; my %CFG = $self->cfg; - my ($ul,$ud) = split /\@/, email_to_unicode($self->authen->username), 2; + my ($ul,$ud) = split_addr( $self->authen->username, -encoding => 'unicode' ); my $d = ($self->split_path)[1]; my $fp = Fripost::Schema::->SASLauth( $self->authen->username, %CFG ); @@ -155,7 +156,7 @@ sub EditDomain : Runmode { my $self = shift; my %CFG = $self->cfg; - my ($ul,$ud) = split /\@/, email_to_unicode($self->authen->username), 2; + my ($ul,$ud) = split_addr( $self->authen->username, -encoding => 'unicode' ); my $d = ($self->split_path)[1]; my $q = $self->query; @@ -457,11 +458,13 @@ sub mkLink { sub userInfo { my $self = shift; - my ($l,$d) = split /\@/, email_to_unicode($self->authen->username), 2; + my ($l,$d) = split_addr( $self->authen->username, -encoding => 'unicode' ); + my $root = $ENV{SCRIPT_NAME} // $self->cfg->{'cgi-bin'} // ''; + $root =~ s@/$@@s; ( user_localpart => encode_entities($l) , user_domainpart => encode_entities($d) - , userURI => &mkURL ($ENV{SCRIPT_NAME}, $d, $l) + , userURI => &mkURL ($root, $d, $l) ) } @@ -479,7 +482,7 @@ Guilhem Moulin C<< <guilhem at fripost.org> >> =head1 COPYRIGHT -Copyright 2012 Guilhem Moulin. +Copyright 2012,2013 Guilhem Moulin. =head1 LICENSE |