$conn=@mysql_connect("host","dbuser","dbpass");
@mysql_select_db("db");
if (isset($_COOKIE['session_id'])) {
$mid = intval($_COOKIE['member_id']);
$ses = intval($_COOKIE['session_id']);
// Look up member
$result = mysql_query("SELECT m.id, members_display_name, member_login_key, mgroup_others, g.g_access_cp FROM ipb_members m, ipb_groups g WHERE id = $mid AND
m.mgroup = g.g_id");
$member = mysql_fetch_array($result);
// Look up session
$result2 = mysql_query("SELECT id,member_name,member_id FROM ipb_sessions WHERE member_id= $mid AND id = $ses");
$member2 = mysql_fetch_array($result2);
// Name/password matches?
if (($member['id'] != $mid) or ($member['member_login_key'] != $_COOKIE['pass_hash']))
{
echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://yoursite/index.php?act=Login&CODE=00">';
die();
}
}
else {
echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://yoursite/index.php?act=Login&CODE=00">';
die();
}
mysql_close($conn);
// IPB Integration
if (isset($_COOKIE['session_id'])) {
$mid = intval($_COOKIE['member_id']);
// Look up member (including member match with cookie)
$sql = "SELECT member_login_key FROM ipb_members WHERE id = $mid";
$results = $wowdb->query($sql);
$member = $wowdb->fetch_array($results);
$wowdb->free_result($results);
// password matches?
if ($member['member_login_key'] != $_COOKIE['pass_hash'])
{
echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://your.ipb.site/index.php?act=Login&CODE=00">';
die();
}
} else {
echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://your.ipb.site/index.php?act=Login&CODE=00">';
die();
}
// IPB Integration
require_once ROOT_PATH . "sources/ipsclass.php";
require_once ROOT_PATH . "init.php";
require_once ROOT_PATH . "sources/ipsclass.php";
// IPB Integration
require_once "/path/to/ipbsdk_class.inc.php";
$SDK =& new IPBSDK();
if (!$SDK->is_loggedin()) {
echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://your.ipb.site/index.php?act=Login&CODE=00">';
die();
}
// IPB Integration
Users browsing this forum: No registered users and 0 guests