| @@ -6,9 +6,9 @@ | ||
| 6 | 6 | * Plugin URI: https://github.com/uhm-coe/authorizer |
| 7 | 7 | * Text Domain: authorizer |
| 8 | 8 | * Domain Path: /languages |
| 9 | 9 | * License: GPL2 |
| 10 | - * Version: 2.8.2 | |
| 10 | + * Version: 2.8.0 | |
| 11 | 11 | * |
| 12 | 12 | * @package authorizer |
| 13 | 13 | */ |
| 14 | 14 | |
| @@ -43,9 +43,9 @@ | ||
| 43 | 43 | /** |
| 44 | 44 | * Constants for determining our admin context (network or individual site). |
| 45 | 45 | */ |
| 46 | 46 | const NETWORK_CONTEXT = 'multisite_admin'; |
| 47 | - const SINGLE_CONTEXT = 'single_admin'; | |
| 47 | + const SINGLE_CONTEXT = 'single_admin'; | |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Current site ID (Multisite). |
| 51 | 51 | * |
| @@ -1293,9 +1293,9 @@ | ||
| 1293 | 1293 | // Set the CAS service URL (including the redirect URL for WordPress when it comes back from CAS). |
| 1294 | 1294 | $cas_service_url = site_url( '/wp-login.php?external=cas' ); |
| 1295 | 1295 | $login_querystring = array(); |
| 1296 | 1296 | if ( isset( $_SERVER['QUERY_STRING'] ) ) { |
| 1297 | - parse_str( $_SERVER['QUERY_STRING'], $login_querystring ); // phpcs:ignore WordPress.VIP.ValidatedSanitizedInput | |
| 1297 | + parse_str( wp_parse_url( esc_url_raw( wp_unslash( $_SERVER['QUERY_STRING'] ) ), PHP_URL_HOST ), $login_querystring ); | |
| 1298 | 1298 | } |
| 1299 | 1299 | if ( isset( $login_querystring['redirect_to'] ) ) { |
| 1300 | 1300 | $cas_service_url .= '&redirect_to=' . rawurlencode( $login_querystring['redirect_to'] ); |
| 1301 | 1301 | } |
| @@ -1943,9 +1943,9 @@ | ||
| 1943 | 1943 | */ |
| 1944 | 1944 | public function auth_public_scripts() { |
| 1945 | 1945 | // Load (and localize) public scripts. |
| 1946 | 1946 | $current_path = ! empty( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : home_url(); |
| 1947 | - wp_enqueue_script( 'auth_public_scripts', plugins_url( '/js/authorizer-public.js', __FILE__ ), array( 'jquery' ), '2.8.0' ); | |
| 1947 | + wp_enqueue_script( 'auth_public_scripts', plugins_url( '/js/authorizer-public.js', __FILE__ ), array( 'jquery' ), '2.3.2' ); | |
| 1948 | 1948 | $auth_localized = array( |
| 1949 | 1949 | 'wpLoginUrl' => wp_login_url( $current_path ), |
| 1950 | 1950 | 'publicWarning' => get_option( 'auth_settings_advanced_public_notice' ), |
| 1951 | 1951 | 'anonymousNotice' => $this->get_plugin_option( 'access_redirect_to_message' ), |
| @@ -1953,9 +1953,9 @@ | ||
| 1953 | 1953 | ); |
| 1954 | 1954 | wp_localize_script( 'auth_public_scripts', 'auth', $auth_localized ); |
| 1955 | 1955 | |
| 1956 | 1956 | // Load public css. |
| 1957 | - wp_register_style( 'authorizer-public-css', plugins_url( 'css/authorizer-public.css', __FILE__ ), array(), '2.8.0' ); | |
| 1957 | + wp_register_style( 'authorizer-public-css', plugins_url( 'css/authorizer-public.css', __FILE__ ), array(), '2.3.2' ); | |
| 1958 | 1958 | wp_enqueue_style( 'authorizer-public-css' ); |
| 1959 | 1959 | } |
| 1960 | 1960 | |
| 1961 | 1961 | |
| @@ -1970,12 +1970,12 @@ | ||
| 1970 | 1970 | // Grab plugin settings. |
| 1971 | 1971 | $auth_settings = $this->get_plugin_options( WP_Plugin_Authorizer::SINGLE_CONTEXT, 'allow override' ); |
| 1972 | 1972 | |
| 1973 | 1973 | // Enqueue scripts appearing on wp-login.php. |
| 1974 | - wp_enqueue_script( 'auth_login_scripts', plugins_url( '/js/authorizer-login.js', __FILE__ ), array( 'jquery' ), '2.8.0' ); | |
| 1974 | + wp_enqueue_script( 'auth_login_scripts', plugins_url( '/js/authorizer-login.js', __FILE__ ), array( 'jquery' ), '2.3.2' ); | |
| 1975 | 1975 | |
| 1976 | 1976 | // Enqueue styles appearing on wp-login.php. |
| 1977 | - wp_register_style( 'authorizer-login-css', plugins_url( '/css/authorizer-login.css', __FILE__ ), array(), '2.8.0' ); | |
| 1977 | + wp_register_style( 'authorizer-login-css', plugins_url( '/css/authorizer-login.css', __FILE__ ), array(), '2.3.2' ); | |
| 1978 | 1978 | wp_enqueue_style( 'authorizer-login-css' ); |
| 1979 | 1979 | |
| 1980 | 1980 | /** |
| 1981 | 1981 | * Developers can use the `authorizer_add_branding_option` filter |
| @@ -2000,10 +2000,10 @@ | ||
| 2000 | 2000 | if ( ! ( is_array( $branding_option ) && array_key_exists( 'value', $branding_option ) && array_key_exists( 'css_url', $branding_option ) && array_key_exists( 'js_url', $branding_option ) ) ) { |
| 2001 | 2001 | continue; |
| 2002 | 2002 | } |
| 2003 | 2003 | if ( $auth_settings['advanced_branding'] === $branding_option['value'] ) { |
| 2004 | - wp_enqueue_script( 'auth_login_custom_scripts-' . sanitize_title( $branding_option['value'] ), $branding_option['js_url'], array( 'jquery' ), '2.8.0' ); | |
| 2005 | - wp_register_style( 'authorizer-login-custom-css-' . sanitize_title( $branding_option['value'] ), $branding_option['css_url'], array(), '2.8.0' ); | |
| 2004 | + wp_enqueue_script( 'auth_login_custom_scripts-' . sanitize_title( $branding_option['value'] ), $branding_option['js_url'], array( 'jquery' ), '2.3.2' ); | |
| 2005 | + wp_register_style( 'authorizer-login-custom-css-' . sanitize_title( $branding_option['value'] ), $branding_option['css_url'], array(), '2.3.2' ); | |
| 2006 | 2006 | wp_enqueue_style( 'authorizer-login-custom-css-' . sanitize_title( $branding_option['value'] ) ); |
| 2007 | 2007 | } |
| 2008 | 2008 | } |
| 2009 | 2009 | |
| @@ -2008,9 +2008,9 @@ | ||
| 2008 | 2008 | } |
| 2009 | 2009 | |
| 2010 | 2010 | // If we're using Google logins, load those resources. |
| 2011 | 2011 | if ( '1' === $auth_settings['google'] ) { |
| 2012 | - wp_enqueue_script( 'authorizer-login-custom-google', plugins_url( '/js/authorizer-login-custom_google.js', __FILE__ ), array( 'jquery' ), '2.8.0' ); ?> | |
| 2012 | + wp_enqueue_script( 'authorizer-login-custom-google', plugins_url( '/js/authorizer-login-custom_google.js', __FILE__ ), array( 'jquery' ), '2.3.2' ); ?> | |
| 2013 | 2013 | <meta name="google-signin-clientid" content="<?php echo esc_attr( $auth_settings['google_clientid'] ); ?>" /> |
| 2014 | 2014 | <meta name="google-signin-scope" content="email" /> |
| 2015 | 2015 | <meta name="google-signin-cookiepolicy" content="single_host_origin" /> |
| 2016 | 2016 | <?php |
| @@ -2124,9 +2124,9 @@ | ||
| 2124 | 2124 | </span> |
| 2125 | 2125 | </a></p> |
| 2126 | 2126 | <?php endif; ?> |
| 2127 | 2127 | |
| 2128 | - <?php if ( '1' === $auth_settings['advanced_hide_wp_login'] && isset( $_SERVER['QUERY_STRING'] ) && false === strpos( $_SERVER['QUERY_STRING'], 'external=wordpress' ) ) : // phpcs:ignore WordPress.VIP.ValidatedSanitizedInput ?> | |
| 2128 | + <?php if ( '1' === $auth_settings['advanced_hide_wp_login'] && isset( $_SERVER['QUERY_STRING'] ) && false === strpos( wp_parse_url( esc_url_raw( wp_unslash( $_SERVER['QUERY_STRING'] ) ), PHP_URL_HOST ), 'external=wordpress' ) ) : ?> | |
| 2129 | 2129 | <style type="text/css"> |
| 2130 | 2130 | body.login-action-login form { |
| 2131 | 2131 | padding-bottom: 8px; |
| 2132 | 2132 | } |
| @@ -2166,9 +2166,9 @@ | ||
| 2166 | 2166 | |
| 2167 | 2167 | // Check whether we should redirect to CAS. |
| 2168 | 2168 | if ( |
| 2169 | 2169 | isset( $_SERVER['QUERY_STRING'] ) && |
| 2170 | - strpos( $_SERVER['QUERY_STRING'], 'external=wordpress' ) === false && // phpcs:ignore WordPress.VIP.ValidatedSanitizedInput | |
| 2170 | + strpos( wp_parse_url( esc_url_raw( wp_unslash( $_SERVER['QUERY_STRING'] ) ), PHP_URL_HOST ), 'external=wordpress' ) === false && | |
| 2171 | 2171 | array_key_exists( 'cas_auto_login', $auth_settings ) && '1' === $auth_settings['cas_auto_login'] && |
| 2172 | 2172 | array_key_exists( 'cas', $auth_settings ) && '1' === $auth_settings['cas'] && |
| 2173 | 2173 | ( ! array_key_exists( 'ldap', $auth_settings ) || '1' !== $auth_settings['ldap'] ) && |
| 2174 | 2174 | ( ! array_key_exists( 'google', $auth_settings ) || '1' !== $auth_settings['google'] ) && |
| @@ -2403,9 +2403,9 @@ | ||
| 2403 | 2403 | public function load_options_page() { |
| 2404 | 2404 | wp_enqueue_script( |
| 2405 | 2405 | 'authorizer', |
| 2406 | 2406 | plugins_url( 'js/authorizer.js', __FILE__ ), |
| 2407 | - array( 'jquery-effects-shake' ), '2.8.0', true | |
| 2407 | + array( 'jquery-effects-shake' ), '2.7.2', true | |
| 2408 | 2408 | ); |
| 2409 | 2409 | wp_localize_script( |
| 2410 | 2410 | 'authorizer', 'authL10n', array( |
| 2411 | 2411 | 'baseurl' => get_bloginfo( 'url' ), |
| @@ -2489,12 +2489,12 @@ | ||
| 2489 | 2489 | $auth_settings = $this->get_plugin_options( WP_Plugin_Authorizer::SINGLE_CONTEXT, 'allow override' ); |
| 2490 | 2490 | |
| 2491 | 2491 | if ( '1' === $auth_settings['cas'] ) : |
| 2492 | 2492 | // Check if provided CAS URL is accessible. |
| 2493 | - $protocol = in_array( strval( $auth_settings['cas_port'] ), array( '80', '8080' ), true ) ? 'http' : 'https'; | |
| 2494 | - $cas_url = $protocol . '://' . $auth_settings['cas_host'] . ':' . $auth_settings['cas_port'] . $auth_settings['cas_path']; | |
| 2493 | + $protocol = in_array( strval( $auth_settings['cas_port'] ), array( '80', '8080' ), true ) ? 'http' : 'https'; | |
| 2494 | + $cas_url = $protocol . '://' . $auth_settings['cas_host'] . ':' . $auth_settings['cas_port'] . $auth_settings['cas_path']; | |
| 2495 | 2495 | $legacy_cas_url = trailingslashit( $cas_url ) . 'login'; // Check the specific CAS login endpoint (old; some servers don't register a ./login endpoint, use serviceValidate instead). |
| 2496 | - $cas_url = trailingslashit( $cas_url ) . 'serviceValidate'; // Check the specific CAS login endpoint. | |
| 2496 | + $cas_url = trailingslashit( $cas_url ) . 'serviceValidate'; // Check the specific CAS login endpoint. | |
| 2497 | 2497 | if ( ! $this->url_is_accessible( $cas_url ) && ! $this->url_is_accessible( $legacy_cas_url ) ) : |
| 2498 | 2498 | $authorizer_options_url = 'settings' === $auth_settings['advanced_admin_menu'] ? admin_url( 'options-general.php?page=authorizer' ) : admin_url( '?page=authorizer' ); |
| 2499 | 2499 | ?> |
| 2500 | 2500 | <div class='notice notice-warning is-dismissible'> |