Add returnUrl to to process mutation template.
This commit is contained in:
parent
fdd2542fb2
commit
6c0e8b8e47
2 changed files with 22 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ use Carp;
|
||||||
use WebGUI::Asset::Template;
|
use WebGUI::Asset::Template;
|
||||||
use WebGUI::Macro;
|
use WebGUI::Macro;
|
||||||
use Tie::IxHash;
|
use Tie::IxHash;
|
||||||
|
use URI;
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
sub definition {
|
sub definition {
|
||||||
|
|
@ -226,6 +227,21 @@ sub getSubscriptionGroup {
|
||||||
return $group;
|
return $group;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
sub getReturnUrl {
|
||||||
|
my $self = shift;
|
||||||
|
my $referer = $self->session->env->get('HTTP_REFERER');
|
||||||
|
|
||||||
|
return unless $referer;
|
||||||
|
|
||||||
|
# Get path and strip leading and trailing slash if it exists.
|
||||||
|
my ( $path ) = URI->new( $referer )->path =~ m{ ^/ (.*?) /?$ }xms;
|
||||||
|
|
||||||
|
return $referer if WebGUI::Asset->urlExists( $self->session, $path );
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
sub getEmailVars {
|
sub getEmailVars {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
@ -498,7 +514,12 @@ sub www_processSubscription {
|
||||||
return $self->processStyle( $i18n->get( 'anonnymous not allowed' ) );
|
return $self->processStyle( $i18n->get( 'anonnymous not allowed' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return $self->processStyle( $self->processTemplate( {}, $self->get('confirmationRequiredTemplateId') ) );
|
my $var = {
|
||||||
|
assetUrl => $self->getUrl,
|
||||||
|
returnUrl => $self->getReturnUrl,
|
||||||
|
};
|
||||||
|
|
||||||
|
return $self->processStyle( $self->processTemplate( $var, $self->get('confirmationRequiredTemplateId') ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue