diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index c44fb13d3..95eeda6d4 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -5,6 +5,11 @@ - Fixed the test skeleton - Fixed some bugs regarding Search relevance sorting (Len Kranendonk / www.ilance.nl) - Added an option to override the session cookie name. + - Added an option to override the session cookie domain. + - fix: Search results not showing synopses + - fix: Redirects get displayed inside page layouts as '0' + - fix: Mysterious "0" Appearing When Admin Is Off + - fix: Deletion of Products - Fix Asset.pm so that if no className is passed primeval Assets are not returned. diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index d28fe4446..3c2f57fe9 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -12,6 +12,12 @@ "cookieName" : "wgSession", +# Explicitly set the domain that the WebGUI session cookie +# should be assigned to. Defaults to the domain that the user +# is browsing the site under. + +# "cookieDomain" : ".example.com", + # The location where the WebGUI server will be handling # requests. This is normally just '/' or the root of the # server, but on some installations it might be /webgui or diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index f135663a1..01aa7ed76 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -112,7 +112,7 @@ sub contentHandler { } else { $output = page($session); } - $session->http->setCookie($session->config->getCookieName,$session->var->{_var}{sessionId}) unless $session->var->{_var}{sessionId} eq $session->http->getCookies->{$session->config->getCookieName}; + $session->http->setCookie($session->config->getCookieName,$session->var->getId, undef, $session->config->get("cookieDomain")) unless $session->var->getId eq $session->http->getCookies->{$session->config->getCookieName}; my $filename = $session->http->getStreamedFile(); if ((defined $filename) && ($session->config->get("enableStreamingUploads") eq "1")) { my $ct = guess_media_type($filename); diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index e52ef8f63..57e329f52 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -197,7 +197,7 @@ sub checkView { $self->logView(); # must find a way to do this next line better my $cookieName = $self->session->config->getCookieName; - $self->session->http->setCookie($cookieName,$self->session->var->{_var}{sessionId}) unless $self->session->var->{_var}{sessionId} eq $self->session->http->getCookies->{$cookieName}; + $self->session->http->setCookie($cookieName,$self->session->var->getId, undef, $self->session->config->get("cookieDomain")) unless $self->session->var->getId eq $self->session->http->getCookies->{$cookieName}; return undef; } @@ -1802,7 +1802,11 @@ Returns "". sub view { my $self = shift; - return $self->getToolbar if ($self->session->var->get("adminOn")); + if ($self->session->var->get("adminOn")) { + return $self->getToolbar; + } else { + return ""; + } } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Redirect.pm b/lib/WebGUI/Asset/Redirect.pm index 5e92bb429..1b4b2aae0 100644 --- a/lib/WebGUI/Asset/Redirect.pm +++ b/lib/WebGUI/Asset/Redirect.pm @@ -111,7 +111,10 @@ sub www_view {
  • '.$i18n->get("go to the redirect parent page").'
  • ',$i18n->get("assetName")); } - $self->session->http->setRedirect($url) unless $url eq $self->get("url"); + unless ($url eq $self->get("url")) { + $self->session->http->setRedirect($url); + return ""; + } return $i18n->get('self_referential'); } diff --git a/lib/WebGUI/Asset/Wobject/Search.pm b/lib/WebGUI/Asset/Wobject/Search.pm index d657bab70..17cd65579 100644 --- a/lib/WebGUI/Asset/Wobject/Search.pm +++ b/lib/WebGUI/Asset/Wobject/Search.pm @@ -158,7 +158,7 @@ sub view { push(@results, { url=>$data->{url}, title=>$data->{title}, - synposis=>$data->{synopsis}, + synopsis=>$data->{synopsis}, }); } } diff --git a/lib/WebGUI/Operation/ProductManager.pm b/lib/WebGUI/Operation/ProductManager.pm index 3199ed744..6910f85e0 100755 --- a/lib/WebGUI/Operation/ProductManager.pm +++ b/lib/WebGUI/Operation/ProductManager.pm @@ -673,7 +673,7 @@ sub www_listProducts { while ($row = $sth->hashRef) { $output .= ''; $output .= ''; - $output .= $session->icon->delete('op=deleteProduct;productId='.$row->{productId}); + $output .= $session->icon->delete('op=deleteProduct;productId='.$row->{productId}, undef, $i18n->get("confirm delete product")); $output .= $session->icon->edit('op=manageProduct;productId='.$row->{productId}); $output .= ''; $output .= ''.$row->{title}.''; diff --git a/lib/WebGUI/Session/Http.pm b/lib/WebGUI/Session/Http.pm index 8a505da60..f9c210fd9 100644 --- a/lib/WebGUI/Session/Http.pm +++ b/lib/WebGUI/Session/Http.pm @@ -242,7 +242,7 @@ sub setCacheControl { #------------------------------------------------------------------- -=head2 setCookie ( name, value [ , timeToLive ] ) +=head2 setCookie ( name, value [ , timeToLive, domain ] ) Sends a cookie to the browser. @@ -258,6 +258,10 @@ The value to set. The time that the cookie should remain in the browser. Defaults to "+10y" (10 years from now). +=head3 domain + +Explicitly set the domain for this cookie. + =cut sub setCookie { @@ -265,6 +269,7 @@ sub setCookie { my $name = shift; my $value = shift; my $ttl = shift; + my $domain = shift; $ttl = (defined $ttl ? $ttl : '+10y'); if ($self->session->request) { require Apache2::Cookie; @@ -274,6 +279,7 @@ sub setCookie { -expires=>$ttl, -path=>'/' ); + $cookie->domain($domain) if ($domain); $cookie->bake($self->session->request); } } diff --git a/lib/WebGUI/i18n/English/ProductManager.pm b/lib/WebGUI/i18n/English/ProductManager.pm index 6a201702b..358bb1fbd 100644 --- a/lib/WebGUI/i18n/English/ProductManager.pm +++ b/lib/WebGUI/i18n/English/ProductManager.pm @@ -1,6 +1,11 @@ package WebGUI::i18n::English::ProductManager; our $I18N = { + 'confirm delete product' => { + message => q|Are you certain you wish to delete this product?|, + lastUpdated => 0, + context => q|displayed when deleting a product| + }, 'manage products' => { message => q|Products|, lastUpdated => 0,