diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index e6fcf2bc1..a175ea999 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -175,7 +175,7 @@ sub handle { # A WebGUI::Asset::Template object means we should process it if ( defined $output && blessed $output && $output->isa( 'WebGUI::Asset::Template' ) ) { - $session->http->sendHeader; + $session->response->sendHeader; $session->output->print( $output->process ); return; } @@ -187,7 +187,7 @@ sub handle { # other non-empty output should be used as the response body elsif (defined $output && $output ne "") { # Auto-set the headers - $session->http->sendHeader; + $session->response->sendHeader; # Use contentHandler's return value as the output $session->output->print($output); @@ -195,7 +195,7 @@ sub handle { } # Keep processing for success codes elsif ($session->response->status < 200 || $session->response->status > 299) { - $session->http->sendHeader; + $session->response->sendHeader; return; } } diff --git a/lib/WebGUI/Account.pm b/lib/WebGUI/Account.pm index bcac41a2f..1ddd432fd 100644 --- a/lib/WebGUI/Account.pm +++ b/lib/WebGUI/Account.pm @@ -287,7 +287,7 @@ sub displayContent { return $output if($noStyle); #Wrap the layout in the user style - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); return $session->style->process($output,$self->getStyleTemplateId); } diff --git a/lib/WebGUI/AdminConsole.pm b/lib/WebGUI/AdminConsole.pm index c5ff71049..2f1be5e29 100644 --- a/lib/WebGUI/AdminConsole.pm +++ b/lib/WebGUI/AdminConsole.pm @@ -255,7 +255,7 @@ A string that defaults to _function's title. sub render { my $self = shift; my $session = $self->session; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my %var; $var{"application_loop"} = $self->getAdminFunction; $var{"application.workarea"} = shift; diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 03c728c20..6913785aa 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -653,11 +653,11 @@ sub checkView { my $self = shift; return $self->session->privilege->noAccess() unless $self->canView; my $session = $self->session; - my ($conf, $http) = $self->session->quick(qw(config http)); + my ($conf, $response) = $self->session->quick(qw(config response)); if ($conf->get("sslEnabled") && $self->get("encryptPage") && ! $self->session->request->secure) { # getUrl already changes url to https if 'encryptPage' - $http->setRedirect($self->getUrl); - $http->sendHeader; + $response->setRedirect($self->getUrl); + $response->sendHeader; return "chunked"; } elsif ($session->isAdminOn && $self->get("state") =~ /^trash/) { # show em trash @@ -665,8 +665,8 @@ sub checkView { if ($self->session->form->process('revision')) { $queryFrag .= ";revision=".$self->session->form->process('revision'); } - $http->setRedirect($self->getUrl($queryFrag)); - $http->sendHeader; + $response->setRedirect($self->getUrl($queryFrag)); + $response->sendHeader; return "chunked"; } elsif ($session->isAdminOn && $self->get("state") =~ /^clipboard/) { # show em clipboard @@ -674,8 +674,8 @@ sub checkView { if ($self->session->form->process('revision')) { $queryFrag .= ";revision=".$self->session->form->process('revision'); } - $http->setRedirect($self->getUrl($queryFrag)); - $http->sendHeader; + $response->setRedirect($self->getUrl($queryFrag)); + $response->sendHeader; return "chunked"; } elsif ($self->get("state") ne "published") { # tell em it doesn't exist anymore @@ -949,7 +949,7 @@ sub forkWithStatusPage { proceed => $args->{redirect} || '', } ); - $session->http->setRedirect( $self->getUrl($pairs) ); + $session->response->setRedirect( $self->getUrl($pairs) ); return 'redirect'; } ## end sub forkWithStatusPage @@ -2199,23 +2199,23 @@ sub proceed { return $session->asset->www_manageAssets; } elsif ($proceed eq "viewParent") { - $session->http->setRedirect( $self->getParent->getUrl ); + $session->response->setRedirect( $self->getParent->getUrl ); return "redirect"; } elsif ($proceed eq "editParent") { - $session->http->setRedirect( $self->getParent->getUrl('func=edit') ); + $session->response->setRedirect( $self->getParent->getUrl('func=edit') ); return "redirect"; } elsif ($proceed eq "goBackToPage" && $session->form->process('returnUrl')) { - $session->http->setRedirect($session->form->process("returnUrl")); + $session->response->setRedirect($session->form->process("returnUrl")); return "redirect"; } elsif ($proceed ne "") { - $session->http->setRedirect( $self->getUrl( 'func=' . $proceed ) ); + $session->response->setRedirect( $self->getUrl( 'func=' . $proceed ) ); return "redirect"; } - $session->http->setRedirect( $self->getUrl ); + $session->response->setRedirect( $self->getUrl ); return "redirect"; } @@ -2936,7 +2936,7 @@ sub www_view { # don't allow viewing of the root asset if ($self->getId eq "PBasset000000000000001") { - $self->session->http->setRedirect($self->getDefault($self->session)->getUrl); + $self->session->response->setRedirect($self->getDefault($self->session)->getUrl); return undef; } diff --git a/lib/WebGUI/Asset/Event.pm b/lib/WebGUI/Asset/Event.pm index 2044e3851..3c00ecf78 100644 --- a/lib/WebGUI/Asset/Event.pm +++ b/lib/WebGUI/Asset/Event.pm @@ -2340,7 +2340,7 @@ ENDJS ### Show the processed template - $session->http->sendHeader; + $session->response->sendHeader; my $style = $self->getParent->processStyle($self->getSeparator); my ($head, $foot) = split($self->getSeparator,$style); $self->session->output->print($head, 1); @@ -2376,8 +2376,8 @@ sub www_view { return $self->session->privilege->noAccess() unless $self->canView; my $check = $self->checkView; return $check if (defined $check); - $self->session->http->setCacheControl($self->getParent->visitorCacheTimeout) if ($self->session->user->isVisitor); - $self->session->http->sendHeader; + $self->session->response->setCacheControl($self->getParent->visitorCacheTimeout) if ($self->session->user->isVisitor); + $self->session->response->sendHeader; $self->prepareView; my $style = $self->getParent->processStyle($self->getSeparator); my ($head, $foot) = split($self->getSeparator,$style); diff --git a/lib/WebGUI/Asset/File.pm b/lib/WebGUI/Asset/File.pm index e10b35891..f1b49f8b1 100644 --- a/lib/WebGUI/Asset/File.pm +++ b/lib/WebGUI/Asset/File.pm @@ -619,9 +619,9 @@ sub www_view { return sprintf($i18n->get("file not found"), $self->getUrl()); } - $session->http->setRedirect($self->getFileUrl) unless $session->config->get('enableStreamingUploads'); - $session->http->setStreamedFile($self->getStorageLocation->getPath($self->filename)); - $session->http->sendHeader; + $session->response->setRedirect($self->getFileUrl) unless $session->config->get('enableStreamingUploads'); + $session->response->setStreamedFile($self->getStorageLocation->getPath($self->filename)); + $session->response->sendHeader; return 'chunked'; } diff --git a/lib/WebGUI/Asset/File/GalleryFile.pm b/lib/WebGUI/Asset/File/GalleryFile.pm index 787676db5..5feb3a261 100644 --- a/lib/WebGUI/Asset/File/GalleryFile.pm +++ b/lib/WebGUI/Asset/File/GalleryFile.pm @@ -1154,8 +1154,8 @@ sub www_view { # Add to views $self->update({ views => $self->views + 1 }); - $self->session->http->setLastModified($self->getContentLastModified); - $self->session->http->sendHeader; + $self->session->response->setLastModified($self->getContentLastModified); + $self->session->response->sendHeader; $self->prepareView; my $style = $self->processStyle($self->getSeparator); my ($head, $foot) = split($self->getSeparator,$style); diff --git a/lib/WebGUI/Asset/File/GalleryFile/Photo.pm b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm index aebaf5c4c..cffd05072 100644 --- a/lib/WebGUI/Asset/File/GalleryFile/Photo.pm +++ b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm @@ -548,7 +548,7 @@ sub www_download { my $storage = $self->getStorageLocation; $self->session->response->content_type( "image/jpeg" ); - $self->session->http->setLastModified( $self->getContentLastModified ); + $self->session->response->setLastModified( $self->getContentLastModified ); my $resolution = $self->session->form->get("resolution"); if ($resolution) { diff --git a/lib/WebGUI/Asset/File/ZipArchive.pm b/lib/WebGUI/Asset/File/ZipArchive.pm index 2a27467d5..6f8a5a9c0 100644 --- a/lib/WebGUI/Asset/File/ZipArchive.pm +++ b/lib/WebGUI/Asset/File/ZipArchive.pm @@ -270,7 +270,7 @@ sub www_view { if ($self->session->isAdminOn) { return $self->session->asset($self->getContainer)->www_view; } - $self->session->http->setRedirect($self->getFileUrl($self->showPage)); + $self->session->response->setRedirect($self->getFileUrl($self->showPage)); return "1"; } diff --git a/lib/WebGUI/Asset/MapPoint.pm b/lib/WebGUI/Asset/MapPoint.pm index 752b7ae65..c9a7d13d1 100644 --- a/lib/WebGUI/Asset/MapPoint.pm +++ b/lib/WebGUI/Asset/MapPoint.pm @@ -383,7 +383,7 @@ so that this point is automatically shown. sub www_view { my $self = shift; - $self->session->http->setRedirect( + $self->session->response->setRedirect( $self->getParent->getUrl('focusOn=' . $self->getId ) ); return "redirect"; diff --git a/lib/WebGUI/Asset/MatrixListing.pm b/lib/WebGUI/Asset/MatrixListing.pm index e67e5967c..93cad8440 100644 --- a/lib/WebGUI/Asset/MatrixListing.pm +++ b/lib/WebGUI/Asset/MatrixListing.pm @@ -785,10 +785,10 @@ sub www_click { $self->incrementCounter('clicks'); if ($session->form->process("manufacturer")) { - $session->http->setRedirect( $self->get('manufacturerURL') ); + $session->response->setRedirect( $self->get('manufacturerURL') ); } else { - $session->http->setRedirect( $self->get('productURL') ); + $session->response->setRedirect( $self->get('productURL') ); } return undef; } diff --git a/lib/WebGUI/Asset/Post/Thread.pm b/lib/WebGUI/Asset/Post/Thread.pm index 57d329378..df0381273 100644 --- a/lib/WebGUI/Asset/Post/Thread.pm +++ b/lib/WebGUI/Asset/Post/Thread.pm @@ -1424,20 +1424,20 @@ Renders self->view based upon current style, subject to timeouts. Returns Privil =cut sub www_view { - my $self = shift; - my $currentPost = shift; - return $self->session->privilege->noAccess() unless $self->canView; - my $check = $self->checkView; - return $check if (defined $check); - $self->session->http->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor); - $self->session->http->sendHeader; - $self->prepareView; - my $style = $self->getParent->processStyle($self->getSeparator); - my ($head, $foot) = split($self->getSeparator,$style); - $self->session->output->print($head,1); - $self->session->output->print($self->view($currentPost)); - $self->session->output->print($foot,1); - return "chunked"; + my $self = shift; + my $currentPost = shift; + return $self->session->privilege->noAccess() unless $self->canView; + my $check = $self->checkView; + return $check if (defined $check); + $self->session->response->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor); + $self->session->response->sendHeader; + $self->prepareView; + my $style = $self->getParent->processStyle($self->getSeparator); + my ($head, $foot) = split($self->getSeparator,$style); + $self->session->output->print($head,1); + $self->session->output->print($self->view($currentPost)); + $self->session->output->print($foot,1); + return "chunked"; } diff --git a/lib/WebGUI/Asset/Redirect.pm b/lib/WebGUI/Asset/Redirect.pm index d250aed76..e4667d561 100644 --- a/lib/WebGUI/Asset/Redirect.pm +++ b/lib/WebGUI/Asset/Redirect.pm @@ -85,7 +85,7 @@ sub exportHtml_view { my $url = $self->redirectUrl; WebGUI::Macro::process($self->session, \$url); return '' if ($url eq $self->url); - $self->session->http->setRedirect($url); + $self->session->response->setRedirect($url); return $self->session->style->process('', 'PBtmpl0000000000000060'); } @@ -130,7 +130,7 @@ sub www_view { ',$i18n->get("assetName")); } unless ($url eq $self->url) { - $self->session->http->setRedirect($url,$self->redirectType); + $self->session->response->setRedirect($url,$self->redirectType); return undef; } return $i18n->get('self_referential'); diff --git a/lib/WebGUI/Asset/Shortcut.pm b/lib/WebGUI/Asset/Shortcut.pm index e8af8cf52..282d4b83a 100644 --- a/lib/WebGUI/Asset/Shortcut.pm +++ b/lib/WebGUI/Asset/Shortcut.pm @@ -1255,8 +1255,8 @@ sub www_view { $shortcut->purgeCache(); if ($shortcut->isa('WebGUI::Asset::Wobject')) { - $self->session->http->setLastModified($self->getContentLastModified); - $self->session->http->sendHeader; + $self->session->response->setLastModified($self->getContentLastModified); + $self->session->response->sendHeader; ##Tell processStyle not to set the h my $style = $shortcut->processStyle($shortcut->getSeparator, { noHeadTags => 1 }); my ($head, $foot) = split($shortcut->getSeparator,$style); diff --git a/lib/WebGUI/Asset/Sku.pm b/lib/WebGUI/Asset/Sku.pm index 64e9924a4..675dcaa59 100644 --- a/lib/WebGUI/Asset/Sku.pm +++ b/lib/WebGUI/Asset/Sku.pm @@ -647,8 +647,8 @@ sub www_view { my $self = shift; my $check = $self->checkView; return $check if (defined $check); - $self->session->http->setLastModified($self->getContentLastModified); - $self->session->http->sendHeader; + $self->session->response->setLastModified($self->getContentLastModified); + $self->session->response->sendHeader; $self->prepareView; my $style = $self->processStyle($self->getSeparator); my ($head, $foot) = split($self->getSeparator,$style); diff --git a/lib/WebGUI/Asset/Sku/Ad.pm b/lib/WebGUI/Asset/Sku/Ad.pm index b59555eeb..b29098678 100644 --- a/lib/WebGUI/Asset/Sku/Ad.pm +++ b/lib/WebGUI/Asset/Sku/Ad.pm @@ -584,8 +584,8 @@ sub www_manage { my $self = shift; my $check = $self->checkView; return $check if (defined $check); - $self->session->http->setLastModified($self->getContentLastModified); - $self->session->http->sendHeader; + $self->session->response->setLastModified($self->getContentLastModified); + $self->session->response->sendHeader; $self->prepareView($self->manageTemplate); my $style = $self->processStyle($self->getSeparator); my ($head, $foot) = split($self->getSeparator,$style); diff --git a/lib/WebGUI/Asset/Sku/Product.pm b/lib/WebGUI/Asset/Sku/Product.pm index 81d6ff039..6eb45722c 100644 --- a/lib/WebGUI/Asset/Sku/Product.pm +++ b/lib/WebGUI/Asset/Sku/Product.pm @@ -1896,7 +1896,7 @@ Extend the base method to handle caching. override www_view => sub { my $self = shift; - $self->session->http->setCacheControl($self->cacheTimeout); + $self->session->response->setCacheControl($self->cacheTimeout); super(); }; diff --git a/lib/WebGUI/Asset/Snippet.pm b/lib/WebGUI/Asset/Snippet.pm index 9dc81cda4..5ad88a16b 100644 --- a/lib/WebGUI/Asset/Snippet.pm +++ b/lib/WebGUI/Asset/Snippet.pm @@ -275,7 +275,7 @@ sub www_view { return $self->session->privilege->insufficient() unless $self->canView; my $mimeType=$self->mimeType; $self->session->response->content_type($mimeType || 'text/html'); - $self->session->http->setCacheControl($self->cacheTimeout); + $self->session->response->setCacheControl($self->cacheTimeout); my $output = $self->view(1); if (!defined $output) { $output = 'empty'; diff --git a/lib/WebGUI/Asset/Story.pm b/lib/WebGUI/Asset/Story.pm index dc6ad37ed..49735bc5b 100644 --- a/lib/WebGUI/Asset/Story.pm +++ b/lib/WebGUI/Asset/Story.pm @@ -918,7 +918,7 @@ the Story Archive that contains them. sub www_view { my $self = shift; return $self->session->privilege->noAccess unless $self->canView; - $self->session->http->sendHeader; + $self->session->response->sendHeader; $self->prepareView; return $self->getArchive->processStyle($self->view); } diff --git a/lib/WebGUI/Asset/Template.pm b/lib/WebGUI/Asset/Template.pm index 092b4b8e4..b1e0e1c4c 100644 --- a/lib/WebGUI/Asset/Template.pm +++ b/lib/WebGUI/Asset/Template.pm @@ -847,7 +847,7 @@ the user back to the site. sub www_goBackToPage { my $self = shift; - $self->session->http->setRedirect($self->session->form->get("returnUrl")) if ($self->session->form->get("returnUrl")); + $self->session->response->setRedirect($self->session->form->get("returnUrl")) if ($self->session->form->get("returnUrl")); return undef; } diff --git a/lib/WebGUI/Asset/WikiPage.pm b/lib/WebGUI/Asset/WikiPage.pm index bc94972c9..582b83dc2 100644 --- a/lib/WebGUI/Asset/WikiPage.pm +++ b/lib/WebGUI/Asset/WikiPage.pm @@ -548,7 +548,7 @@ sub www_purgeRevision { $asset->purgeRevision; if ($session->form->process("proceed") eq "manageRevisionsInTag") { my $working = (defined $self) ? $self : $parent; - $session->http->setRedirect($working->getUrl("op=manageRevisionsInTag")); + $session->response->setRedirect($working->getUrl("op=manageRevisionsInTag")); return undef; } unless (defined $self) { @@ -601,9 +601,9 @@ sub www_view { return $self->session->privilege->noAccess unless $self->canView; $self->update({ views => $self->views+1 }); # TODO: This should probably exist, as the CS has one. -# $self->session->http->setCacheControl($self->getWiki->get('visitorCacheTimeout')) +# $self->session->response->setCacheControl($self->getWiki->get('visitorCacheTimeout')) # if ($self->session->user->isVisitor); - $self->session->http->sendHeader; + $self->session->response->sendHeader; $self->prepareView; return $self->getWiki->processStyle($self->view); } diff --git a/lib/WebGUI/Asset/Wobject.pm b/lib/WebGUI/Asset/Wobject.pm index 389144e5a..e64b4b050 100644 --- a/lib/WebGUI/Asset/Wobject.pm +++ b/lib/WebGUI/Asset/Wobject.pm @@ -505,8 +505,8 @@ sub www_view { my $self = shift; my $check = $self->checkView; return $check if (defined $check); - $self->session->http->setLastModified($self->getContentLastModified); - $self->session->http->sendHeader; + $self->session->response->setLastModified($self->getContentLastModified); + $self->session->response->sendHeader; ##Have to dupe this code here because Wobject does not call SUPER. $self->prepareView; my $style = $self->processStyle($self->getSeparator, { noHeadTags => 1 }); diff --git a/lib/WebGUI/Asset/Wobject/Article.pm b/lib/WebGUI/Asset/Wobject/Article.pm index b963285c6..f19d29692 100644 --- a/lib/WebGUI/Asset/Wobject/Article.pm +++ b/lib/WebGUI/Asset/Wobject/Article.pm @@ -433,7 +433,7 @@ See WebGUI::Asset::Wobject::www_view() for details. override www_view => sub { my $self = shift; - $self->session->http->setCacheControl($self->cacheTimeout); + $self->session->response->setCacheControl($self->cacheTimeout); super(); }; diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 8c1ce322b..87b200036 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -1776,7 +1776,7 @@ Extend the base method to handle the visitor cache timeout. sub www_view { my $self = shift; my $disableCache = ($self->session->form->process("sortBy") ne ""); - $self->session->http->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor && !$disableCache); + $self->session->response->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor && !$disableCache); return $self->next::method(@_); } diff --git a/lib/WebGUI/Asset/Wobject/Dashboard.pm b/lib/WebGUI/Asset/Wobject/Dashboard.pm index e6438308e..17ed193d6 100644 --- a/lib/WebGUI/Asset/Wobject/Dashboard.pm +++ b/lib/WebGUI/Asset/Wobject/Dashboard.pm @@ -460,10 +460,10 @@ sub www_view { if ($self->state eq "published") { # no privileges, make em log in return $self->session->privilege->noAccess(); } elsif ($self->session->isAdminOn && $self->state =~ /^trash/) { # show em trash - $self->session->http->setRedirect($self->getUrl("func=manageTrash")); + $self->session->response->setRedirect($self->getUrl("func=manageTrash")); return undef; } elsif ($self->session->isAdminOn && $self->state =~ /^clipboard/) { # show em clipboard - $self->session->http->setRedirect($self->getUrl("func=manageClipboard")); + $self->session->response->setRedirect($self->getUrl("func=manageClipboard")); return undef; } else { # tell em it doesn't exist anymore $self->session->response->status(410); diff --git a/lib/WebGUI/Asset/Wobject/DataForm.pm b/lib/WebGUI/Asset/Wobject/DataForm.pm index 2c2bb3007..8a2ad4564 100644 --- a/lib/WebGUI/Asset/Wobject/DataForm.pm +++ b/lib/WebGUI/Asset/Wobject/DataForm.pm @@ -1339,7 +1339,7 @@ sub viewForm { } $var = $passedVars || $self->getRecordTemplateVars($var, $entry); if ($self->hasCaptcha) { - $self->session->http->setCacheControl('none'); + $self->session->response->setCacheControl('none'); } return $self->processTemplate($var, undef, $self->{_viewFormTemplate}); } @@ -1889,7 +1889,7 @@ sub www_exportTab { $session->response->header( 'Content-Disposition' => qq{attachment; filename="}.$self->url.'.tab"'); $session->response->content_type('text/plain'); - $session->http->sendHeader; + $session->response->sendHeader; $session->output->print($tsv->string, 1); my $entryIter = $self->entryClass->iterateAll($self); diff --git a/lib/WebGUI/Asset/Wobject/Folder.pm b/lib/WebGUI/Asset/Wobject/Folder.pm index 98ff91d1e..98b3f91ab 100644 --- a/lib/WebGUI/Asset/Wobject/Folder.pm +++ b/lib/WebGUI/Asset/Wobject/Folder.pm @@ -282,7 +282,7 @@ See WebGUI::Asset::Wobject::www_view() for details. override www_view => sub { my $self = shift; - $self->session->http->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor); + $self->session->response->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor); super(); }; diff --git a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm index 71eb888d7..54112ae95 100644 --- a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm +++ b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm @@ -837,8 +837,8 @@ sub sendChunkedContent { my $session = $self->session; - $session->http->setLastModified($self->getContentLastModified); - $session->http->sendHeader; + $session->response->setLastModified($self->getContentLastModified); + $session->response->sendHeader; my $style = $self->processStyle($self->getSeparator); my ($head, $foot) = split($self->getSeparator,$style); $session->output->print($head, 1); diff --git a/lib/WebGUI/Asset/Wobject/HttpProxy.pm b/lib/WebGUI/Asset/Wobject/HttpProxy.pm index 0c234f200..591474d83 100644 --- a/lib/WebGUI/Asset/Wobject/HttpProxy.pm +++ b/lib/WebGUI/Asset/Wobject/HttpProxy.pm @@ -497,7 +497,7 @@ sub www_view { if ($self->session->response->content_type ne "text/html") { return $output; } else { - $self->session->http->sendHeader; + $self->session->response->sendHeader; my $style = $self->processStyle($self->getSeparator, { noHeadTags => 1 }); my ($head, $foot) = split($self->getSeparator,$style); $self->session->output->print($head); diff --git a/lib/WebGUI/Asset/Wobject/Layout.pm b/lib/WebGUI/Asset/Wobject/Layout.pm index 27104a286..2ff518a4e 100644 --- a/lib/WebGUI/Asset/Wobject/Layout.pm +++ b/lib/WebGUI/Asset/Wobject/Layout.pm @@ -396,8 +396,8 @@ override www_view => sub { my $ad = $adSpace->displayImpression if (defined $adSpace); $out =~ s/\Q$code/$ad/ges; } - $session->http->setLastModified($self->getContentLastModified); - $session->http->sendHeader; + $session->response->setLastModified($self->getContentLastModified); + $session->response->sendHeader; $session->output->print($out, 1); return "chunked"; } diff --git a/lib/WebGUI/Asset/Wobject/Matrix.pm b/lib/WebGUI/Asset/Wobject/Matrix.pm index bd10ce50b..55a696881 100644 --- a/lib/WebGUI/Asset/Wobject/Matrix.pm +++ b/lib/WebGUI/Asset/Wobject/Matrix.pm @@ -1080,7 +1080,7 @@ sub www_exportAttributes { $session->response->header( 'Content-Disposition' => qq{attachment; filename="export_matrix_attributes.csv"}); $session->response->content_type('application/octet-stream'); - $self->session->http->sendHeader; + $self->session->response->sendHeader; return $output; } diff --git a/lib/WebGUI/Asset/Wobject/MessageBoard.pm b/lib/WebGUI/Asset/Wobject/MessageBoard.pm index 6a1e42385..ddb9861cb 100644 --- a/lib/WebGUI/Asset/Wobject/MessageBoard.pm +++ b/lib/WebGUI/Asset/Wobject/MessageBoard.pm @@ -178,7 +178,7 @@ See WebGUI::Asset::Wobject::www_view() for details. override www_view => sub { my $self = shift; - $self->session->http->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor); + $self->session->response->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor); super(); }; diff --git a/lib/WebGUI/Asset/Wobject/MultiSearch.pm b/lib/WebGUI/Asset/Wobject/MultiSearch.pm index 217f83fb2..807cc855f 100644 --- a/lib/WebGUI/Asset/Wobject/MultiSearch.pm +++ b/lib/WebGUI/Asset/Wobject/MultiSearch.pm @@ -128,7 +128,7 @@ See WebGUI::Asset::Wobject::www_view() for details. override www_view => sub { my $self = shift; - $self->session->http->setCacheControl($self->cacheTimeout); + $self->session->response->setCacheControl($self->cacheTimeout); super(); }; diff --git a/lib/WebGUI/Asset/Wobject/Navigation.pm b/lib/WebGUI/Asset/Wobject/Navigation.pm index fb83edbb9..52e9d95d5 100644 --- a/lib/WebGUI/Asset/Wobject/Navigation.pm +++ b/lib/WebGUI/Asset/Wobject/Navigation.pm @@ -504,7 +504,7 @@ Do a redirect to the form parameter returnUrl if it exists. sub www_goBackToPage { my $self = shift; - $self->session->http->setRedirect($self->session->form->process("returnUrl")) if ($self->session->form->process("returnUrl")); + $self->session->response->setRedirect($self->session->form->process("returnUrl")) if ($self->session->form->process("returnUrl")); return undef; } diff --git a/lib/WebGUI/Asset/Wobject/SQLReport.pm b/lib/WebGUI/Asset/Wobject/SQLReport.pm index b93a64e89..a7783a958 100644 --- a/lib/WebGUI/Asset/Wobject/SQLReport.pm +++ b/lib/WebGUI/Asset/Wobject/SQLReport.pm @@ -704,7 +704,7 @@ sub www_download { $self->downloadType eq 'csv' ? "application/octet-stream" : $self->downloadMimeType ); - $self->session->http->sendHeader; + $self->session->response->sendHeader; return $self->download; @@ -722,7 +722,7 @@ See WebGUI::Asset::Wobject::www_view() for details. override www_view => sub { my $self = shift; - $self->session->http->setCacheControl($self->cacheTimeout); + $self->session->response->setCacheControl($self->cacheTimeout); super(); }; diff --git a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm index 4c2692a7c..a4e47a850 100644 --- a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm +++ b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm @@ -390,7 +390,7 @@ See WebGUI::Asset::Wobject::www_view() for details. override www_view => sub { my $self = shift; - $self->session->http->setCacheControl($self->cacheTimeout); + $self->session->response->setCacheControl($self->cacheTimeout); super(); }; diff --git a/lib/WebGUI/AssetPackage.pm b/lib/WebGUI/AssetPackage.pm index 763247324..c88c131cc 100644 --- a/lib/WebGUI/AssetPackage.pm +++ b/lib/WebGUI/AssetPackage.pm @@ -356,9 +356,9 @@ sub www_deployPackage { return undef; }; if ($session->form->param("proceed") eq "manageAssets") { - $session->http->setRedirect($self->getManagerUrl); + $session->response->setRedirect($self->getManagerUrl); } else { - $session->http->setRedirect($self->getUrl()); + $session->response->setRedirect($self->getUrl()); } return undef; } @@ -376,7 +376,7 @@ sub www_exportPackage { return $self->session->privilege->insufficient() unless ($self->canEdit); my $storage = $self->exportPackage; my $filename = $storage->getFiles->[0]; - $self->session->http->setRedirect($storage->getUrl($storage->getFiles->[0])); + $self->session->response->setRedirect($storage->getUrl($storage->getFiles->[0])); return "redirect"; } diff --git a/lib/WebGUI/AssetVersioning.pm b/lib/WebGUI/AssetVersioning.pm index 0d08bc0e7..fd8ff4c6e 100644 --- a/lib/WebGUI/AssetVersioning.pm +++ b/lib/WebGUI/AssetVersioning.pm @@ -615,7 +615,7 @@ sub www_purgeRevision { $asset->purgeRevision; if ($session->form->process("proceed") eq "manageRevisionsInTag") { my $working = (defined $self) ? $self : $parent; - $session->http->setRedirect($working->getUrl("op=manageRevisionsInTag")); + $session->response->setRedirect($working->getUrl("op=manageRevisionsInTag")); return undef; } unless (defined $self) { diff --git a/lib/WebGUI/Auth.pm b/lib/WebGUI/Auth.pm index b85b97e36..2512a00e7 100644 --- a/lib/WebGUI/Auth.pm +++ b/lib/WebGUI/Auth.pm @@ -966,12 +966,12 @@ sub www_createAccountSave { return $self->showMessageOnLogin; } elsif ($self->session->form->get('returnUrl')) { - $self->session->http->setRedirect( $self->session->form->get('returnUrl') ); + $self->session->response->setRedirect( $self->session->form->get('returnUrl') ); $self->session->scratch->delete("redirectAfterLogin"); } elsif ($self->session->scratch->get("redirectAfterLogin")) { my $url = $self->session->scratch->delete("redirectAfterLogin"); - $self->session->http->setRedirect($url); + $self->session->response->setRedirect($url); return undef; } else { @@ -1178,7 +1178,7 @@ sub www_login { if ($self->session->setting->get('encryptLogin')) { my $currentUrl = $self->session->url->page(undef,1); $currentUrl =~ s/^https:/http:/; - $self->session->http->setRedirect($currentUrl); + $self->session->response->setRedirect($currentUrl); } # Run on login @@ -1198,14 +1198,14 @@ sub www_login { return $self->showMessageOnLogin; } elsif ( $self->session->form->get('returnUrl') ) { - $self->session->http->setRedirect( $self->session->form->get('returnUrl') ); + $self->session->response->setRedirect( $self->session->form->get('returnUrl') ); $self->session->scratch->delete("redirectAfterLogin"); } elsif ( my $url = $self->session->scratch->delete("redirectAfterLogin") ) { - $self->session->http->setRedirect($url); + $self->session->response->setRedirect($url); } elsif ( $self->session->setting->get("redirectAfterLoginUrl") ) { - $self->session->http->setRedirect($self->session->setting->get("redirectAfterLoginUrl")); + $self->session->response->setRedirect($self->session->setting->get("redirectAfterLoginUrl")); $self->session->scratch->delete("redirectAfterLogin"); } @@ -1242,7 +1242,7 @@ sub www_logout { } # Do not allow caching of the logout page (to ensure the page gets requested) - $self->session->http->setCacheControl( "none" ); + $self->session->response->setCacheControl( "none" ); return undef; } diff --git a/lib/WebGUI/Auth/Facebook.pm b/lib/WebGUI/Auth/Facebook.pm index 427411225..98001c0c5 100644 --- a/lib/WebGUI/Auth/Facebook.pm +++ b/lib/WebGUI/Auth/Facebook.pm @@ -185,7 +185,7 @@ sub www_login { ->extend_permissions(qw(email)) ->uri_as_string; - $session->http->setRedirect($auth_url); + $session->response->setRedirect($auth_url); return "redirect"; } diff --git a/lib/WebGUI/Auth/Twitter.pm b/lib/WebGUI/Auth/Twitter.pm index dec1a7e9f..f11690d80 100644 --- a/lib/WebGUI/Auth/Twitter.pm +++ b/lib/WebGUI/Auth/Twitter.pm @@ -187,7 +187,7 @@ sub www_login { $scratch->set( 'AuthTwitterToken', $nt->request_token ); $scratch->set( 'AuthTwitterTokenSecret', $nt->request_token_secret ); - $session->http->setRedirect($auth_url); + $session->response->setRedirect($auth_url); return "redirect"; } diff --git a/lib/WebGUI/Content/Asset.pm b/lib/WebGUI/Content/Asset.pm index 8dae8c85b..f1d4929a4 100644 --- a/lib/WebGUI/Content/Asset.pm +++ b/lib/WebGUI/Content/Asset.pm @@ -71,7 +71,7 @@ sub dispatch { if ($session->user->isVisitor && !$session->request->ifModifiedSince($asset->getContentLastModified, $session->setting->get('maxCacheTimeout'))) { $session->response->status("304"); - $session->http->sendHeader; + $session->response->sendHeader; return "chunked"; } @@ -166,7 +166,7 @@ The content handler for this package. sub handler { my ($session) = @_; - my ($log, $http, $asset, $request, $config) = $session->quick(qw(errorHandler http asset request config)); + my ($log, $asset, $request, $config) = $session->quick(qw(errorHandler asset request config)); my $output = ""; if (my $perfLog = $log->performanceLogger) { #show performance indicators if required my $t = [Time::HiRes::gettimeofday()]; @@ -177,7 +177,7 @@ sub handler { $output = dispatch($session, getRequestedAssetUrl($session)); } - my $filename = $http->getStreamedFile(); + my $filename = $session->response->getStreamedFile(); if ((defined $filename) && ($config->get("enableStreamingUploads") eq "1")) { my $ct = guess_media_type($filename); my $oldContentType = $request->content_type($ct); diff --git a/lib/WebGUI/Content/Maintenance.pm b/lib/WebGUI/Content/Maintenance.pm index 3e242f41a..a0cfbd046 100644 --- a/lib/WebGUI/Content/Maintenance.pm +++ b/lib/WebGUI/Content/Maintenance.pm @@ -47,7 +47,7 @@ The content handler for this package. sub handler { my $session = shift; if ($session->setting->get("specialState") eq "upgrading") { - $session->http->sendHeader; + $session->response->sendHeader; open my $fh, '<', $session->config->get('maintenancePage'); my $output = do { local $/; <$fh> }; close $fh; diff --git a/lib/WebGUI/Fork.pm b/lib/WebGUI/Fork.pm index e9b02e704..689b9c704 100644 --- a/lib/WebGUI/Fork.pm +++ b/lib/WebGUI/Fork.pm @@ -43,7 +43,7 @@ status of. ); # See WebGUI::Operation::Fork my $pairs = $process->contentPairs('DoWork'); - $session->http->setRedirect($self->getUrl($pairs)); + $session->response->setRedirect($self->getUrl($pairs)); return 'redirect'; } diff --git a/lib/WebGUI/Form/Asset.pm b/lib/WebGUI/Form/Asset.pm index bb3af2a88..6fc9f808a 100644 --- a/lib/WebGUI/Form/Asset.pm +++ b/lib/WebGUI/Form/Asset.pm @@ -181,7 +181,7 @@ form variable C. A crumb trail is provided for navigation. sub www_assetTree { my $session = shift; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my $base = WebGUI::Asset->newByUrl($session) || WebGUI::Asset->getRoot($session); my @crumb; my $ancestorIter = $base->getLineageIterator(["self","ancestors"]); diff --git a/lib/WebGUI/Form/Attachments.pm b/lib/WebGUI/Form/Attachments.pm index f4396120e..5f975b1dd 100644 --- a/lib/WebGUI/Form/Attachments.pm +++ b/lib/WebGUI/Form/Attachments.pm @@ -213,7 +213,7 @@ sub www_show { else { @assetIds = $session->form->param("attachments"); } - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); $style->setScript($url->extras("/AttachmentsControl/AttachmentsControl.js")); $style->setCss($url->extras("/AttachmentsControl/AttachmentsControl.css")); my $uploadControl = ''; diff --git a/lib/WebGUI/Form/HTMLArea.pm b/lib/WebGUI/Form/HTMLArea.pm index fee001c30..f901aeef3 100644 --- a/lib/WebGUI/Form/HTMLArea.pm +++ b/lib/WebGUI/Form/HTMLArea.pm @@ -213,7 +213,7 @@ Asset picker for the rich editor. sub www_pageTree { my $session = shift; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); $session->style->setCss($session->url->extras('/tinymce-webgui/plugins/wgpagetree/css/pagetree.css')); $session->style->setRawHeadTags(<<"JS"); @@ -270,7 +270,7 @@ Each link display a thumbnail of the image via www_viewThumbnail. sub www_imageTree { my $session = shift; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); $session->style->setCss($session->url->extras('/tinymce-webgui/plugins/wginsertimage/css/insertimage.css')); $session->style->setRawHeadTags(<<"JS"); @@ -349,7 +349,7 @@ URL in the session object is used to determine which Image is used. sub www_viewThumbnail { my $session = shift; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); $session->style->setCss($session->url->extras('/tinymce-webgui/plugins/wginsertimage/css/insertimage.css')); my $image = WebGUI::Asset->newByUrl($session); my $i18n = WebGUI::International->new($session); @@ -375,7 +375,7 @@ Returns a form to add a folder using the rich editor. The purpose of this featur sub www_addFolder { my $session = shift; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my $i18n = WebGUI::International->new($session, 'Operation_FormHelpers'); my $f = WebGUI::HTMLForm->new($session); $f->hidden( @@ -416,7 +416,7 @@ Creates a directory under the current asset. The filename should be specified in sub www_addFolderSave { my $session = shift; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); # get base url my $base = WebGUI::Asset->newByUrl($session) || WebGUI::Asset->getRoot($session); # check if user can edit the current asset @@ -453,7 +453,7 @@ sub www_addFolderSave { #filename => $filename, }); WebGUI::VersionTag->autoCommitWorkingIfEnabled($session, { allowComments => 0 }); - $session->http->setRedirect($base->getUrl('op=formHelper;class=HTMLArea;sub=imageTree')); + $session->response->setRedirect($base->getUrl('op=formHelper;class=HTMLArea;sub=imageTree')); return undef; } @@ -467,7 +467,7 @@ Returns a form to add an image using the rich editor. The purpose of this featur sub www_addImage { my $session = shift; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my $i18n = WebGUI::International->new($session, 'Operation_FormHelpers'); my $f = WebGUI::HTMLForm->new($session); $f->hidden( @@ -508,7 +508,7 @@ Creates an Image asset under the current asset. The filename should be specified sub www_addImageSave { my $session = shift; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); # get base asset my $base = WebGUI::Asset->newByUrl($session) || WebGUI::Asset->getRoot($session); @@ -539,7 +539,7 @@ sub www_addImageSave { $child->applyConstraints; } WebGUI::VersionTag->autoCommitWorkingIfEnabled($session, { allowComments => 0 }); - $session->http->setRedirect($base->getUrl('op=formHelper;class=HTMLArea;sub=imageTree')); + $session->response->setRedirect($base->getUrl('op=formHelper;class=HTMLArea;sub=imageTree')); return undef; } diff --git a/lib/WebGUI/Operation/AdSpace.pm b/lib/WebGUI/Operation/AdSpace.pm index 8b4a97b2c..4a77e8202 100644 --- a/lib/WebGUI/Operation/AdSpace.pm +++ b/lib/WebGUI/Operation/AdSpace.pm @@ -56,7 +56,7 @@ sub www_clickAd { my $id = $session->form->param("id"); return undef unless $id; my $url = WebGUI::AdSpace->countClick($session, $id); - $session->http->setRedirect($url); + $session->response->setRedirect($url); return undef; } diff --git a/lib/WebGUI/Operation/Admin.pm b/lib/WebGUI/Operation/Admin.pm index 97e6425ce..f01a20444 100644 --- a/lib/WebGUI/Operation/Admin.pm +++ b/lib/WebGUI/Operation/Admin.pm @@ -51,7 +51,7 @@ via WebGUI::Session::switchAdminOff() sub www_switchOffAdmin { my $session = shift; return "" unless ($session->user->canUseAdminMode); - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); $session->switchAdminOff(); return ""; } @@ -67,7 +67,7 @@ If the current user is in the Turn On Admin Group, then allow them to turn on Ad sub www_switchOnAdmin { my $session = shift; return "" unless ($session->user->canUseAdminMode); - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); $session->switchAdminOn(); return ""; } diff --git a/lib/WebGUI/Operation/Auth.pm b/lib/WebGUI/Operation/Auth.pm index 688a22a25..7498dc92f 100644 --- a/lib/WebGUI/Operation/Auth.pm +++ b/lib/WebGUI/Operation/Auth.pm @@ -69,7 +69,7 @@ is returned. sub www_auth { my $session = shift; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my $auth; ($auth) = $session->db->quickArray("select authMethod from users where username=".$session->db->quote($session->form->process("username"))) if($session->form->process("username")); my $authMethod = getInstance($session,$auth); diff --git a/lib/WebGUI/Operation/Cron.pm b/lib/WebGUI/Operation/Cron.pm index 9ec43f656..bd19d1cfc 100644 --- a/lib/WebGUI/Operation/Cron.pm +++ b/lib/WebGUI/Operation/Cron.pm @@ -270,7 +270,7 @@ Checks to ensure the requestor is who we think it is, and then executes a cron j sub www_runCronJob { my $session = shift; $session->response->content_type("text/plain"); - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); unless (Net::CIDR::Lite->new(@{ $session->config->get('spectreSubnets') })->find($session->request->address) || canView($session)) { $session->log->security("make a Spectre cron job runner request, but we're only allowed to accept requests from ".join(",",@{$session->config->get("spectreSubnets")})."."); return "error"; diff --git a/lib/WebGUI/Operation/LDAPLink.pm b/lib/WebGUI/Operation/LDAPLink.pm index 83ce028c2..d034582b2 100644 --- a/lib/WebGUI/Operation/LDAPLink.pm +++ b/lib/WebGUI/Operation/LDAPLink.pm @@ -348,7 +348,7 @@ sub www_editLDAPLinkSave { $properties->{ldapLoginTemplate} = $session->form->template("ldapLoginTemplate"); $session->db->setRow("ldapLink","ldapLinkId",$properties); if($session->form->process("returnUrl")) { - $session->http->setRedirect($session->form->process("returnUrl")); + $session->response->setRedirect($session->form->process("returnUrl")); return undef; } return www_listLDAPLinks($session); diff --git a/lib/WebGUI/Operation/Spectre.pm b/lib/WebGUI/Operation/Spectre.pm index 0b63a3eab..46c073cf7 100644 --- a/lib/WebGUI/Operation/Spectre.pm +++ b/lib/WebGUI/Operation/Spectre.pm @@ -53,7 +53,7 @@ Checks to ensure the requestor is who we think it is, and then returns a JSON st sub www_spectreGetSiteData { my $session = shift; $session->response->content_type("application/json"); - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my %siteData = (); my $subnets = $session->config->get("spectreSubnets"); if (!defined $subnets) { @@ -117,7 +117,7 @@ sub www_spectreStatus { my $ac = WebGUI::AdminConsole->new($session, 'spectre'); my $i18n = WebGUI::International->new($session, 'Spectre'); - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my $remote = create_ikc_client( port=>$session->config->get("spectrePort"), @@ -174,7 +174,7 @@ spectreSubnet, instead of checking the IP address of the spectre process. sub www_spectreTest { my $session = shift; $session->response->content_type("text/plain"); - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my $subnets = $session->config->get("spectreSubnets"); if (!defined $subnets) { diff --git a/lib/WebGUI/Operation/User.pm b/lib/WebGUI/Operation/User.pm index 4d74d9d93..029c4c6ee 100644 --- a/lib/WebGUI/Operation/User.pm +++ b/lib/WebGUI/Operation/User.pm @@ -943,7 +943,7 @@ A reference to the current session. sub www_formUsers { my $session = shift; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); return $session->privilege->insufficient() unless $session->user->isInGroup(12); $session->style->useEmptyStyle("1"); my $output = getUserSearchForm($session,"formUsers",{formId=>$session->form->process("formId")},1); diff --git a/lib/WebGUI/Operation/VersionTag.pm b/lib/WebGUI/Operation/VersionTag.pm index 40437516d..7a6b0a124 100644 --- a/lib/WebGUI/Operation/VersionTag.pm +++ b/lib/WebGUI/Operation/VersionTag.pm @@ -912,7 +912,7 @@ sub www_rollbackVersionTag { my $method = $session->form->process("proceed"); $method = $method eq "manageCommittedVersions" ? $method : 'manageVersions'; my $redir = WebGUI::Asset->getDefault($session)->getUrl("op=$method"); - $session->http->setRedirect( + $session->response->setRedirect( $session->url->page( $process->contentPairs( 'ProgressBar', { diff --git a/lib/WebGUI/Operation/Workflow.pm b/lib/WebGUI/Operation/Workflow.pm index f68c73e11..a5be61ef2 100644 --- a/lib/WebGUI/Operation/Workflow.pm +++ b/lib/WebGUI/Operation/Workflow.pm @@ -482,7 +482,7 @@ Checks to ensure the requestor is who we think it is, and then executes a workfl sub www_runWorkflow { my $session = shift; $session->response->content_type("text/plain"); - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); unless (Net::CIDR::Lite->new(@{ $session->config->get('spectreSubnets')} )->find($session->request->address) || canRunWorkflow($session)) { $session->log->security("make a Spectre workflow runner request, but we're only allowed to accept requests from ".join(",",@{$session->config->get("spectreSubnets")})."."); return "error"; diff --git a/lib/WebGUI/PassiveAnalytics/Flow.pm b/lib/WebGUI/PassiveAnalytics/Flow.pm index 1ad5bfb73..5925a79dd 100644 --- a/lib/WebGUI/PassiveAnalytics/Flow.pm +++ b/lib/WebGUI/PassiveAnalytics/Flow.pm @@ -90,7 +90,7 @@ sub exportSomething { $csvData .= WebGUI::Text::joinCSV(@row) . "\n"; } $storage->addFileFromScalar($filename, $csvData); - $session->http->setRedirect($storage->getUrl($filename)); + $session->response->setRedirect($storage->getUrl($filename)); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/ProgressBar.pm b/lib/WebGUI/ProgressBar.pm index 1659341ba..b344e4f11 100644 --- a/lib/WebGUI/ProgressBar.pm +++ b/lib/WebGUI/ProgressBar.pm @@ -150,7 +150,7 @@ The url to the icon you want to display. sub start { my ($self, $title, $icon) = @_; - $self->session->http->setCacheControl("none"); + $self->session->response->setCacheControl("none"); my %var = ( title => $title, icon => $icon @@ -159,7 +159,7 @@ sub start { my $output = $self->session->style->process($template->process(\%var).'~~~', "PBtmpl0000000000000137"); my ($head, $foot) = split '~~~', $output; local $| = 1; # Tell modperl not to buffer the output - $self->session->http->sendHeader; + $self->session->response->sendHeader; $self->session->output->print($head, 1); #skipMacros $self->{_foot} = $foot; return ''; diff --git a/lib/WebGUI/Role/Asset/RssFeed.pm b/lib/WebGUI/Role/Asset/RssFeed.pm index 33c2e323c..54395003f 100644 --- a/lib/WebGUI/Role/Asset/RssFeed.pm +++ b/lib/WebGUI/Role/Asset/RssFeed.pm @@ -157,7 +157,7 @@ sub _httpBasicLogin { 'WWW-Authenticate' => 'Basic realm="'.$self->session->setting->get('companyName').'"' ); $self->session->response->status(401); - $self->session->http->sendHeader; + $self->session->response->sendHeader; return ''; } diff --git a/lib/WebGUI/Session.pm b/lib/WebGUI/Session.pm index d9dff6809..853824a71 100644 --- a/lib/WebGUI/Session.pm +++ b/lib/WebGUI/Session.pm @@ -571,6 +571,7 @@ sub open { ##Set defaults $self->{_response} = $request->new_response( 200 ); $self->{_response}->content_type('text/html; charset=UTF-8'); + $self->{_response}->session( $self ); # Use the WebGUI::Session::Request object to look up the sessionId from cookies, if it # wasn't given explicitly diff --git a/lib/WebGUI/Session/Http.pm b/lib/WebGUI/Session/Http.pm index e54d6c2bb..2e8ed5de5 100644 --- a/lib/WebGUI/Session/Http.pm +++ b/lib/WebGUI/Session/Http.pm @@ -33,6 +33,9 @@ Package WebGUI::Session::Http This package allows the manipulation of HTTP protocol information. +*** This module is deprecated in favor of L and +L. + =head1 SYNOPSIS use WebGUI::Session::Http; @@ -53,89 +56,6 @@ These methods are available from this package: =cut -#------------------------------------------------------------------- - -=head2 getCacheControl ( ) - -Returns the cache control setting from this object. - -=cut - -sub getCacheControl { - my $self = shift; - return $self->{_http}{cacheControl} || 1; -} - -#------------------------------------------------------------------- - -=head2 getCookies ( ) - -Retrieves the cookies from the HTTP header and returns a hash reference containing them. - -=cut - -sub getCookies { - my $self = shift; - _deprecated('Request::cookies'); - return $self->session->request->cookies; -} - - -#------------------------------------------------------------------- - -=head2 getLastModified ( ) - -Returns the stored epoch date when the page as last modified. - -=cut - -sub getLastModified { - my $self = shift; - return $self->{_http}{lastModified}; -} - -#------------------------------------------------------------------- - -=head2 getNoHeader ( ) - -Returns whether or not a HTTP header will be printed. - -=cut - -sub getNoHeader { - my $self = shift; - return $self->{_http}{noHeader}; -} - -#------------------------------------------------------------------- - -=head2 getStreamedFile ( ) { - -Returns the location of a file to be streamed thru mod_perl, if one has been set. - -=cut - -sub getStreamedFile { - my $self = shift; - return $self->{_http}{streamlocation} || undef; -} - - -#------------------------------------------------------------------- - -=head2 isRedirect ( ) - -Returns a boolean value indicating whether the current page will redirect to some other location. - -=cut - -sub isRedirect { - my $self = shift; - my $status = $self->session->response->status; - return $status == 302 || $status == 301; -} - - #------------------------------------------------------------------- =head2 new ( session ) @@ -156,76 +76,6 @@ sub new { return $self; } - -#------------------------------------------------------------------- - -=head2 sendHeader ( ) - -Generates and sends HTTP headers for a response. - -=cut - -sub sendHeader { - my $self = shift; - return undef if ($self->{_http}{noHeader}); - return $self->_sendMinimalHeader unless defined $self->session->db(1); - - my $session = $self->session; - my ($request, $response, $config) = $session->quick(qw(request response config )); - return undef unless $request; - my $userId = $session->get("userId"); - - # send webgui session cookie - my $cookieName = $config->getCookieName; - $self->setCookie($cookieName, $session->getId, $config->getCookieTTL, $config->get("cookieDomain")) unless $session->getId eq $request->cookies->{$cookieName}; - - $self->setNoHeader(1); - my %params; - if (!$self->isRedirect()) { - my $cacheControl = $self->getCacheControl; - my $date = ($userId eq "1") ? HTTP::Date::time2str($self->getLastModified) : HTTP::Date::time2str(); - # under these circumstances, don't allow caching - if ($userId ne "1" || $cacheControl eq "none" || $self->session->setting->get("preventProxyCache")) { - $response->header( - "Cache-Control" => "private, max-age=1", - "Pragma" => "no-cache", - "Cache-Control" => "no-cache", - ); - } - # in all other cases, set cache, but tell it to ask us every time so we don't mess with recently logged in users - else { - if ( $cacheControl eq "none" ) { - $response->header("Cache-Control" => "private, max-age=1"); - } - else { - $response->header( - 'Last-Modified' => $date, - 'Cache-Control' => "must-revalidate, max-age=" . $cacheControl, - ); - } - # do an extra incantation if the HTTP protocol is really old - if ($request->protocol =~ /(\d\.\d)/ && $1 < 1.1) { - my $date = HTTP::Date::time2str(time() + $cacheControl); - $response->header( 'Expires' => $date ); - } - } - } - return undef; -} - -sub _sendMinimalHeader { - my $self = shift; - my $response = $self->session->response; - $response->content_type('text/html; charset=UTF-8'); - $response->header( - 'Cache-Control' => 'private', - "Pragma" => "no-cache", - "Cache-Control" => "no-cache", - ); - return undef; -} - - #------------------------------------------------------------------- =head2 session ( ) @@ -239,6 +89,106 @@ sub session { return $self->{_session}; } + +#------------------------------------------------------------------- + +=head2 getCacheControl ( ) + +Returns the cache control setting from this object. + +=cut + +sub getCacheControl { + my $self = shift; + return $self->session->response->getCacheControl; +} + +#------------------------------------------------------------------- + +=head2 getCookies ( ) + +Retrieves the cookies from the HTTP header and returns a hash reference containing them. + +=cut + +sub getCookies { + my $self = shift; + _deprecated('Session::Request::cookies'); + return $self->session->request->cookies; +} + + +#------------------------------------------------------------------- + +=head2 getLastModified ( ) + +Returns the stored epoch date when the page as last modified. + +=cut + +sub getLastModified { + my $self = shift; + return $self->session->response->getLastModified; +} + +#------------------------------------------------------------------- + +=head2 getNoHeader ( ) + +Returns whether or not a HTTP header will be printed. + +=cut + +sub getNoHeader { + my $self = shift; + return $self->session->response->getNoHeader; +} + +#------------------------------------------------------------------- + +=head2 getStreamedFile ( ) { + +Returns the location of a file to be streamed thru mod_perl, if one has been set. + +=cut + +sub getStreamedFile { + my $self = shift; + _deprecated('Session::Response::getStreamedFile'); + return $self->session->response->getStreamedFile; +} + + +#------------------------------------------------------------------- + +=head2 isRedirect ( ) + +Returns a boolean value indicating whether the current page will redirect to some other location. + +=cut + +sub isRedirect { + my $self = shift; + _deprecated('Session::Response::isRedirect'); + return $self->session->response->isRedirect; +} + + +#------------------------------------------------------------------- + +=head3 sendHeader + +Moved to L. + +=cut + +sub sendHeader { + my $self = shift; + _deprecated('Session::Response::sendHeader'); + $self->session->response->sendHeader(@_); +} + + #------------------------------------------------------------------- =head2 setCacheControl ( timeout ) @@ -253,49 +203,20 @@ Either the number of seconds until the cache expires, or the word "none" to disa sub setCacheControl { my $self = shift; - my $timeout = shift; - $self->{_http}{cacheControl} = $timeout; + _deprecated('Session::Response::setCacheControl'); + $self->session->response->setCacheControl(@_); } #------------------------------------------------------------------- =head2 setCookie ( name, value [ , timeToLive, domain ] ) -Sends a cookie to the browser. - -=head3 name - -The name of the cookie to set. Must be unique from all other cookies from this domain or it will overwrite that cookie. - -=head3 value - -The value to set. - -=head3 timeToLive - -The time that the cookie should remain in the browser. Defaults to "+10y" (10 years from now). -This may be "session" to indicate that the cookie is for the current browser session only. - -=head3 domain - -Explicitly set the domain for this cookie. - -=cut +Moved to L. sub setCookie { my $self = shift; - my $name = shift; - my $value = shift; - my $ttl = shift; - my $domain = shift; - $ttl = (defined $ttl ? $ttl : '+10y'); - - $self->session->response->cookies->{$name} = { - value => $value, - path => '/', - expires => $ttl ne 'session' ? $ttl : undef, - domain => $domain, - }; + _deprecated('Session::Request'); + $self->session->response->setCookie(@_); } @@ -311,8 +232,8 @@ The epoch date when the page was last modified. sub setLastModified { my $self = shift; - my $epoch = shift; - $self->{_http}{lastModified} = $epoch; + _deprecated('Session::Response::setLastModified'); + $self->session->response->setLastModified(@_); } #------------------------------------------------------------------- @@ -330,36 +251,22 @@ Any value other than 0 will disable header printing. sub setNoHeader { my $self = shift; - $self->{_http}{noHeader} = shift; + _deprecated('Session::Response::setNoHeader'); + $self->session->response->setNoHeader(@_); } #------------------------------------------------------------------- =head2 setRedirect ( url, [ type ] ) -Sets the necessary information in the HTTP header to redirect to another URL. - -=head3 url - -The URL to redirect to. To prevent infinite loops, no redirect will be set if -url is the same as the current page, as found through $session->url->page. - -=head3 type - -Defaults to 302 (temporary redirect), but you can optionally set 301 (permanent redirect). +Moved to L. =cut sub setRedirect { my $self = shift; - my $url = shift; - my $type = shift || 302; - my @params = $self->session->form->param; - return undef if ($url eq $self->session->url->page() && scalar(@params) < 1); # prevent redirecting to self - $self->session->log->info("Redirecting to $url"); - $self->session->response->location($url); - $self->session->response->status($type); - $self->session->style->setMeta({"http-equiv"=>"refresh",content=>"0; URL=".$url}); + _deprecated('Session::Response'); + $self->session->response->setRedirect(@_); } @@ -373,7 +280,8 @@ Set a file to be streamed thru mod_perl. sub setStreamedFile { my $self = shift; - $self->{_http}{streamlocation} = shift; + _deprecated('Session::Response'); + $self->session->response->setStreamedFile(@_); } diff --git a/lib/WebGUI/Session/Response.pm b/lib/WebGUI/Session/Response.pm index 5af0d5d79..19b2641a7 100644 --- a/lib/WebGUI/Session/Response.pm +++ b/lib/WebGUI/Session/Response.pm @@ -1,7 +1,12 @@ package WebGUI::Session::Response; + use strict; +use warnings; + use parent qw(Plack::Response); +use IO::File::WithPath; + use Plack::Util::Accessor qw(session streaming writer streamer); =head1 SYNOPSIS @@ -18,6 +23,10 @@ is created. =cut +# +# +# + =head2 stream =cut @@ -28,6 +37,10 @@ sub stream { $self->streaming(1); } +# +# +# + =head2 stream_write =cut @@ -41,4 +54,300 @@ sub stream_write { $self->writer->write(@_); } +# +# +# + +=head2 sendHeader ( ) + +Generates and sends HTTP headers for a response. + +=cut + +sub sendHeader { + my $self = shift; + return undef if $self->{_http}{noHeader}; + return $self->_sendMinimalHeader unless defined $self->session->db(1); + + no warnings 'uninitialized'; + + my $session = $self->session; + my ($request, $config) = $session->quick(qw(request config )); + return undef unless $request; + my $userId = $session->get("userId"); + + # send webgui session cookie + my $cookieName = $config->getCookieName; + $self->setCookie($cookieName, $session->getId, $config->getCookieTTL, $config->get("cookieDomain")) unless $session->getId eq $request->cookies->{$cookieName}; + + $self->setNoHeader(1); + my %params; + if (!$self->isRedirect()) { + my $cacheControl = $self->getCacheControl; + my $date = ($userId eq "1") ? HTTP::Date::time2str($self->getLastModified) : HTTP::Date::time2str(); + # under these circumstances, don't allow caching + if ($userId ne "1" || $cacheControl eq "none" || $self->session->setting->get("preventProxyCache")) { + $self->header( + "Cache-Control" => "private, max-age=1", + "Pragma" => "no-cache", + "Cache-Control" => "no-cache", + ); + } + # in all other cases, set cache, but tell it to ask us every time so we don't mess with recently logged in users + else { + if ( $cacheControl eq "none" ) { + $self->header("Cache-Control" => "private, max-age=1"); + } + else { + $self->header( + 'Last-Modified' => $date, + 'Cache-Control' => "must-revalidate, max-age=" . $cacheControl, + ); + } + # do an extra incantation if the HTTP protocol is really old + if ($request->protocol =~ /(\d\.\d)/ && $1 < 1.1) { + my $date = HTTP::Date::time2str(time() + $cacheControl); + $self->header( 'Expires' => $date ); + } + } + } + return undef; +} + +sub _sendMinimalHeader { + my $self = shift; + $self->content_type('text/html; charset=UTF-8'); + $self->header( + 'Cache-Control' => 'private', + "Pragma" => "no-cache", + "Cache-Control" => "no-cache", + ); + return undef; +} + +# +# +# + +=head2 setCookie ( name, value [ , timeToLive, domain ] ) + +Sends a cookie to the browser. + +=head3 name + +The name of the cookie to set. Must be unique from all other cookies from this domain or it will overwrite that cookie. + +=head3 value + +The value to set. + +=head3 timeToLive + +The time that the cookie should remain in the browser. Defaults to "+10y" (10 years from now). +This may be "session" to indicate that the cookie is for the current browser session only. + +=head3 domain + +Explicitly set the domain for this cookie. + +=cut + +sub setCookie { + my $self = shift; + my $name = shift; + my $value = shift; + my $ttl = shift; + my $domain = shift; + $ttl = (defined $ttl ? $ttl : '+10y'); + + $self->cookies->{$name} = { + value => $value, + path => '/', + expires => $ttl ne 'session' ? $ttl : undef, + domain => $domain, + }; +} + +# +# +# + +=head2 setRedirect ( url, [ type ] ) + +Sets the necessary information in the HTTP header to redirect to another URL. + +=head3 url + +The URL to redirect to. To prevent infinite loops, no redirect will be set if +url is the same as the current page, as found through $session->url->page. + +=head3 type + +Defaults to 302 (temporary redirect), but you can optionally set 301 (permanent redirect). + +=cut + +sub setRedirect { + my $self = shift; + my $url = shift || ''; + my $type = shift || 302; + my @params = $self->session->form->param; + return undef if ($url eq $self->session->url->page() && scalar(@params) < 1); # prevent redirecting to self + $self->session->log->info("Redirecting to $url"); + $self->location($url); + $self->status($type); + $self->session->style->setMeta({"http-equiv"=>"refresh",content=>"0; URL=".$url}); +} + +# +# +# + +=head2 getLastModified ( ) + +Returns the stored epoch date when the page as last modified. + +=cut + +sub getLastModified { + my $self = shift; + return $self->{_http}{lastModified}; +} + +# +# +# + +=head2 setLastModified ( epoch ) + +=head3 epoch + +The epoch date when the page was last modified. + +=cut + +sub setLastModified { + my $self = shift; + my $epoch = shift; + $self->{_http}{lastModified} = $epoch; +} + +# +# +# + +=head2 getNoHeader ( ) + +Returns whether or not a HTTP header will be printed. + +=cut + +sub getNoHeader { + my $self = shift; + return $self->{_http}{noHeader}; +} + +# +# +# + +=head2 setNoHeader ( boolean ) + +Disables the printing of a HTTP header. Useful in situations when content is not +returned to a browser (export to disk for example). + +=head3 boolean + +Any value other than 0 will disable header printing. + +=cut + +sub setNoHeader { + my $self = shift; + $self->{_http}{noHeader} = shift; +} + +# +# +# + +=head2 isRedirect ( ) + +Returns a boolean value indicating whether the current page will redirect to some other location. + +=cut + +sub isRedirect { + my $self = shift; + my $status = $self->status; + return $status == 302 || $status == 301; +} + +# +# +# + +=head2 getStreamedFile ( ) { + +Returns the location of a file to be streamed thru mod_perl, if one has been set. + +=cut + +sub getStreamedFile { + my $self = shift; + return $self->{_http}{streamlocation} || undef; +} + +# +# +# + +=head2 setStreamedFile ( ) { + +Set a file to be streamed thru mod_perl. + +=cut + +sub setStreamedFile { + my $self = shift; + my $fn = shift; + $self->{_http}{streamlocation} = $fn; + # $self->body( IO::File::WithPath->new( $fn ) ); # let Plack handle the streaming, or let Plack::Middleware::XSendfile punt it; we don't want to send a 302 header and send the file, too; should be one or the other, selectable +} + +# +# +# + +=head2 setCacheControl ( timeout ) + +Sets the cache control headers. + +=head3 timeout + +Either the number of seconds until the cache expires, or the word "none" to disable cache completely for this request. + +=cut + +sub setCacheControl { + my $self = shift; + my $timeout = shift; + $self->{_http}{cacheControl} = $timeout; +} + +# +# +# + +=head2 getCacheControl ( ) + +Returns the cache control setting from this object. + +=cut + +sub getCacheControl { + my $self = shift; + return $self->{_http}{cacheControl} || 1; +} + 1; diff --git a/lib/WebGUI/Session/Style.pm b/lib/WebGUI/Session/Style.pm index b4f49980a..f159e260f 100644 --- a/lib/WebGUI/Session/Style.pm +++ b/lib/WebGUI/Session/Style.pm @@ -242,7 +242,7 @@ if ($self->session->user->isRegistered || $self->session->setting->get("preventP '; - $self->session->http->setCacheControl("none"); + $self->session->response->setCacheControl("none"); } else { $var{'head.tags'} .= '' } @@ -559,7 +559,7 @@ The content to be wrappered. sub userStyle { my $self = shift; my $output = shift; - $self->session->http->setCacheControl("none"); + $self->session->response->setCacheControl("none"); if (defined $output) { return $self->process($output,$self->session->setting->get("userFunctionStyleId")); } else { diff --git a/lib/WebGUI/Session/Url.pm b/lib/WebGUI/Session/Url.pm index 347edd048..22deb62c6 100644 --- a/lib/WebGUI/Session/Url.pm +++ b/lib/WebGUI/Session/Url.pm @@ -288,7 +288,7 @@ is not passed in, it will attempt to get one from the L method, or finally sub forceSecureConnection { my $self = shift; my $url = shift; - my ($conf, $http) = $self->session->quick(qw(config http)); + my ($conf, $response) = $self->session->quick(qw(config response)); if ($conf->get("sslEnabled") && ! $self->session->request->secure){ @@ -305,7 +305,7 @@ sub forceSecureConnection { } if($url =~ /^http/i) { $url =~ s/^https?/https/i; - $http->setRedirect($url); + $response->setRedirect($url); return 1; } } diff --git a/lib/WebGUI/Shop/PayDriver.pm b/lib/WebGUI/Shop/PayDriver.pm index fd472248d..5b28fca86 100644 --- a/lib/WebGUI/Shop/PayDriver.pm +++ b/lib/WebGUI/Shop/PayDriver.pm @@ -668,7 +668,7 @@ sub www_editSave { return $session->privilege->insufficient() unless $session->user->isAdmin; $self->processPropertiesFromFormPost; - $session->http->setRedirect($session->url->page('shop=pay;method=manage')); + $session->response->setRedirect($session->url->page('shop=pay;method=manage')); return undef; } diff --git a/lib/WebGUI/Shop/PayDriver/Ogone.pm b/lib/WebGUI/Shop/PayDriver/Ogone.pm index 7ba780049..e62ef0208 100644 --- a/lib/WebGUI/Shop/PayDriver/Ogone.pm +++ b/lib/WebGUI/Shop/PayDriver/Ogone.pm @@ -350,7 +350,7 @@ sub www_cancelTransaction { $self->_setPaymentStatus( 0, $form->process('PAYID'), $form->process('STATUS'), 'Cancelled' ); $self->processTransaction( $transaction ); - $session->http->setRedirect($self->session->url->getSiteURL.'?shop=cart'); + $session->response->setRedirect($self->session->url->getSiteURL.'?shop=cart'); return $session->style->userStyle('Transaction cancelled'); } @@ -373,7 +373,7 @@ sub www_declineTransaction { $self->_setPaymentStatus( 0, $form->process('PAYID'), $form->process('STATUS'), 'Declined' ); $self->processTransaction( $transaction ); - $session->http->setRedirect($self->session->url->getSiteURL.'?shop=cart'); + $session->response->setRedirect($self->session->url->getSiteURL.'?shop=cart'); return $session->style->userStyle('Transaction declined'); } @@ -396,7 +396,7 @@ sub www_exceptionTransaction { $self->_setPaymentStatus( 0, $form->process('PAYID'), $form->process('STATUS'), 'Transaction exception occurred' ); $self->processTransaction( $transaction ); - $session->http->setRedirect($self->session->url->getSiteURL.'?shop=cart'); + $session->response->setRedirect($self->session->url->getSiteURL.'?shop=cart'); return $session->style->userStyle('A transaction exception occurred.'); } diff --git a/lib/WebGUI/Shop/PayDriver/PayPal/ExpressCheckout.pm b/lib/WebGUI/Shop/PayDriver/PayPal/ExpressCheckout.pm index ff7023e9e..cf7439bd9 100644 --- a/lib/WebGUI/Shop/PayDriver/PayPal/ExpressCheckout.pm +++ b/lib/WebGUI/Shop/PayDriver/PayPal/ExpressCheckout.pm @@ -337,7 +337,7 @@ sub www_sendToPayPal { } ); - return $session->http->setRedirect($dest); + return $session->response->setRedirect($dest); } ## end sub www_sendToPayPal =head1 LIMITATIONS diff --git a/lib/WebGUI/Shop/ShipDriver.pm b/lib/WebGUI/Shop/ShipDriver.pm index 390cbc08f..5d10c6a43 100644 --- a/lib/WebGUI/Shop/ShipDriver.pm +++ b/lib/WebGUI/Shop/ShipDriver.pm @@ -346,7 +346,7 @@ sub www_editSave { my $session = $self->session; return $session->privilege->insufficient() unless $session->user->isAdmin; $self->processPropertiesFromFormPost; - $session->http->setRedirect($session->url->page('shop=ship;method=manage')); + $session->response->setRedirect($session->url->page('shop=ship;method=manage')); return undef; } diff --git a/lib/WebGUI/Shop/TaxDriver/Generic.pm b/lib/WebGUI/Shop/TaxDriver/Generic.pm index ffc45b574..ad26ec882 100644 --- a/lib/WebGUI/Shop/TaxDriver/Generic.pm +++ b/lib/WebGUI/Shop/TaxDriver/Generic.pm @@ -437,7 +437,7 @@ sub www_exportTax { return $session->privilege->insufficient unless $self->canManage; my $storage = $self->exportTaxData(); - $self->session->http->setRedirect($storage->getUrl($storage->getFiles->[0])); + $self->session->response->setRedirect($storage->getUrl($storage->getFiles->[0])); return "redirect"; } diff --git a/lib/WebGUI/VersionTag.pm b/lib/WebGUI/VersionTag.pm index f334c6316..77aea9dc7 100644 --- a/lib/WebGUI/VersionTag.pm +++ b/lib/WebGUI/VersionTag.pm @@ -100,7 +100,7 @@ sub autoCommitWorkingIfEnabled { } else { my $url = $versionTag->autoCommitUrl($options->{returnUrl}); - $session->http->setRedirect($url); + $session->response->setRedirect($url); return 'redirect'; } } diff --git a/lib/WebGUI/Wizard.pm b/lib/WebGUI/Wizard.pm index 5f07f981d..cdff82c65 100644 --- a/lib/WebGUI/Wizard.pm +++ b/lib/WebGUI/Wizard.pm @@ -377,7 +377,7 @@ sub www_cleanup { my ( $self ) = @_; $self->cleanup; - $self->session->http->setRedirect( $self->session->url->page ); + $self->session->response->setRedirect( $self->session->url->page ); return "redirect"; } diff --git a/lib/WebGUI/Wizard/HomePage.pm b/lib/WebGUI/Wizard/HomePage.pm index 936310553..b01db1e86 100644 --- a/lib/WebGUI/Wizard/HomePage.pm +++ b/lib/WebGUI/Wizard/HomePage.pm @@ -242,7 +242,7 @@ sub www_chooseContent { my ($self) = @_; my $session = $self->session; my $form = $session->form; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my $i18n = WebGUI::International->new( $session, "WebGUI" ); my $output = '

' . $i18n->get('Initial Pages') . '

'; diff --git a/lib/WebGUI/Wizard/Setup.pm b/lib/WebGUI/Wizard/Setup.pm index 5baede6df..8591a83b0 100644 --- a/lib/WebGUI/Wizard/Setup.pm +++ b/lib/WebGUI/Wizard/Setup.pm @@ -57,7 +57,7 @@ sub wrapStyle { my ( $self, $output ) = @_; my $session = $self->session; my $form = $session->form; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my $i18n = WebGUI::International->new( $session, "WebGUI" ); my $page = ' @@ -142,7 +142,7 @@ sub www_adminAccount { my ( $self ) = @_; my $session = $self->session; my $form = $session->form; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my $i18n = WebGUI::International->new( $session, "WebGUI" ); my $legend = $i18n->get('admin account'); @@ -246,7 +246,7 @@ sub www_companyInformation { my ( $self ) = @_; my $session = $self->session; my $form = $session->form; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my $i18n = WebGUI::International->new( $session, "WebGUI" ); my $output = '

' . $i18n->get('company information') . '

'; @@ -306,7 +306,7 @@ sub www_siteStats { my ( $self ) = @_; my $session = $self->session; my $form = $session->form; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my $i18n = WebGUI::International->new( $session, "WebGUI" ); my $enableForm = $self->getForm; @@ -390,7 +390,7 @@ sub www_cleanup { my ( $self ) = @_; my $session = $self->session; my $form = $session->form; - $session->http->setCacheControl("none"); + $session->response->setCacheControl("none"); my $i18n = WebGUI::International->new( $session, "WebGUI" ); $self->cleanup; diff --git a/sbin/testEnvironment.pl b/sbin/testEnvironment.pl index 190fa63b6..f60a3fee0 100755 --- a/sbin/testEnvironment.pl +++ b/sbin/testEnvironment.pl @@ -170,6 +170,7 @@ checkModule('Starman', '0.2010', 2); checkModule('App::Cmd', '0.311' ); checkModule('Devel::StackTrace', '1.27' ); checkModule('Devel::StackTrace::WithLexicals', '0.03' ); +checkModule('IO::File::WithPath', ); failAndExit("Required modules are missing, running no more checks.") if $missingModule; diff --git a/t/Session/Http.t b/t/Session/Http.t index c067dd72d..a97c676e7 100644 --- a/t/Session/Http.t +++ b/t/Session/Http.t @@ -8,6 +8,11 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- +# this test file is now slightly badly named since the functions in +# WebGUI::Session::HTTML have all been migrated to +# WebGUI::Session::Request and ::Response. still, these tests need +# to continue to pass. + use strict; use WebGUI::Test; diff --git a/t/Session/Style.t b/t/Session/Style.t index ea1c8b58c..adabfb459 100644 --- a/t/Session/Style.t +++ b/t/Session/Style.t @@ -195,7 +195,7 @@ $session->setting->set('userFunctionStyleId', $templates->{user}->getId); is($style->userStyle('userStyle'), 'USER PRINTABLE STYLE TEMPLATE:userStyle', 'userStyle returns templated output according to userFunctionStyleId in settings'); -is($session->http->{_http}{cacheControl}, 'none', 'userStyle(via process): HTTP cacheControl set to none to prevent proxying'); +is($session->http->getCacheControl, 'none', 'userStyle(via process): HTTP cacheControl set to none to prevent proxying'); is($style->userStyle('userStyle'), 'USER PRINTABLE STYLE TEMPLATE:userStyle', 'userStyle returns templated output according to userFunctionStyleId in settings'); @@ -306,8 +306,7 @@ $head =~ s/(^HEAD=.+$)/$1/s; cmp_bag(\@metas, $expectedMetas, 'process:default meta tags with no caching head tags, preventProxyCache setting'); $session->setting->set('preventProxyCache', $origPreventProxyCache); -##No accessor -is($session->http->{_http}{cacheControl}, 'none', 'process: HTTP cacheControl set to none to prevent proxying'); +is($session->http->getCacheControl, 'none', 'process: HTTP cacheControl set to none to prevent proxying'); #################################################### #