[open-ils-commits] [GIT] Evergreen ILS branch rel_2_3 updated. ab5fcb15d7ef895b0e9059a00568f658fc8a7ef2

Evergreen Git git at git.evergreen-ils.org
Wed Aug 15 11:10:47 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_3 has been updated
       via  ab5fcb15d7ef895b0e9059a00568f658fc8a7ef2 (commit)
      from  01c58f66605b19fad28de9692cfe56b8a72ba99a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ab5fcb15d7ef895b0e9059a00568f658fc8a7ef2
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Tue Aug 14 10:50:11 2012 -0400

    Physical Location Fixes/Enhancements
    
    Teach the physical location retrieval function about using an ENV var.
    
    This allows a subdomain to force a specific physical location, say by adding
    to their apache config:
    
    SetEnv physical_loc 4
    
    Rewriterules could also be used for more dynamic configuration.
    
    Also, as a fix:
    
    Have preferred library use the stored physical location instead of assuming
    that CGI has the setting all the time.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
index 218e2d2..8d577da 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
@@ -315,9 +315,12 @@ sub staff_saved_searches_set_expansion_state {
 
 # physical_loc (i.e. "original location") passed in as a URL 
 # param will replace any existing physical_loc stored as a cookie.
+# If specified via ENV that rules over all and we don't set cookies.
 sub get_physical_loc {
     my $self = shift;
 
+    return $ENV{physical_loc} if($ENV{physical_loc});
+
     if(my $physical_loc = $self->cgi->param('physical_loc')) {
         $self->apache->headers_out->add(
             "Set-Cookie" => $self->cgi->cookie(
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
index f94d60b..eb0c703 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
@@ -389,8 +389,8 @@ sub _get_pref_lib {
         return $ctx->{user}->home_ou;
     }
 
-    if ($self->cgi->param('physical_loc')) {
-        return $self->cgi->param('physical_loc');
+    if ($ctx->{physical_loc}) {
+        return $ctx->{physical_loc};
     }
 
 }

-----------------------------------------------------------------------

Summary of changes:
 .../src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm    |    3 +++
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm   |    4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list