1

Topic: Integrated login for punBB 1.2 and my own site

Hi all,

Zalew was kind enough to provide a method ot login to punBB from somewhere else in your website.

It works fine in 1.1.5, but doesn't seem to work in 1.2. Could someone help me out with the correct code?

Many thanks!

2 (edited by phil 2004-12-23 22:35)

Re: Integrated login for punBB 1.2 and my own site

OK here's the code I'm using & which won't log me in to punbb 1.2 (a similar method works firn in 1.1.5).

The user logs in to my site and is verified in my user database (because the rest of the site uses sessions).

If they want to go to the forums, they click on a link which goes to a page with this code:

//hard-coded variables for testing

$username="user";
$password_hash="whatever";
$user_id="2";

include("config.php"); //to get some of the cookie variables

$now = time();
$expire = $now + 31536000;  //to set $expire

//new (1.2) cookie values
// Set a cookie, PunBB style!
//

setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed.$password_hash))), $expire, $cookie_path, $cookie_domain, $cookie_secure);

/*include("include/functions.php");*/

header("location:index.php");
exit;

any thoughts why this doesn't work? Thx.