External Login Using SMF DB

Started by AnTeK, February 03, 2006, 06:29:51 AM

Previous topic - Next topic

AnTeK

I know this has been discussed a bunch of times but I cant seem to find a definite answer and after sitting at this quite  afew hrs im ready to ditch SMF and go after another forum system. Anyways here is how far i got:
I got a login page with a form which posts back to itself. then i used the integrate feature as such:
define('SMF_INTEGRATION_SETTINGS',  serialize(array('integrate_verify_user' => 'member_login')));
then my member_login function basicly looks like this:

function member_login() {
global $login_redirect, $login_error, $db_prefix;

$request = load_request(array('user', 'password', 'redirect', 'action')); //loads those params
if ($request['action'] == 'login') {
$login_redirect = $request['redirect'];

if (!empty($request['user']) && !empty($request['password'])) {
if (ssi_checkPassword($request['user'], $request['password'], true)) {
// get his ID cause ssi_checkPassword doesnt return it :(
$query = db_query("
SELECT ID_MEMBER
FROM {$db_prefix}members
WHERE memberName = '" . $request['user'] . "'
LIMIT 1", __FILE__, __LINE__);
list ($id) = mysql_fetch_row($query);
mysql_free_result($query);
return $id;
} else {
$login_error = 'This Username/Password is not recognized. Please try again.';
}
}
}
return false;
}


Well this works great to log me in on the current page.

But as soon as i redirect to the page the user wanted to redirect to ... the entire session/cookie whatever was used to track him is not existant even though both pages include the SSI.php... any ideas?? or should i just copy the code to create the session/cookie?? <UGLY> either way any help is much appreciated.

AnTeK

Anyone have any ideas with this issue?

Advertisement: