Platinum Partner

Check IPB User Credientials With PHP

I was recently writing a script that needed to interact log users in only if they had registered on an IPB 3 forum, and I couldn't find any tips on how to go about it. You may have to edit the table in the query if you have a table prefix.


function userLoginIpb($user, $password) {
	$query = mysql_query("SELECT `members_pass_salt`, `members_pass_hash`
			      FROM `members`
			      WHERE `name` = '$user'");
	$results = mysql_fetch_assoc($query);
	$password = md5(md5($results['members_pass_salt']).md5($password));
		if($password == $results['members_pass_hash']) {
			return true;
			}
			else {
				return false;
				}
}


Usage:

if(userLoginIpb($username, $password)) {
	echo 'logged in';
	}
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}