Using Phorum logins
Posted by Steve H
Using Phorum logins December 27, 2007 04:58PM |
Registered: 21 years ago Posts: 237 |
I use the following method of requiring phorum logins on my site in several places:
It works as long as the person is already logged into the forum. I have problems though when they access a page in another directory without being logged in:
It tries to redirect them to login.php in the wrong directory. (thus giving a 404 error)
Any advice?
$pwd = getcwd(); chdir("../forum"); define('phorum_page', 'my_page'); include_once("./common.php"); phorum_require_login(); chdir($pwd); unset($pwd); echo "hi ",$PHORUM["user"]["username"];
It works as long as the person is already logged into the forum. I have problems though when they access a page in another directory without being logged in:
It tries to redirect them to login.php in the wrong directory. (thus giving a 404 error)
Any advice?
December 27, 2007 06:32PM |
Admin Registered: 24 years ago Posts: 4,495 |
what is your HTTP Path set to in the General Settings?
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: Using Phorum logins December 27, 2007 06:54PM |
Registered: 21 years ago Posts: 237 |
Re: Using Phorum logins December 27, 2007 07:02PM |
Registered: 21 years ago Posts: 237 |
December 28, 2007 05:01AM |
Admin Registered: 20 years ago Posts: 8,532 |
Are you using something like the automatic http_path module or the virtual hosting module? Those will dynamically try to find out the Phorum http path based on the currently requested URL. It seems like your setup is doing something like this.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team



Re: Using Phorum logins December 28, 2007 12:35PM |
Registered: 21 years ago Posts: 237 |
Ahh. Yes, indeed. I am using the Automatic HTTP Path module.
I tried turning it off and the behavior changed slightly, but still broken. Now I get redirected to the correct login page, but when I have logged in it tries to return me to the page I came from within the forum directory, rather than the originating directory. Thus:
http://www.my_domain.com/forum/login.php?0,redir=http%3A%2F%2Fwww.my_domain.com%2Fforum%2Finclude.php%3F
What I need is this:
http://www.my_domain.com/forum/login.php?0,redir=http%3A%2F%2Fwww.my_domain.com%2Fother%2Finclude.php%3F
I tried turning it off and the behavior changed slightly, but still broken. Now I get redirected to the correct login page, but when I have logged in it tries to return me to the page I came from within the forum directory, rather than the originating directory. Thus:
http://www.my_domain.com/forum/login.php?0,redir=http%3A%2F%2Fwww.my_domain.com%2Fforum%2Finclude.php%3F
What I need is this:
http://www.my_domain.com/forum/login.php?0,redir=http%3A%2F%2Fwww.my_domain.com%2Fother%2Finclude.php%3F
Sorry, only registered users may post in this forum.