User authentication

The 2.0.x discussion forum has been locked; this will remain read-only. The 3.0.x discussion forum has been renamed phpBB Discussion.
Locked
LateralLeap
Registered User
Posts: 1
Joined: Thu Feb 16, 2006 4:41 pm

User authentication

Post by LateralLeap »

Is it possible to integrate the user scheme for this software with the existing user authentication of an existing site.

By this I mean that once users have logged into our site we would want to automatically log them in to the forum withou them being prompted for a second login

Thanks

Doobdee
Registered User
Posts: 209
Joined: Wed Nov 10, 2004 6:43 pm
Location: DooBDee.net
Contact:

Post by Doobdee »

This may not be what you want, but it is certianly possible to integrate phpBB 2 into your website. This articleand this might be what you need.
DooBDee
Website Ninja
DooBDee.net

eatthebaby
Registered User
Posts: 19
Joined: Mon Apr 25, 2005 4:54 am

Post by eatthebaby »

I'm looking for an answer to the same question.

Both of those tutorials linked cover how to use phpbb's login system to protect other pages, what I want to know how to do is synchronize my sessions with phpbb's. When a user logs into my database, I want him to be logged into phbb's as well.

User avatar
willy_mca
Registered User
Posts: 8
Joined: Sun Feb 26, 2006 12:05 am
Contact:

Post by willy_mca »

Sorry if this sounds presumptuous, but why not just tell users to check the box which says "Log me on automatically with each visit?"

eatthebaby
Registered User
Posts: 19
Joined: Mon Apr 25, 2005 4:54 am

Post by eatthebaby »

willy_mca wrote: Sorry if this sounds presumptuous, but why not just tell users to check the box which says "Log me on automatically with each visit?"


Right, that covers users visiting phpbb-protected pages, but what I'm asking about are pages that are covered by own login system. Basically, I'm wondering if someone can point me towards a tutorial / article that addresses how to initialize phpbb sessions and a way to copy that into my own sessions-based login system

User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

I have not seen such an article. The sessions code for phpBB is located in /includes/sessions.php so that's the code that you would need to look through to start.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image

Scubaticus
Registered User
Posts: 8
Joined: Wed Dec 21, 2005 6:34 pm
Location: Arnhem - The Netherlands
Contact:

Post by Scubaticus »

You could patch login.php.

Code: Select all

AFTER
// session id check
if (!empty($HTTP_POST_VARS['sid']) || !empty($HTTP_GET_VARS['sid']))
{
	$sid = (!empty($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : $HTTP_GET_VARS['sid'];
}
else
{
	$sid = '';
}

INSERT

//<MOD01>
if (isset($_GET['fromsite'])) {
    $HTTP_POST_VARS['login']    = true;
    $HTTP_POST_VARS['username'] = your_username;
    $HTTP_POST_VARS['password'] = your_password;
// </MOD01>
I assume you will call the phpBB from your site with a call to login.php like login.php?fromsite=true

Please make sure you retrieve the right values for your_username & your_password.

Usernames & Password of the website & phpBB should be the same.

You simply imitate a logon this way.

Use it at your own risk!

Scub

Shanana
Registered User
Posts: 368
Joined: Sat Aug 28, 2004 4:03 am
Location: USA [from London, England]

Post by Shanana »

I was going to do that, but I found it's better to use PHPBB's sessions in my case.

I can understand using your own if you plan on integrating other scripts to it.

Locked

Return to “2.0.x Discussion”