PDA

View Full Version : Only accept homepage url referal else send to homepage after login?


JohnBee
11-25-2004, 04:01 PM
I want to "force" in a sense my users to view the vB advance homepage
instead of linking directly to the forums.

how would I get them to go to the vBa homepage after they login
automoatically?

JohnBee
11-25-2004, 04:08 PM
Okay let me answer my own question!

// Check if referred from application instruction page
if($_SERVER['HTTP_REFERER'] != 'http://www.mysite.net/web/index.php')
{
// If not, redirect to application instruction page
header("location: http://www.mysite.net/web/index.php");
}

I put this at the top of my /forum/index.php and it works like a cham :D

Our Sponsors
 

JohnBee
11-25-2004, 06:09 PM
I would like to update on this.

there are all kinds of little quirks to the following referal based redirect.
users would find themselves redirected to the front page under certain
conditions. ex: mark all forums read, or... if they came from a page other
than the front page but still part of the site. :(

if anyone has any ideas on how I could accomplish this minus the problems
I am facing please lend me a hand

Brian
11-26-2004, 01:39 PM
In your login.php file look for this code:
eval(print_standard_redirect('redirect_login'));

And right above it add this:

if (!in_array($logintype, array('modcplogin', 'cplogin')))
{
$url = '/index.php';
}

Our Sponsors
 

JohnBee
11-27-2004, 02:11 AM
*** THAT WORKED! :D

Once again, thank you for your helpful advice.

JohnBee
11-27-2004, 03:02 AM
One small thing though, when I login ACP I get redirected to the frontpage
but then I can login without athentication. afterwards.

is it possible to fix that or... no
if not its fine I don't mind a little Xtra work to get things done

Brian
11-27-2004, 12:44 PM
I just modified the code in that post. If you'll change it to what's there now then that should prevent you from being redirected when you log into the admin/mod cp.