added OPAC support for 1) selecting SSL manually and having it stick and 2) forcing...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 7 Jul 2010 13:46:37 +0000 (13:46 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 7 Jul 2010 13:46:37 +0000 (13:46 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16865 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/apache/eg_vhost.conf
Open-ILS/web/opac/common/js/opac_utils.js
Open-ILS/web/opac/skin/default/xml/common/js_common.xml

index 1f3c6b8..0277671 100644 (file)
@@ -105,6 +105,11 @@ RewriteRule - - [E=locale:%1] [L]
 
     # Specify the initial script URL for Novelist (containing account credentials, etc.)
     #SetEnv OILS_NOVELIST_URL
+    
+
+    # Uncomment to force SSL any time a patron is logged in.  This protects 
+    # authentication tokens.  Left commented out for backwards compat for now.
+    #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
 
 </LocationMatch>
 
index 2e09b66..09163e6 100644 (file)
@@ -329,11 +329,18 @@ function _debug(str) {
        */
 }
 
+var forceLoginSSL; // set via Apache env variable
 function  buildOPACLink(args, slim, ssl) {
 
        if(!args) args = {};
        var string = "";
 
+    if( ssl == undefined && (
+            location.protocol == 'https:' ||
+            (forceLoginSSL && G.user && G.user.session))) {
+        ssl = true;
+    }
+
        if(!slim) {
                string = findBaseURL(ssl);
                if(args.page) string += config.page[args.page];
@@ -799,7 +806,7 @@ function doLogout() {
        
        var nored = false;
        try{ if(isFrontPage) nored = true; } catch(e){nored = false;}
-       if(!nored) goTo(buildOPACLink(args));
+       if(!nored) goTo(buildOPACLink(args, false, false));
 }
 
 
index fa20116..af0b797 100644 (file)
                        getId("home_adv_search_link").setAttribute("href", buildOPACLink({page:ADVANCED})); 
                        getId("home_myopac_link").setAttribute("href", buildOPACLink({page:MYOPAC}, false, true));
                }
+
+        <!--#if expr="$OILS_OPAC_FORCE_LOGIN_SSL"-->
+            forceLoginSSL = true;
+        <!--#endif -->
        </script>
 
        <!-- enable Dojo date picker -->