Plugin Directory

Changeset 3298575


Ignore:
Timestamp:
05/22/2025 09:17:25 AM (9 months ago)
Author:
TimsSolutions
Message:

Improvements made to the Test Connection option in the settings
Updated compatibility with WordPress 6.8.1 and Nextcloud 31.0.4

Location:
tims-nextcloud-sso-oauth2
Files:
19 added
3 edited

Legend:

Unmodified
Added
Removed
  • tims-nextcloud-sso-oauth2/trunk/README.txt

    r3291904 r3298575  
    55Requires at least: 4.0.0
    66Tested up to: 6.8.1
    7 Stable tag: 2.0.2
    8 Requires PHP: 7.0
     7Stable tag: 2.0.3
     8Requires PHP: 8.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    125125 == Changelog ==
    126126
     127= 2.0.3 =
     128Release Date: 22nd May 2025
     129
     130- Improvements made to the Test Connection option in the settings
     131- Updated compatibility with WordPress 6.8.1 and Nextcloud 31.0.4
     132
     133= 2.0.2 =
     134Release Date: 10th August 2023
     135
     136- Implemented a feature request: When matching Nextcloud user groups to WordPress roles If no role matches there is now an option to select a default role for the user
     137- Corrected spelling mistakes on the options page
     138
    127139= 2.0.1 =
    128140Release Date: 1st July 2022
  • tims-nextcloud-sso-oauth2/trunk/includes/functions.php

    r2907447 r3298575  
    304304}
    305305
    306 
    307306function tims_nso_redirect_wplogin(){
    308307    global $GLOBALS;
     
    339338add_action( 'login_form', 'tims_nso_login_button' );
    340339
    341 
    342 
    343340add_action("wp_ajax_tims_nso_test_connection", "tims_nso_test_connection");
    344341
     
    350347        $state = bin2hex(random_bytes(10));
    351348
    352 
    353        
    354349        $authorize_url = $nextcloud_url.'apps/oauth2/authorize'.'?'.http_build_query([
    355350            'response_type' => 'code',
     
    360355        ]);
    361356
    362 
    363 
    364357        $response = wp_remote_head($authorize_url);
    365358        if(!is_wp_error($response)){
     
    367360            if(isset($headers['location'])){
    368361                $response = esc_attr($headers['location']);
     362
     363                // old nextcloud response
    369364                $expected_response = esc_attr($nextcloud_url).'login/flow?clientIdentifier='.esc_attr($identifier);
    370                 if($response == $expected_response){
     365
     366                // also check newer nextcloud response
     367                if(($response && str_contains($response, esc_attr($nextcloud_url).'login/flow?') && str_contains($response, 'clientIdentifier='.esc_attr($identifier))) || ($response == $expected_response)){
    371368                    echo '<div class="status-success"><p>Looks Good!</p></div>';
    372369                    die();
     
    381378    echo '<div class="status-error">'.$text.'</div>';
    382379    die();
    383    
    384 }
    385 
    386 
    387 
    388 
    389 
    390 
    391 
    392 
     380}
    393381
    394382function tims_nso_errors() {
  • tims-nextcloud-sso-oauth2/trunk/tims-nextcloud-sso-oauth2.php

    r2907450 r3298575  
    44Plugin URI: https://www.timoxendale.co.uk/plugins/wordpress-nextcloud-sso-oauth2/
    55Description: Enables you to login to your WordPress site with your Nextcloud account with OAuth2
    6 Version: 2.0.2
     6Version: 2.0.3
    77Author: Tim's Solutions
    88Author URI: https://www.timoxendale.co.uk/
Note: See TracChangeset for help on using the changeset viewer.