Duplicated wp users bug: a strange behavior when ... (explain and fix on soon coming 2.1.2)

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

Duplicated wp users bug: a strange behavior when ... (explain and fix on soon coming 2.1.2)

Post by axew3 »

Code: Select all

= 2.1.2 =
*Release Date - 28 Gen, 2020*
* Fix: Bug. Duplicated user in WordPress in certain conditions (WordPress fail on recognize that an user already exists: was affect only iframe mode, when user login done in iframe and user added at same timein wp)
* Fix: Bug. Php notice Trying to get property 'user_login' of non-object in /wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php on line 258 in certain conditions
* Fix: Bug. Php notice Trying to get property 'user_login' of non-object in /wp-content/plugins/wp-w3all-phpbb-integration/wp_w3all-phpbb.php on line 372 (login widget)
* Add: Option. WordPress capability, for phpBB users added into WordPress
* Minor fixes
2.1.2 will be released soon, after this post:
... i reproduced ... the duplicate users you experienced.
I looked it up all around, but what strange happen is this: if an user register in phpBB, then login in phpBB (iframed): at this time, what the code do, is to recognize that the user is logged in phpBB already, then reload page, adding the user if still not exists in wp, and logging him also ... at the time the page reload, and for what i've test only in this case, verify_phpbb_credentials(){ obviously, execute again and where:

Code: Select all

$ck_wpun_exists = username_exists( $phpbb_user_session[0]->username );
and

Code: Select all

$user_id = email_exists( $phpbb_user_session[0]->user_email );
fails on recognize that the user already exists. Even with another db connection instance, or in any case i've test it, doing direct sql instructions to check and so avoid the behavior, by the way fail and the double insertion happen.

To avoid this, in the while a more deep solution found, it can be resolved not redirecting to the forum wp page the new inserted/logged user, when user login in phpBB iframed, but still not existent in wp, redirecting instead to any other wp page. Or as done into next coming 2.1.2, by setting a ck cookie that will prevent the wrong behavior.