Be Excellent To Each Other

And, you know, party on. Dude.

All times are UTC [ DST ]




Reply to topic  [ 20 posts ] 
Author Message
 Post subject: PHP help - integrating login with phpBB3
PostPosted: Mon Jul 21, 2008 16:21 
User avatar

Joined: 30th Mar, 2008
Posts: 14381
Location: Shropshire, UK
Any of you excellent PHP dudes got any code that I can use to login to a phpBB3 forum from a site on the same server?

It needs to be something that doesn't make extensive use of the actual phpBB resources, as whenever I try and do that it doesn't work.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Tue Jul 22, 2008 11:23 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69725
Location: Your Mum
Er... The login page of PHPBB3 works quite well.
What are you trying to do?

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Tue Jul 22, 2008 11:49 
User avatar

Joined: 30th Mar, 2008
Posts: 14381
Location: Shropshire, UK
There's a website I'm doing that's based on my own CMS framework. So there is already a login/register function on that framework that works.

They want to add a forum in, and to simplify things I want forum accounts to be created when someone registers on the main site, and when someone logs in on the main site the account on the forum gets logged in too.

I've already linked up the registration processes but the login just doesn't want to work. I have an idea why, but I'm not sure.

The reason for doing this is that the register/login features of the forum software itself will be removed so everything is done through the main site.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Tue Jul 22, 2008 11:56 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69725
Location: Your Mum
Is it cookies? This forum seems like an arse with cookies.
I take it you've copied most of the code you need from the forum's login page?

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Tue Jul 22, 2008 12:01 
User avatar

Joined: 30th Mar, 2008
Posts: 14381
Location: Shropshire, UK
I suspect it's something to do with the cookies, but bizarrely the forum doesn't create any so perhaps it's the session instead.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Tue Jul 22, 2008 12:04 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69725
Location: Your Mum
It er... You what? I can assure you it should.
I take it you can log into the forum okay using the forum login?

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Tue Jul 22, 2008 12:08 
User avatar

Joined: 30th Mar, 2008
Posts: 14381
Location: Shropshire, UK
Yeah, it all works OK using the forum login but even checking the list of cookies in Firefox shows that it hasn't created any.

Spooky.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Tue Jul 22, 2008 12:11 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69725
Location: Your Mum
What do you have in the 'cookie settings' on the first page of the ACM (on the left, right near the bottom)?

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Thu Jul 24, 2008 10:58 
User avatar

Joined: 30th Mar, 2008
Posts: 14381
Location: Shropshire, UK
Cookie domain: server (the name of our server, obv)
Cookie path: /
Cookie name: phpbb3_2ryf3
Cookie secure: disabled

I've just logged into the forum. No cookies matching that name exist. I clear all cookies using Firefox, and my account stays logged in on the server.

I logout and login again, and the only cookie created has the name "style_cookie".


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Thu Jul 24, 2008 11:03 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
GazChap wrote:
I've just logged into the forum. No cookies matching that name exist. I clear all cookies using Firefox, and my account stays logged in on the server.
Log into the site through Fiddlertool and take a long hard look at what cookies site is trying to set and their contents.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Thu Jul 24, 2008 11:08 
User avatar

Joined: 30th Mar, 2008
Posts: 14381
Location: Shropshire, UK
Why didn't I think of that? I have LiveHTTPHeaders installed in Firefox, d'oh.

Anyway, it looks like it's trying to set the cookies:

Set-Cookie: phpbb3_2ryf3_u=56; expires=Fri, 24-Jul-2009 10:11:02 GMT; path=/; domain=server; HttpOnly
Set-Cookie: phpbb3_2ryf3_k=ff17156c5fdccda4; expires=Fri, 24-Jul-2009 10:11:02 GMT; path=/; domain=server; HttpOnly
Set-Cookie: phpbb3_2ryf3_sid=9aabab3ef132c1224f5d335bf670c152; expires=Fri, 24-Jul-2009 10:11:02 GMT; path=/; domain=server; HttpOnly

But then those cookies aren't present in any of the other headers, and they never get saved. It's an Apache server running on Windows 2000, wouldn't be an Apache security thing or anything would it?


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Thu Jul 24, 2008 11:12 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
GazChap wrote:
But then those cookies aren't present in any of the other headers, and they never get saved.
Sounds like a client problem then, although I can't imagine why it would be broken. The cookies look right from what little I know of phpbb (the SID one is the important one I think). Grim...?


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Thu Jul 24, 2008 11:27 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69725
Location: Your Mum
Try setting the cookie domain to your full domain name, e.g. http://www.mysystem.tld, http://www.something.mydomain.tld. You must ensure the domain name contains at least two dots or browsers will be unlikely to recognise the cookie, e.g. .mydomain.com, mydomain.com. Do not add http:// or anything else.

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Thu Jul 24, 2008 11:28 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69725
Location: Your Mum
Gah - the board keeps adding http:// to those urls. Don't!

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Thu Jul 24, 2008 11:49 
User avatar

Joined: 30th Mar, 2008
Posts: 14381
Location: Shropshire, UK
Well, thats a fucker then. I can't add any dots into our server name and still have it work :P

Gonna have to upload it to a proper website and test from there then.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Thu Jul 24, 2008 12:03 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49244
GazChap wrote:
Well, thats a fucker then. I can't add any dots into our server name and still have it work :P


Using the fully qualified DNS name should work, shouldn't it?

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Thu Jul 24, 2008 12:05 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
Craster wrote:
GazChap wrote:
Well, thats a fucker then. I can't add any dots into our server name and still have it work :P


Using the fully qualified DNS name should work, shouldn't it?
Or a hosts file entry on the client machine. You could use any server name you want then. At least just for testing.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Thu Jul 24, 2008 12:08 
User avatar

Joined: 30th Mar, 2008
Posts: 14381
Location: Shropshire, UK
It's not that, I just tried it with http://www.source-design.co.uk and it's still not saving the cookies.

//edit: without the http:// obv.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Thu Jul 24, 2008 12:10 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69725
Location: Your Mum
Try .source-design.co.uk

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: PHP help - integrating login with phpBB3
PostPosted: Thu Jul 24, 2008 12:15 
User avatar

Joined: 30th Mar, 2008
Posts: 14381
Location: Shropshire, UK
It's alright, I'd not changed the cookie settings in the admin panel, because I'm a fuckwit.

All works now. Mah-vellous. Cheers.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 20 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Kern, Squirt, The Greys, Vogons and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search within this thread:
You are using the 'Ted' forum. Bill doesn't really exist any more. Bogus!
Want to help out with the hosting / advertising costs? That's very nice of you.
Are you on a mobile phone? Try http://beex.co.uk/m/
RIP, Owen. RIP, MrC. RIP, Dimmers.

Powered by a very Grim... version of phpBB © 2000, 2002, 2005, 2007 phpBB Group.