- Added a wiki-like feature that will automatically bring a user to the

create a page form if they are in admin mode, and click on a link to
   a page that doesn't exist yet.
This commit is contained in:
JT Smith 2006-03-25 21:39:15 +00:00
parent 9ddea59a79
commit 29bd26a975
4 changed files with 47 additions and 11 deletions

View file

@ -155,6 +155,29 @@ sub gateway {
return $url;
}
#-------------------------------------------------------------------
=head2 getRefererUrl ( )
Returns the URL of the page this request was refered from (no gateway, no query params, just the page url). Returns undef if there was no referer.
=cut
sub getRefererUrl {
my $self = shift;
my $referer = $self->session->env->get("HTTP_REFERER");
return undef unless ($referer);
my $url = $referer;
my $gateway = $self->session->config->get("gateway");
$url =~ s/htt\w+\:\/\/[A-Za-z0-9\.\-]+$gateway\/*(\S*)/$1/;;
if ($url eq $referer) {
return undef;
} else {
return $url;
}
}
#-------------------------------------------------------------------
=head2 getRequestedUrl ( )