[js-embedded-discovery] 02/04: EDS-73 Auto-follow cookie. Add the following bit.

Rod Widdowson rdw at steadingsoftware.com
Sat Mar 5 07:40:00 EST 2016


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch master
in repository js-embedded-discovery.

commit 0e55fb310e5b14c0418f419f3595adb5b11a4cfe
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Fri Mar 4 14:59:57 2016 +0000

    EDS-73 Auto-follow cookie. Add the following bit.
    
    https://issues.shibboleth.net/jira/browse/EDS-73
    
    If configured, look for and then follow the auto-follow-cookie
---
 src/javascript/idpselect.js        | 24 ++++++++++++++++++++++++
 src/javascript/idpselect_config.js |  1 +
 2 files changed, 25 insertions(+)

diff --git a/src/javascript/idpselect.js b/src/javascript/idpselect.js
index 73cb32b..670faff 100644
--- a/src/javascript/idpselect.js
+++ b/src/javascript/idpselect.js
@@ -79,6 +79,30 @@ function IdPSelectUI() {
             return;
         }
 
+        //
+        // Quick test for auto-dispatch
+        //
+        if ((null != parms.autoFollowCookie) && (null != getCookieCalled( parms.autoFollowCookie ))) {
+
+            var prefs = retrieveUserSelectedIdPs();
+            if (prefs.length != 0) {
+                var retString = returnIDParam + '=' + encodeURIComponent(prefs[0]);
+                //
+                // Compose up the URL
+                //
+                if (returnString.indexOf('?') == -1) {
+                    retString = '?' + retString;
+                } else {
+                    retString = '&' + retString;
+                }
+                //
+                // Go there
+                //
+                location.href = returnString + retString;
+                return;
+            }
+        }
+
         idpSelectDiv = document.getElementById(parms.insertAtDiv);
         if(!idpSelectDiv){
             fatal(getLocalizedMessage('fatal.divMissing'));
diff --git a/src/javascript/idpselect_config.js b/src/javascript/idpselect_config.js
index 440f661..faba043 100644
--- a/src/javascript/idpselect_config.js
+++ b/src/javascript/idpselect_config.js
@@ -29,6 +29,7 @@ function IdPSelectUIParms(){
     this.setFocusTextBox = true;     // Set to false to supress focus 
     this.testGUI = false;
 
+    this.autoFollowCookie = null;  //  If you want auto-dispatch, set this to the cookie name to use
 
     //
     // Language support. 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list