vBulletin use a different way of HASHING the password for users (vb_user table), we have been able to allow a Coldfusion page to retrieve the username and password to allow you to use the vBulletin database on your website for account.
With this you will get an idea on adding new records into the database from non-vbulletin pages.
First thing to do is access the Coldfusion administrator and add the vBulletin MySQL database as a datasource (DSN).
When you have done this to test that you can connect to the database add this to your CF page:
<cfquery name=”rs_users” datasource=”vb_forum”>
SELECT userid, username, password, email, salt
FROM vb_user
</cfquery>
<cfdump var=”#rs_users#”>
This will run a cfdump of the content of the table, there are many more columns that just “userid, username, password, email, salt” but these are the important ones for now.
Now for the code that will make your application work with vBulletin’s database:
<cfif IsDefined(‘FORM.username’) AND FORM.username NEQ ”>
<cfquery name=”rs_user” datasource=”vb_forum”>
SELECT username, password, salt
FROM vb_user
WHERE username = ‘#FORM.username#’
</cfquery>
<cfset vbPassword = #lCase(HASH(lCase(HASH(FORM.password, “MD5″)) & #rs_user.salt#, “MD5″))#>
<cfquery name=”rs_finduser” datasource=”vb_forum”>
SELECT userid, username, password, email
FROM vb_user
WHERE username = ‘#FORM.username#’
AND password = ‘#vbPassword#’
</cfquery>
<cfdump var=”#rs_finduser#”>
</cfif>
<form name=”login” method=”post”>
Username: <input name=”username” /><br />
Password: <input name=”password” /><br />
<input name=”submit” type=”submit” />
</form>
From this you can now set your SESSIONS and start using data from the vBulletin database to integrate your website better.
Hope you find this useful.