Jump to content

Recommended Posts

I added a feature where user's can login to my forum from the index of my site...

 

everything works, but once the user logs in, it redirects the user to my index page.

 

function do_login_redirect()
{
global $vbulletin;

if (
	$vbulletin->url == 'login.php'
	OR $vbulletin->url == $vbulletin->options['forumhome'] . '.php'
	OR strpos($vbulletin->url, 'do=logout') !== false
)
{
	$vbulletin->url = $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'];
}
else
{
	$vbulletin->url = fetch_replaced_session_url($vbulletin->url);
	$vbulletin->url = preg_replace('#^/+#', '/', $vbulletin->url); // bug 3654 don't ask why
}

$temp = strpos($vbulletin->url, '?');
if ($temp)
{
	$formfile = substr($vbulletin->url, 0, $temp);
}
else
{
	$formfile =& $vbulletin->url;
}

$postvars = $vbulletin->GPC['postvars'];

($hook = vBulletinHook::fetch_hook('login_redirect')) ? eval($hook) : false;

eval(print_standard_redirect('redirect_login', true, true));
}

 

How would I go about changing this redirect function from Vbulletin, to redirect to its normal page?

Link to comment
https://forums.phpfreaks.com/topic/66986-vbulletin-question/
Share on other sites

shot in the dark...

die($vbulletin->url);//add this for testing
if (
	$vbulletin->url == 'login.php'
	OR $vbulletin->url == "HERE" . '.php' //replace HERE with the result from the die (excluding the .php)
	OR $vbulletin->url == $vbulletin->options['forumhome'] . '.php'
	OR strpos($vbulletin->url, 'do=logout') !== false
)

Link to comment
https://forums.phpfreaks.com/topic/66986-vbulletin-question/#findComment-336355
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.