by axew3 » Sun Jan 31, 2021 2:55 pm
the next plugin version, change the code of the
private static function create_phpBB_user(){
function, adding +- the follow right on bottom
note that if the code is not wrapped into
Code: Select all
if ( class_exists('WooCommerce') ) {
or something else as explained, like
Code: Select all
// may restrict further more based on if some $_POST var exist or not
//if(isset($_POST['createaccount']) && $_POST['createaccount'] == 1 ){
then this will cause an autologin for users when they register, for any situation, even into default wordpress!
Code: Select all
// FIX AUTOLOGIN for woocommerce or any other plugin, or even default wordpress:
// when user registered and need to be logged in automatically, then avoid to follow without phpBB session setup
// or since the phpBB cookie is not released at this point, when verify_credentials will fire, the user will be logged out
// add any other here, ex:
// if ( class_exists('WooCommerce') OR isset($_POST['createaccount']) OR class_exists('somethingelse') ) {
if ( class_exists('WooCommerce') ) {
// may restrict further more based on if some $_POST var exist or not
//if(isset($_POST['createaccount']) && $_POST['createaccount'] == 1 ){
if( ! defined("W3ALL_SESSION_ARELEASED") && ! defined("PHPBBAUTHCOOKIEREL") ){
$phpBB_user_session_set = self::phpBB_user_session_set_res($wpu);
define("W3ALL_SESSION_ARELEASED", true);
}
//}
}
return;
the next plugin version, change the code of the
[c]private static function create_phpBB_user(){[/c]
function, adding +- the follow right on bottom
note that if the code is not wrapped into
[code] if ( class_exists('WooCommerce') ) {[/code]
or something else as explained, like
[code]// may restrict further more based on if some $_POST var exist or not
//if(isset($_POST['createaccount']) && $_POST['createaccount'] == 1 ){[/code]
then this will cause an autologin for users when they register, for any situation, even into default wordpress!
[code] // FIX AUTOLOGIN for woocommerce or any other plugin, or even default wordpress:
// when user registered and need to be logged in automatically, then avoid to follow without phpBB session setup
// or since the phpBB cookie is not released at this point, when verify_credentials will fire, the user will be logged out
// add any other here, ex:
// if ( class_exists('WooCommerce') OR isset($_POST['createaccount']) OR class_exists('somethingelse') ) {
if ( class_exists('WooCommerce') ) {
// may restrict further more based on if some $_POST var exist or not
//if(isset($_POST['createaccount']) && $_POST['createaccount'] == 1 ){
if( ! defined("W3ALL_SESSION_ARELEASED") && ! defined("PHPBBAUTHCOOKIEREL") ){
$phpBB_user_session_set = self::phpBB_user_session_set_res($wpu);
define("W3ALL_SESSION_ARELEASED", true);
}
//}
}
return;[/code]