Page 1 of 1

Using UserPro plugin with wp-w3all-phpbb-integration

Posted: Sat Jul 23, 2016 8:04 pm
by hardpeter
I am using your plugin (wp-w3all-phpbb-integration) and all works fine except:

I use a wordpress plugin UserPro for all logins, registrations, etc. When I try to login, I never am logged in. I just get redirected to wordpress home page to login again. If I open up my phpbb in a separate window and login, then I am logged in on wordpress site.
I can send you a copy of the UserPro plugin. (it's a paid plugin) Maybe you can take a look and see what I need to do to make your plugin and userpro work together?

Thank you for any help you may be able to provide.

Peter

Re: Using UserPro plugin with wp-w3all-phpbb-integration

Posted: Sun Jul 24, 2016 7:17 am
by axew3
... another plugin that do not use WP default vars or reset $_POST .... what nice.
I've send a PM to you.

Re: Using UserPro plugin with wp-w3all-phpbb-integration

Posted: Sun Jul 24, 2016 11:45 pm
by axew3
It was exactly the problem.

It can be solved in this way:

Open file ext_plugins_fixes.php on folder wp-content/plugins/wp-w3all-phpbb-integration/addons/
search for this line:

Code: Select all

function wp_w3all_detect_login(){
		
    global $w3all_check_ext_login, $w3all_uap, $phpbb_k_val_yn;
immediately after add this:

Code: Select all

    // pre check for others login plugins like Userpro ... that may reset also the post array
    
            $phpbb_config = WP_w3all_phpbb::wp_w3all_phpbb_config_init();
            $u   = $phpbb_config["cookie_name"].'_u';
    
    	  if ( is_user_logged_in() && !isset($_COOKIE[$u]) OR is_user_logged_in() && $_COOKIE[$u] < 2 ) {

   		$current_user = wp_get_current_user();
      WP_w3all_phpbb::phpBB_user_session_set_res($current_user);
      //wp_redirect( get_edit_user_link() ); 
      wp_redirect( home_url() . '/profile' );
      exit;
    
   	}
   
// END pre check
Save.

NOTE: users are redirected to there profile after login, as the code is, to get the login work ok.

NOTE: default admin (and maybe others admin users, i’ve not try out) can’t login from Userpro login. While they can login ok, through wp-login.php default login or wp_w3all login widget. I’ve not investigate in deep the reason why of this different behavior on users roles and userpro plugin. But they can, as others, after the login, edit there profile on UserPro.
More custom fields updated on phpBB, need to be added to the code in case.