by axew3 » Sun Jun 08, 2025 10:11 am
So, as you describe the behavior, it could be this the reason, and maybe two because i noted also another thing but i have to return over into a MUMS and test it, if you are not against it, and since many years ago you gave me the possibility to access to your test environment, i will maybe ask you again to look and definitively fix reversing the issue. So i will not become crazy on re-create your scenario. Promised that this time we will not fail on detect and fix in minutes
Let me please finish with snippets i am preparing for phpBB so to make it like Discourse in some aspect, and we will go for 3.0.0 that aim to be absolutely perfect, i hope into any scenario and plugin. I am going crazy on looking these days how phpBB could much better in few easy steps.
Anyway, returning to your issue and MUMS with Simple Membership, and what you say about cookie... the plugin code work like this so we could argue maybe, maybe not, but it would be the first thing i would go to see, if the history about cookie is true, probably this happen?...(so maybe you can test)
WHEN a login is DONE in phpBB, phpBB release the session cookie. AT this time the user is only logged in phpBB.
If you are on iframed phpBB, the WP page reload, so it seem all happen at same time, login phpBB and WP but the true obviously is, that the parent WP page containing the iframed phpBB reload, the phpBB released the cookie, so the plugin WP code recognize the cookie through , and login him into WP.
If you are not in iframe, WHEN the user so navigate to WP, if there is a presented cookie uid > 2 and a session cookie, then as above, the plugin code check the session cookie, and if there is a match it login the user again THROUGH the
private static function verify_phpbb_credentials(){
on file
class.wp.w3all-phpbb.php
exactly here, if the login in WP happen not due to an user login action in a WP form, but because a phpBB valid session cookie is presented, the code into the
private static function verify_phpbb_credentials(){ do this:
Code: Select all
$remember = ( empty($phpbb_k) ) ? false : 1;
wp_set_current_user( $wpuID, '' );
wp_set_auth_cookie( $wpuID, $remember, is_ssl() );
if(!defined("PHPBBAUTHCOOKIEREL")){
define("PHPBBAUTHCOOKIEREL",true);
}
if ( !defined( 'WP_ADMIN' ) ) // or throw Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "wp_w3all_phpbb_login" not found or invalid function name ...
{
#do_action( 'wp_login', $user->user_login, $user ); # removed
}
into this, NOTE this commented line of code:
Code: Select all
#do_action( 'wp_login', $user->user_login, $user ); # removed
change into
Code: Select all
do_action( 'wp_login', $user->user_login, $user );
try to restore it
Could you please check if it is the reason of the problem?
Because when a login is done via a presented session cookie, the
private static function verify_phpbb_credentials(){ here, do not "propagate" informing all the other code, that the user is being logged in, SO MAYBE, SImple Membership in this case,
DO NOT RELEASE his cookie, because has not been noticed of a successful user login?
what inform all others plugins that there is a login is this line:
Code: Select all
do_action( 'wp_login', $user->user_login, $user );
I remember that i removed it probably, because until latest fixes about to make the code running fine into any scenario, because if an hooked function is called before the init, the code anyway instantiate a db connection and do not fail like before, probably now can be restored so to have a more correct flow.
When a login is done in WP, the plugin code release a phpBB cookie AFTER the WP login flow finished, so maybe if the problem is coming out also when logging into WP side, but only in certain MUMS subsites, probably again it is given by something that the Simple Membership do not recognize but the behavior of why this is caused, is a little bit more complicate to explain, even if easy to be fixed in necessary.
Please check if the above fixed as i hope/think!
Let know!
So, as you describe the behavior, it could be this the reason, and maybe two because i noted also another thing but i have to return over into a MUMS and test it, if you are not against it, and since many years ago you gave me the possibility to access to your test environment, i will maybe ask you again to look and definitively fix reversing the issue. So i will not become crazy on re-create your scenario. Promised that this time we will not fail on detect and fix in minutes ;)
Let me please finish with snippets i am preparing for phpBB so to make it like Discourse in some aspect, and we will go for 3.0.0 that aim to be absolutely perfect, i hope into any scenario and plugin. I am going crazy on looking these days how phpBB could much better in few easy steps.
Anyway, returning to your issue and MUMS with Simple Membership, and what you say about cookie... the plugin code work like this so we could argue maybe, maybe not, but it would be the first thing i would go to see, if the history about cookie is true, probably this happen?...(so maybe you can test)
WHEN a login is DONE in phpBB, phpBB release the session cookie. AT this time the user is only logged in phpBB.
If you are on iframed phpBB, the WP page reload, so it seem all happen at same time, login phpBB and WP but the true obviously is, that the parent WP page containing the iframed phpBB reload, the phpBB released the cookie, so the plugin WP code recognize the cookie through , and login him into WP.
If you are not in iframe, WHEN the user so navigate to WP, if there is a presented cookie uid > 2 and a session cookie, then as above, the plugin code check the session cookie, and if there is a match it login the user again THROUGH the
[b][i]private static function verify_phpbb_credentials(){[/i][/b]
on file [b]class.wp.w3all-phpbb.php[/b]
exactly here, if the login in WP happen not due to an user login action in a WP form, but because a phpBB valid session cookie is presented, the code into the [b][i]private static function verify_phpbb_credentials(){[/i][/b] do this:
[code] $remember = ( empty($phpbb_k) ) ? false : 1;
wp_set_current_user( $wpuID, '' );
wp_set_auth_cookie( $wpuID, $remember, is_ssl() );
if(!defined("PHPBBAUTHCOOKIEREL")){
define("PHPBBAUTHCOOKIEREL",true);
}
if ( !defined( 'WP_ADMIN' ) ) // or throw Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "wp_w3all_phpbb_login" not found or invalid function name ...
{
#do_action( 'wp_login', $user->user_login, $user ); # removed
}[/code]
into this, NOTE this commented line of code:
[code]#do_action( 'wp_login', $user->user_login, $user ); # removed[/code]
change into
[code]do_action( 'wp_login', $user->user_login, $user );[/code]
try to restore it
[b]Could you please check if it is the reason of the problem?[/b]
Because when a login is done via a presented session cookie, the [b][i]private static function verify_phpbb_credentials(){[/i][/b] here, do not "propagate" informing all the other code, that the user is being logged in, SO MAYBE, SImple Membership in this case, [b]DO NOT RELEASE his cookie, because has not been noticed of a successful user login?[/b]
what inform all others plugins that there is a login is this line:
[code]do_action( 'wp_login', $user->user_login, $user );[/code]
I remember that i removed it probably, because until latest fixes about to make the code running fine into any scenario, because if an hooked function is called before the init, the code anyway instantiate a db connection and do not fail like before, probably now can be restored so to have a more correct flow.
When a login is done in WP, the plugin code release a phpBB cookie AFTER the WP login flow finished, so maybe if the problem is coming out also when logging into WP side, but only in certain MUMS subsites, probably again it is given by something that the Simple Membership do not recognize but the behavior of why this is caused, is a little bit more complicate to explain, even if easy to be fixed in necessary.
Please check if the above fixed as i hope/think!
Let know!