by axew3 » Sun Jun 18, 2023 10:02 pm
I assume it is here:
/wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php
inside the
private static function verify_phpbb_credentials(){
Code: Select all
if ( ! empty( $_REQUEST['redirect_to'] ) ) {
$redirect_to = $_REQUEST['redirect_to'];
}
if ( ( empty( $redirect_to ) || $redirect_to == admin_url() ) )
{
// If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
if ( is_multisite() && !get_active_blog_for_user($user->ID) && !is_super_admin( $user->ID ) )
$redirect_to = user_admin_url();
elseif ( is_multisite() )
$redirect_to = get_dashboard_url( $user->ID );
elseif ( is_admin() )
$redirect_to = admin_url( 'profile.php' );
// (try) check if it is a login done via phpBB into WP iframed page AND AVOID redirect to iframe if it is the first time login, so subsequent addition of the user in WP
// or duplicate WP insertion in wp will happen!!
// if it is a first time login, AVOID the redirect to page-forum (if in iframe mode and user regitered then login in phpBB iframed)
if( !isset($on_ins) && isset($_SERVER['REQUEST_URI']) && !empty($wp_w3all_forum_folder_wp) && strstr($_SERVER['REQUEST_URI'], $wp_w3all_forum_folder_wp) )
{
$redirect_to = home_url() . '/' . $wp_w3all_forum_folder_wp; // this will cause duplicated user insert in wp, if phpBB login first time done in phpBB iframed
wp_redirect( $redirect_to ); exit();
}
if( !empty($redirect_to) ){
wp_redirect($redirect_to); exit();
}
}
// again, may $redirect_to is not emtpy
if( !isset($on_ins) && isset($_SERVER['REQUEST_URI']) && !empty($wp_w3all_forum_folder_wp) && strstr($_SERVER['REQUEST_URI'], $wp_w3all_forum_folder_wp) )
{
$redirect_to = home_url() . '/' . $wp_w3all_forum_folder_wp; // this will cause duplicated user insert in wp, if phpBB login first time done in phpBB iframed
wp_redirect( $redirect_to ); exit();
}
}
This part will be re-coded soon, but you can try to debug and fix the redirect that do not happen, just changing lines:
Code: Select all
wp_redirect( $redirect_to ); exit();
into (maybe, to redirect to home):
Code: Select all
wp_redirect( home_url() ); exit();
I assume it is here:
[i]/wp-content/plugins/wp-w3all-phpbb-integration/[b]class.wp.w3all-phpbb.php[/b][/i]
inside the [i][b]private static function verify_phpbb_credentials(){[/b][/i]
[code]if ( ! empty( $_REQUEST['redirect_to'] ) ) {
$redirect_to = $_REQUEST['redirect_to'];
}
if ( ( empty( $redirect_to ) || $redirect_to == admin_url() ) )
{
// If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
if ( is_multisite() && !get_active_blog_for_user($user->ID) && !is_super_admin( $user->ID ) )
$redirect_to = user_admin_url();
elseif ( is_multisite() )
$redirect_to = get_dashboard_url( $user->ID );
elseif ( is_admin() )
$redirect_to = admin_url( 'profile.php' );
// (try) check if it is a login done via phpBB into WP iframed page AND AVOID redirect to iframe if it is the first time login, so subsequent addition of the user in WP
// or duplicate WP insertion in wp will happen!!
// if it is a first time login, AVOID the redirect to page-forum (if in iframe mode and user regitered then login in phpBB iframed)
if( !isset($on_ins) && isset($_SERVER['REQUEST_URI']) && !empty($wp_w3all_forum_folder_wp) && strstr($_SERVER['REQUEST_URI'], $wp_w3all_forum_folder_wp) )
{
$redirect_to = home_url() . '/' . $wp_w3all_forum_folder_wp; // this will cause duplicated user insert in wp, if phpBB login first time done in phpBB iframed
wp_redirect( $redirect_to ); exit();
}
if( !empty($redirect_to) ){
wp_redirect($redirect_to); exit();
}
}
// again, may $redirect_to is not emtpy
if( !isset($on_ins) && isset($_SERVER['REQUEST_URI']) && !empty($wp_w3all_forum_folder_wp) && strstr($_SERVER['REQUEST_URI'], $wp_w3all_forum_folder_wp) )
{
$redirect_to = home_url() . '/' . $wp_w3all_forum_folder_wp; // this will cause duplicated user insert in wp, if phpBB login first time done in phpBB iframed
wp_redirect( $redirect_to ); exit();
}
}[/code]
This part will be re-coded soon, but you can try to debug and fix the redirect that do not happen, just changing lines:
[code]wp_redirect( $redirect_to ); exit();[/code]
into (maybe, to redirect to home):
[code]wp_redirect( home_url() ); exit();[/code]