This is what I have so far to log in to Vbulletin from an external script. The salt system is not working, not really sure how to put it together. Anyone please?
Code:
function vbulletin_login($values){
$email = $values["username"];
$password = $values["password"];
//Get the url parameters and then sql escape them to prevent sql injections
$userin = mysql_real_escape_string($email);
$passin = mysql_real_escape_string($password);
// Query to pull out the salt value for the given user
$fetchrows = mysql_query("select * from vbuser WHERE username ='$userin'");
$r = @mysql_fetch_array($fetchrows);
$userpass = $r["password"];
$userid = $r["userid"];
$substatus = $r["usergroupid"];
$salt = $r["salt"];
define('COOKIE_SALT', 'LICENSE KEY HERE');
$fetchrowss = mysql_query("select * from vbsession WHERE userid ='$userid'");
$s = @mysql_fetch_array($fetchrowss);
$sessionhash = $s["sessionhash"];
setcookie("fnfuserid", $userid, time()+(60*60*24*365), "/", ".financeglobe.com", 1);
setcookie("fnfpassword", md5($password . COOKIE_SALT), time()+(60*60*24*365), "/", ".financeglobe.com", 1);
setcookie("fnfsessionhash", $sessionhash, time()+(60*60*24*365), "/", ".financeglobe.com", 1);
}//vbulletin_login