Skip to content

Commit

Permalink
Merge pull request #49 from michaelryanmcneill/2.1.1-alpha
Browse files Browse the repository at this point in the history
Version 2.1.1
  • Loading branch information
michaelryanmcneill authored May 16, 2018
2 parents 557f807 + b13a5ba commit 06096f2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
4 changes: 2 additions & 2 deletions options-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function shibboleth_options_page() {
$constant = $constant || $from_constant;
list( $spoofkey, $from_constant ) = shibboleth_getoption( 'shibboleth_spoof_key', false, false, true );
$constant = $constant || $from_constant;
list( $default_login, $from_constant ) = shibboleth_getoption( 'shibboleth_default_login', false, false, true );
list( $default_login, $from_constant ) = shibboleth_getoption( 'shibboleth_default_to_shib_login', false, false, true );
$constant = $constant || $from_constant;
list( $auto_login, $from_constant ) = shibboleth_getoption( 'shibboleth_auto_login', false, false, true );
$constant = $constant || $from_constant;
Expand Down Expand Up @@ -634,7 +634,7 @@ function AttributeAccessMethod()
<?php break;
case 'logging' :
$constant = false;
list( $shib_logging, $shib_logging_constant ) = shibboleth_getoption( 'shibboleth_logging', array(), false, true );
list( $shib_logging, $shib_logging_constant ) = shibboleth_getoption( 'shibboleth_logging', array(), true, true );
$constant = $constant || $shib_logging_constant;
?>
<h3><?php _e('Logging Configuration', 'shibboleth') ?></h3>
Expand Down
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: michaelryanmcneill, willnorris, mitchoyoshitaka, jrchamp, dericcrago, bshelton229
Tags: shibboleth, authentication, login, saml
Requires at least: 3.3
Tested up to: 4.9.2
Stable tag: 2.1
Tested up to: 4.9.6
Stable tag: 2.1.1

Allows WordPress to externalize user authentication and account creation to a Shibboleth Service Provider.

Expand Down Expand Up @@ -186,6 +186,11 @@ This update brings with it a major change to the way Shibboleth attributes are a
This update brings with it a major change to the way Shibboleth attributes are accessed. For most users, no additional configuration will be necessary. If you are using a specialized server configuration, such as a Shibboleth Service Provider on a reverse proxy or a server configuration that results in environment variables being sent with the prefix REDIRECT_, you should see the changelog for additional details: https://wordpress.org/plugins/shibboleth/#developers

== Changelog ==
= version 2.1.1 (2018-05-16) =
- Minor code cleanup for disabling authentication and passsword resets; props [@jrchamp](https://github.com/michaelryanmcneill/shibboleth/commit/06c28bec6d42e92a9338961e2f7ed4a7ae8a0f71#commitcomment-29005081).
- Resolved a minor problem where setting the SHIBBOLETH_LOGGING constant on PHP 5.5 or below would not work in the administrative interface; props [@jrchamp](https://github.com/michaelryanmcneill/shibboleth/pull/47#discussion_r188758184).
- Resolved an issue with the default to shibboleth login option in the admin; [thanks to @trandrew for reporting](https://github.com/michaelryanmcneill/shibboleth/issues/48).

= version 2.1 (2018-05-16) =
- Resolved an issue where in multisite users could inadvertently be sent to an unrelated subsite after logging in; [thanks to @themantimeforgot for reporting](https://github.com/michaelryanmcneill/shibboleth/issues/33) and [props to @jrchamp for the fix](https://github.com/michaelryanmcneill/shibboleth/pull/35).
- Resolved an regression that prevented users from authenticating if shibboleth_default_role is blank and shibboleth_create_accounts is enabled; props [@jrchamp](https://github.com/michaelryanmcneill/shibboleth/pull/37).
Expand Down
18 changes: 10 additions & 8 deletions shibboleth.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
Plugin URI: http://wordpress.org/extend/plugins/shibboleth
Description: Easily externalize user authentication to a <a href="http://shibboleth.internet2.edu">Shibboleth</a> Service Provider
Author: Michael McNeill, mitcho (Michael 芳貴 Erlewine), Will Norris
Version: 2.1
Version: 2.1.1
License: Apache 2 (http://www.apache.org/licenses/LICENSE-2.0.html)
Text Domain: shibboleth
*/

define( 'SHIBBOLETH_MINIMUM_WP_VERSION', '3.3' );
define( 'SHIBBOLETH_PLUGIN_VERSION', '2.1' );
define( 'SHIBBOLETH_PLUGIN_VERSION', '2.1.1' );

/**
* Determine if this is a new install or upgrade and, if so, run the
Expand Down Expand Up @@ -796,12 +796,14 @@ function shibboleth_disable_login() {

$bypass = defined( 'SHIBBOLETH_ALLOW_LOCAL_AUTH' ) && SHIBBOLETH_ALLOW_LOCAL_AUTH;

if ( $disable && ! $bypass && isset( $_GET['action'] ) && $_GET['action'] === 'lostpassword' ) {
// Disable the ability to reset passwords from wp-login.php
add_filter( 'allow_password_reset', '__return_false' );
} elseif ( $disable && ! $bypass && ( isset( $_POST['log'] ) || isset( $_POST['user_login'] ) ) ) {
// Disable the ability to login using local authentication
wp_die( __( 'Shibboleth authentication is required.', 'shibboleth' ) );
if ( $disable && ! $bypass ) {
if ( isset( $_GET['action'] ) && $_GET['action'] === 'lostpassword' ) {
// Disable the ability to reset passwords from wp-login.php
add_filter( 'allow_password_reset', '__return_false' );
} elseif ( isset( $_POST['log'] ) || isset( $_POST['user_login'] ) ) {
// Disable the ability to login using local authentication
wp_die( __( 'Shibboleth authentication is required.', 'shibboleth' ) );
}
}
}
add_action( 'login_init', 'shibboleth_disable_login' );
Expand Down

0 comments on commit 06096f2

Please sign in to comment.