From 03f3e70455b5c89aca8fc784280ef9b3be3b2af8 Mon Sep 17 00:00:00 2001 From: Heiko Gabler Date: Mon, 5 Dec 2016 14:33:52 +0100 Subject: [PATCH 1/2] check if ssl is active and add protocol to domain --- wp-multisite-sso.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wp-multisite-sso.php b/wp-multisite-sso.php index 176ddbd..a408614 100644 --- a/wp-multisite-sso.php +++ b/wp-multisite-sso.php @@ -60,6 +60,13 @@ public static function get_network_sites( $network_sites = array() ) { if ( !isset( $site['blog_id'] ) || !isset( $site['domain'] ) ) continue; + // add protocol to sites + if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') { + $site['domain'] = 'https://' . $site['domain']; + } else { + $site['domain'] = 'http://' . $site['domain']; + } + $network_sites[$site['blog_id']] = esc_url( $site['domain'] ); } From d9e31436787c854ab19e4d501bb6b7e989a113bf Mon Sep 17 00:00:00 2001 From: Heiko Gabler Date: Mon, 5 Dec 2016 14:35:23 +0100 Subject: [PATCH 2/2] add apply_filters to hook into redirect url after login --- inc/sso.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/sso.php b/inc/sso.php index 9fe1ffc..b9775a9 100644 --- a/inc/sso.php +++ b/inc/sso.php @@ -110,7 +110,7 @@ function seqLoadSites() { // send the user back to the main page after SSO login/logout function loadComplete(){ - window.location=""; + window.location=""; } // start the login/logout logic after the sso page has loaded