From fb3a9f53c30ff9c2347ca45fcd7f51dd3fbb56b2 Mon Sep 17 00:00:00 2001 From: Jonathan Daggerhart Date: Mon, 15 Jun 2020 07:04:30 -0400 Subject: [PATCH] updating version and readme for new changes --- includes/openid-connect-generic-client-wrapper.php | 14 ++++---------- includes/openid-connect-generic-settings-page.php | 5 +---- openid-connect-generic.php | 8 +++++--- readme.txt | 8 ++++++++ 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/includes/openid-connect-generic-client-wrapper.php b/includes/openid-connect-generic-client-wrapper.php index 21badf0..ef3aa41 100644 --- a/includes/openid-connect-generic-client-wrapper.php +++ b/includes/openid-connect-generic-client-wrapper.php @@ -363,20 +363,14 @@ class OpenID_Connect_Generic_Client_Wrapper { $user = $this->get_user_by_identity( $subject_identity ); if ( ! $user ) { - - - if($this->settings->create_if_does_not_exist) - { + if ( $this->settings->create_if_does_not_exist ) { $user = $this->create_new_user( $subject_identity, $user_claim ); if ( is_wp_error( $user ) ) { $this->error_redirect( $user ); - return; } - }else{ - $this->error_redirect(new WP_Error( 'identity-not-map-existing-user', __( "User identity is not link to an existing Wordpress user"), $user_claim )); - - return; - + } + else { + $this->error_redirect( new WP_Error( 'identity-not-map-existing-user', __( "User identity is not link to an existing WordPress user"), $user_claim ) ); } } else { diff --git a/includes/openid-connect-generic-settings-page.php b/includes/openid-connect-generic-settings-page.php index 04b0747..00c8f15 100644 --- a/includes/openid-connect-generic-settings-page.php +++ b/includes/openid-connect-generic-settings-page.php @@ -172,7 +172,6 @@ class OpenID_Connect_Generic_Settings_Page { 'description' => __( 'If the user identity is not link to an existing Wordpress user, it is created. If this setting is not enabled and if the user authenticates with an account which is not link to an existing Wordpress user then the authentication failed' ), 'type' => 'checkbox', 'section' => 'user_settings', - ), 'redirect_user_back' => array( 'title' => __( 'Redirect Back to Origin Page' ), @@ -281,7 +280,6 @@ class OpenID_Connect_Generic_Settings_Page { // make sure each key exists in the settings array if ( ! isset( $this->settings->{ $key } ) ) { $this->settings->{ $key } = null; - } // determine appropriate output callback @@ -413,8 +411,7 @@ class OpenID_Connect_Generic_Settings_Page { settings->{ $field['key'] }, 1 ); ?>> do_field_description( $field ); diff --git a/openid-connect-generic.php b/openid-connect-generic.php index 1a2273d..e755b8c 100644 --- a/openid-connect-generic.php +++ b/openid-connect-generic.php @@ -3,7 +3,7 @@ Plugin Name: OpenID Connect Generic Plugin URI: https://github.com/daggerhart/openid-connect-generic Description: Connect to an OpenID Connect generic client using Authorization Code Flow -Version: 3.5.1 +Version: 3.6.0 Author: daggerhart Author URI: http://www.daggerhart.com License: GPLv2 Copyright (c) 2015 daggerhart @@ -33,6 +33,8 @@ Notes - openid-connect-generic-redirect-user-back - 2 args: $redirect_url, $user. Allows interruption of redirect during login. - openid-connect-generic-user-logged-in - 1 arg: $user, fires when user is logged in. - openid-connect-generic-cron-daily - daily cron action + - openid-connect-generic-state-not-found - the given state does not exist in the database, regardless of its expiration. + - openid-connect-generic-state-expired - the given state exists, but expired before this login attempt. User Meta - openid-connect-generic-subject-identity - the identity of the user provided by the idp @@ -48,7 +50,7 @@ Notes class OpenID_Connect_Generic { // plugin version - const VERSION = '3.5.1'; + const VERSION = '3.6.0'; // plugin settings private $settings; @@ -278,7 +280,7 @@ class OpenID_Connect_Generic { 'enforce_privacy' => 0, 'alternate_redirect_uri' => 0, 'link_existing_users' => 0, - 'create_if_does_not_exist'=>1, + 'create_if_does_not_exist' => 1, 'redirect_user_back' => 0, 'redirect_on_logout' => 1, 'enable_logging' => 0, diff --git a/readme.txt b/readme.txt index 4634361..2782447 100644 --- a/readme.txt +++ b/readme.txt @@ -50,6 +50,14 @@ On the settings page for this plugin (Dashboard > Settings > OpenID Connect Gene == Changelog == += 3.6.0 = + +* Improvement: @RobjS - Improved error messages during login state failure. +* Improvement: @RobjS - New developer filter for login form button URL. +* Fix: @cs1m0n - Only increment username during new user creation if the "Link existing user" setting is enabled. +* Fix: @xRy-42 - Allow periods and spaces in usernames to match what WordPress core allows. +* Feature: @benochen - New setting named "Create user if does not exist" determines whether new users are created during login attempts. + = 3.5.1 = * Fix: @daggerhart - New approach to state management using transients.