The online racing simulator
Inserting users into V-Bulletin database
Hey guys,

My plan is having it so that you use the command, '!forum email password' in the game server, and it will create the user an account on the forum using their LFS Username as the account username in the forums (vbulletin).

I have not yet looked into it, but does anybody know as to what encryption the password uses or anything?

I am guessing this would be a question for Victor seeing as he has linked the LFSW accounts to the forum here.

Thanks,
Mark
bah humbug
Do you have a vB license? Just read the source code for the login page, and follow that around, it should tell you what you need to do as far as SQL querys.

<?php 
$salt 
'';
for (
$i 0$i 3$i++)
    
$salt .= chr (rand(32126));
$md5password md5(md5($password).$salt);
?>

Store $md5password and $salt in vb's users table.
But you should also look at the default permissions for that user. And perhaps you want to add userfield(s). And you should create at least an empty usertextfield entry in the db.

Finally, update the serialised array stored in the datastore table going by the title 'userstats' so your forum's 'latest registration' text gets updated.

But take care with all this. There are more details - just have a close look at the users table to see which variables you should check.
Quote from Dygear :Do you have a vB license? Just read the source code for the login page, and follow that around, it should tell you what you need to do as far as SQL querys.

yeah I do have a licence for it, owned licence for v4.

Ended up doing a bit more googling and found a few snippets to produce this.


<?php 
  $newuser 
=& datamanager_init('User'$vbulletinERRTYPE_ARRAY);
  
$newuser->set('username'$username);
  
$newuser->set('email'$email);
  
$newuser->set('password'$password);
  
$newuser->set('usergroupid'2);

  if (
count($newuser->errors)>0) {
    
// handle the error (duplicate username, duplicate email)
  
} else {
    
// user created
    
$newuserid $newuser->save();
  }
?>

Do you always ask people first and then google it yourself?
Quote from Victor :Do you always ask people first and then google it yourself?

ha, no. its just a lot of the information that I was finding regarding the password hash contradicted the others many many times. Knowing that you had done it, I figured I would ask here in the hope of some help
Quote from Krammeh :

<?php 
  $newuser 
=& datamanager_init('User'$vbulletinERRTYPE_ARRAY);
  
$newuser->set('username'$username);
  
$newuser->set('email'$email);
  
$newuser->set('password'$password);
  
$newuser->set('usergroupid'2);

  if (
count($newuser->errors)>0) {
    
// handle the error (duplicate username, duplicate email)
  
} else {
    
// user created
    
$newuserid $newuser->save();
  }
?>


Cool! What file did you have to include to ensure that you had this datamangager_init class? (Just so others will know should they find this on the internet.)
Personally, I included what is included for the main forum view.


<?php 
if (defined('VB_RELATIVE_PATH'))
{
    
chdir('./' VB_RELATIVE_PATH);
}

require_once(
'./global.php');
require_once(
DIR '/includes/functions_bigthree.php');
require_once(
DIR '/includes/functions_forumlist.php');
?>

I'm sure this will be helpful to someone, thanks!

FGED GREDG RDFGDR GSFDG