- Fixed a macro processing problem on the Redirect asset.

- Added a log info entry when a redirect occurs.
This commit is contained in:
JT Smith 2006-06-13 00:55:35 +00:00
parent e6aafa2f7f
commit af84fb43af
3 changed files with 8 additions and 4 deletions

View file

@ -38,6 +38,9 @@
- fix: Can not make Shortcut for CollaborationSystem
- fix: EMS Transactions Dropping Free Events
- fix: EMS Prerequisite Cache Stale
- Fixed a macro processing problem on the Redirect asset.
- Added a log info entry when a redirect occurs.
6.99.3
- Someone removed the status from the submission templates. That has been

View file

@ -101,17 +101,17 @@ sub www_view {
my $self = shift;
return $self->session->privilege->noAccess() unless $self->canView;
my $i18n = WebGUI::International->new($self->session, "Asset_Redirect");
my $url = $self->get("redirectUrl");
WebGUI::Macro::process($self->session, \$url);
if ($self->session->var->isAdminOn() && $self->canEdit) {
return $self->getAdminConsole->render($i18n->get("what do you want to do with this redirect").'
<ul>
<li><a href="'.$self->get("redirectUrl").'">'.$i18n->get("go to the redirect url").'</a></li>
<li><a href="'.$url.'">'.$i18n->get("go to the redirect url").'</a></li>
<li><a href="'.$self->getUrl("func=edit").'">'.$i18n->get("edit the redirect properties").'</a></li>
<li><a href="'.$self->getParent->getUrl.'">'.$i18n->get("go to the redirect parent page").'</a></li>
</ul>',$i18n->get("assetName"));
}
my $url = $self->get("redirectUrl");
WebGUI::Macro::process(\$url);
$self->session->http->setRedirect($url) unless $self->get("redirectUrl") eq $self->get("url");
$self->session->http->setRedirect($url) unless $url eq $self->get("url");
return $i18n->get('self_referential');
}

View file

@ -367,6 +367,7 @@ sub setRedirect {
my $url = shift;
my @params = $self->session->form->param;
return undef if ($url eq $self->session->url->page() && scalar(@params) < 1); # prevent redirecting to self
$self->session->errorHandler->info("Redirecting to $url");
$self->{_http}{location} = $url;
$self->setStatus("302", "Redirect");
$self->session->style->setMeta({"http-equiv"=>"refresh",content=>"0; URL=".$url});