Page 5 of 10

Re: Problem with new registered users

Posted: Tue Apr 18, 2017 6:33 pm
by antoinegdln4
But there is something else strange !

IF i say "NO" to "Deactivate phpBB user until WP confirmation" , and i make a New Registration, the user account is still deactivated on phpBB !!

Re: Problem with new registered users

Posted: Tue Apr 18, 2017 7:26 pm
by axew3
So, change the function into class.wp.w3all-phpbb.php:

Code: Select all

public static function wp_w3all_wp_after_pass_reset( $user ) { 
.. . . .
}

with this (maybe the setting for user role isn't still ok when it is called?):

Code: Select all

 public static function wp_w3all_wp_after_pass_reset( $user ) { 
	
	 global $w3all_config,$w3all_phpbb_user_deactivated_yn;
	
	$w3db_conn = self::wp_w3all_phpbb_conn_init();
	$phpbb_config_file = $w3all_config;
    
    $user_info = get_userdata($user->ID);
    $wp_user_role = implode(', ', $user_info->roles);

if ( $w3all_phpbb_user_deactivated_yn == 1 && !empty($wp_user_role) OR $w3all_phpbb_user_deactivated_yn != 1 ){
		
		//$username = self::w3all_phpbb_email_hash($user->user_email);
		$phpbb_user_data = self::wp_w3all_get_phpbb_user_info($user->user_email);

		if ( $phpbb_user_data[0]->user_type == 1 ) {
			$res = $w3db_conn->query("UPDATE ".$phpbb_config_file["table_prefix"]."users SET user_type = '0' WHERE user_email_hash = '".$phpbb_user_data[0]->user_email_hash."'");
     }

  }
}

OR this

Code: Select all

 public static function wp_w3all_wp_after_pass_reset( $user ) { 
	
	 global $w3all_config,$w3all_phpbb_user_deactivated_yn;
	
	$w3db_conn = self::wp_w3all_phpbb_conn_init();
	$phpbb_config_file = $w3all_config;
    
    $user_info = get_userdata($user->ID);
    $wp_user_role = implode(', ', $user_info->roles);

//if ( $w3all_phpbb_user_deactivated_yn == 1 && !empty($wp_user_role) OR $w3all_phpbb_user_deactivated_yn != 1 ){
		
		//$username = self::w3all_phpbb_email_hash($user->user_email);
		$phpbb_user_data = self::wp_w3all_get_phpbb_user_info($user->user_email);

		if ( $phpbb_user_data[0]->user_type == 1 ) {
			$res = $w3db_conn->query("UPDATE ".$phpbb_config_file["table_prefix"]."users SET user_type = '0' WHERE user_email_hash = '".$phpbb_user_data[0]->user_email_hash."'");
     }

 // }
}

???

Re: Problem with new registered users

Posted: Tue Apr 18, 2017 7:57 pm
by axew3
the 1.6.8 has been patched to correct users activation when option is set or not into wp_w3all.
fix also user addition as active if the user is added manually by admin.
the patched file is still
class.wp.w3all-phpbb.php
https://plugins.trac.wordpress.org/expo ... -phpbb.php

Topic at wp.org:
https://wordpress.org/support/topic/1-6 ... -register/

Re: Problem with new registered users

Posted: Wed Apr 19, 2017 1:36 pm
by antoinegdln4
Still have the problem , even after the patch... :(

Re: Problem with new registered users

Posted: Wed Apr 19, 2017 9:08 pm
by antoinegdln4
Hi,
After some tests,
This code that i added into bp-custom.php was the cause of the problem.

Code: Select all

add_action( 'bp_core_activated_user', 'wpse_70289_activated_user_redirect' );

function wpse_70289_activated_user_redirect() {

    $page = 'activation-reussie';//your page slug
    
    bp_core_redirect( site_url( $page ) );
}
It's a little code for a redirection after user activation, and this doesn't work with w3all... can you do something ? :cry:

Re: Problem with new registered users

Posted: Wed Apr 19, 2017 10:52 pm
by axew3
i've try to look into buddypress hooks, but i've not find out one that pass values of the user. I need to check better buddypress filters/hooks and or code in case.

Code: Select all

add_action( 'bp_core_activated_user'
unfortunately do not pass any user info so it is impossible to hook into.
I need to check what can be available to fire the activation in phpBB with this kind of custom redirect scenario ...
will try as i can to see