fixed SCRIPT_NAME with a session variable from $r->uri
This commit is contained in:
parent
dc66860d6f
commit
5ee8369c5e
9 changed files with 26 additions and 25 deletions
|
|
@ -50,6 +50,7 @@ sub handler {
|
|||
|
||||
sub contentHandler {
|
||||
WebGUI::Session::open($s->dir_config('WebguiRoot'),$r->dir_config('WebguiConfig'),$r);
|
||||
$session{wguri} = $r->uri;
|
||||
$r->print(page(undef,undef,1)); # Use existing session
|
||||
WebGUI::Session::close();
|
||||
return Apache2::Const::OK;
|
||||
|
|
@ -133,7 +134,7 @@ sub page {
|
|||
$method = "www_".$method;
|
||||
$output = eval{$asset->$method()};
|
||||
if ($@) {
|
||||
WebGUI::ErrorHandler::warn("Couldn't call method ".$method." on asset for ".$session{env}{PATH_INFO}." Root cause: ".$@);
|
||||
WebGUI::ErrorHandler::warn("Couldn't call method ".$method." on asset for ".$session{wguri}()." Root cause: ".$@);
|
||||
$output = $asset->www_view;
|
||||
} else {
|
||||
if ($output eq "" && $method ne "view") {
|
||||
|
|
|
|||
|
|
@ -1083,7 +1083,7 @@ A specific revision to instanciate. By default we instanciate the newest publish
|
|||
|
||||
sub newByUrl {
|
||||
my $class = shift;
|
||||
my $url = shift || $session{env}{SCRIPT_NAME};
|
||||
my $url = shift || $session{wguri};
|
||||
my $revisionDate = shift;
|
||||
$url = lc($url);
|
||||
$url =~ s/\/$//;
|
||||
|
|
|
|||
|
|
@ -666,7 +666,7 @@ sub view {
|
|||
} else {
|
||||
$sql .= "asset.lineage";
|
||||
}
|
||||
my $currentPageUrl = $session{env}{SCRIPT_NAME};
|
||||
my $currentPageUrl = $session{wguri};
|
||||
$currentPageUrl =~ s/^\///;
|
||||
$p->setDataByQuery($sql, undef, undef, undef, "url", $currentPageUrl);
|
||||
foreach my $dataSet (@{$p->getPageData()}) {
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ sub displayLogin {
|
|||
my $method = $_[0] || "login";
|
||||
my $vars = $_[1];
|
||||
unless ($session{form}{op} eq "auth") {
|
||||
WebGUI::Session::setScratch("redirectAfterLogin",WebGUI::URL::gateway($session{env}{SCRIPT_NAME},$session{env}{QUERY_STRING}));
|
||||
WebGUI::Session::setScratch("redirectAfterLogin",WebGUI::URL::gateway($session{wguri},$session{env}{QUERY_STRING}));
|
||||
}
|
||||
$vars->{title} = WebGUI::International::get(66);
|
||||
my $action;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub copyIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'copy.gif" align="middle" border="0" alt="'.WebGUI::International::get('Copy','Icon').'" title="'.WebGUI::International::get('Copy','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
@ -125,7 +125,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub cutIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'cut.gif" align="middle" border="0" alt="'.WebGUI::International::get('Cut','Icon').'" title="'.WebGUI::International::get('Cut','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
@ -158,7 +158,7 @@ sub deleteIcon {
|
|||
$confirmText = qq| onclick="return confirm('$confirmText')" |;
|
||||
}
|
||||
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'" '.$confirmText.'>';
|
||||
$output .= '<img src="'._getBaseURL().'delete.gif" align="middle" border="0" alt="'.WebGUI::International::get('Delete','Icon').'" title="'.WebGUI::International::get('Delete','Icon').'" /></a>';
|
||||
|
|
@ -195,7 +195,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub editIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'edit.gif" align="middle" border="0" alt="'.WebGUI::International::get('Edit','Icon').'" title="'.WebGUI::International::get('Edit','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
@ -219,7 +219,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub exportIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
# TODO Change icon to Jeffs export icon
|
||||
$output .= '<img src="'._getBaseURL().'export.gif" align="middle" border="0" alt="'.WebGUI::International::get('Export','Icon').'" title="'.WebGUI::International::get('Export','Icon').'" /></a>';
|
||||
|
|
@ -292,7 +292,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub lockedIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'locked.gif" align="middle" border="0" alt="'.WebGUI::International::get('locked','Icon').'" title="'.WebGUI::International::get('locked','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
@ -316,7 +316,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub manageIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'manage.gif" align="middle" border="0" alt="'.WebGUI::International::get('Manage','Icon').'" title="'.WebGUI::International::get('Manage','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
@ -340,7 +340,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub moveBottomIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'moveBottom.gif" align="middle" border="0" alt="'.WebGUI::International::get('Move To Bottom','Icon').'" title="'.WebGUI::International::get('Move To Bottom','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
@ -364,7 +364,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub moveDownIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'moveDown.gif" align="middle" border="0" alt="'.WebGUI::International::get('Move Down','Icon').'" title="'.WebGUI::International::get('Move Down','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
@ -388,7 +388,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub moveLeftIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'moveLeft.gif" align="middle" border="0" alt="'.WebGUI::International::get('Move Left','Icon').'" title="'.WebGUI::International::get('Move Left','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
@ -412,7 +412,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub moveRightIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'moveRight.gif" align="middle" border="0" alt="'.WebGUI::International::get('Move Right','Icon').'" title="'.WebGUI::International::get('Move Right','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
@ -436,7 +436,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub moveTopIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'moveTop.gif" align="middle" border="0" alt="'.WebGUI::International::get('Move To Top','Icon').'" title="'.WebGUI::International::get('Move To Top','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
@ -460,7 +460,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub moveUpIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'moveUp.gif" align="middle" border="0" alt="'.WebGUI::International::get('Move Up','Icon').'" title="'.WebGUI::International::get('Move Up','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
@ -496,7 +496,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub pasteIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'paste.gif" align="middle" border="0" alt="'.WebGUI::International::get('Paste','Icon').'" title="'.WebGUI::International::get('Paste','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
@ -520,7 +520,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub shortcutIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'shortcut.gif" align="middle" border="0" alt="'.WebGUI::International::get('Create Shortcut','Icon').'" title="'.WebGUI::International::get('Create Shortcut','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
@ -544,7 +544,7 @@ The URL to any page. Defaults to the current page.
|
|||
|
||||
sub viewIcon {
|
||||
my ($output, $pageURL);
|
||||
$pageURL = $_[1] || $session{env}{SCRIPT_NAME};
|
||||
$pageURL = $_[1] || $session{wguri};
|
||||
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
|
||||
$output .= '<img src="'._getBaseURL().'view.gif" align="middle" border="0" alt="'.WebGUI::International::get('View','Icon').'" title="'.WebGUI::International::get('View','Icon').'" /></a>';
|
||||
return $output;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use WebGUI::URL;
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $pathinfo = $session{env}{SCRIPT_NAME};
|
||||
my $pathinfo = $session{wguri};
|
||||
$pathinfo =~ s#^/##;
|
||||
return WebGUI::URL::getScriptURL().$pathinfo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ sub process {
|
|||
if ($session{env}{REQUEST_URI} =~ /op\=/) {
|
||||
$append = 'op2='.WebGUI::URL::escape($append);
|
||||
}
|
||||
$temp = WebGUI::URL::gateway($session{env}{SCRIPT_NAME},$append);
|
||||
$temp = WebGUI::URL::gateway($session{wguri},$append);
|
||||
$temp =~ s/\/\//\//;
|
||||
$temp = WebGUI::URL::append($temp,$session{env}{QUERY_STRING});
|
||||
if ($param[1] ne "") {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ sub www_setup {
|
|||
WebGUI::Setting::set('companyURL',WebGUI::FormProcessor::url("companyURL"));
|
||||
WebGUI::Setting::set('companyEmail',WebGUI::FormProcessor::email("companyEmail"));
|
||||
WebGUI::Setting::remove('specialState');
|
||||
WebGUI::HTTP::setRedirect($session{env}{SCRIPT_NAME});
|
||||
WebGUI::HTTP::setRedirect($session{wguri});
|
||||
return "";
|
||||
} else {
|
||||
$output .= '<legend align="left">Admin Account</legend>';
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ sub getScriptURL {
|
|||
if (exists $session{config}{scripturl}) {
|
||||
$scripturl = $session{config}{scripturl};
|
||||
} else {
|
||||
$scripturl = $session{env}{SCRIPT_NAME};
|
||||
$scripturl = $session{wguri};
|
||||
}
|
||||
$scripturl .= '/';
|
||||
return $scripturl;
|
||||
|
|
@ -267,7 +267,7 @@ sub page {
|
|||
if ($session{asset}) {
|
||||
$pathinfo = $session{asset}->get("url");
|
||||
} else {
|
||||
$pathinfo = $session{env}{SCRIPT_NAME};
|
||||
$pathinfo = $session{wguri};
|
||||
$pathinfo =~ s/^\/(.*)/$1/;
|
||||
}
|
||||
$url .= $pathinfo;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue