https://www.axew3.com/w3/2022/02/phpbb- ... extension/
OBSOLETE since 2.4.4>
Check this for user addition at same time as soon as the registration process in phpBB finish
Force user addition in Wordpress: on first login solution
includes/functions.php
search for this code:
Code: Select all
function redirect($url, $return = false, $disable_cd_check = false)
{
global $user, $phpbb_path_helper, $phpbb_dispatcher;
Code: Select all
// START w3all redirect to WP onlogin
// Note: this snippet code on this redirect() function should may be little bit changed and not used as is if iframe (?)
// see class.wp.w3all-phpbb.php -> // START w3all redirect to phpBB (onlogin to add user in WP)
// Note: the passed URL to redirect to, is not containing the string portion after '&sid=' that is cut off
// Note: If you want pass also phpBB sid on URL (because phpBB login work also without cookie active on browser, using sid) maybe you'll remove the line more below where 'REMOVE this line'
// Note: note also the last REMOVE hint about 'exit;' and iframe mode
// DO NOT ADD FINAL SLASH
$wordpress_url = 'https://www.axew3.com/wordpress'; // SET HERE the WordPress URL you want to point to - DO NOT ADD FINAL SLASH (or change the code below)
//
global $request;
if( $request->variable('mode', '') == 'login' ){
$rurl = stristr(htmlspecialchars_decode($url), '&sid=', true); // 'REMOVE this line' to pass entire URL (with also sid var included) // stristr as of PHP 5.3.0 or >
if( strpos($rurl, '/') == 0 ){ $rurl = trim(substr($rurl, 1)); }
$rurl = base64_encode(generate_board_url() . '/'. str_replace('./', '', $rurl));
header("Location: $wordpress_url/?w3allAU=$rurl");
exit; // REMOVE or comment this 'exit;' if on redirect to iframe page (because login is done in iframe mode) it cause on redirect, that the iframed forum page return a blank page (iframe not loaded, even if on output source code all seem to be ok...)
}
// END w3all redirect to WP onlogin
Code: Select all
$wordpress_url = 'https://www.axew3.com/wordpress';
Note also that if you not wish to redirect users into phpBB, after they have been redirected by phpBB (onlogin) into Wordpress for addition, change this line:
Code: Select all
header("Location: $wordpress_url/?w3allAU=$rurl");
Code: Select all
header("Location: $wordpress_url/");