Problem with new registered users

antoinegdln4
User www
User www
Posts: 70
Joined: Fri Nov 11, 2016 3:50 pm

Re: Problem with new registered users

Post 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 !!
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Problem with new registered users

Post 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."'");
     }

 // }
}

???
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Problem with new registered users

Post 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/
antoinegdln4
User www
User www
Posts: 70
Joined: Fri Nov 11, 2016 3:50 pm

Re: Problem with new registered users

Post by antoinegdln4 »

Still have the problem , even after the patch... :(
antoinegdln4
User www
User www
Posts: 70
Joined: Fri Nov 11, 2016 3:50 pm

Re: Problem with new registered users

Post 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:
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Problem with new registered users

Post 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
Post Reply