Registration Integration problem

Guernica

New Member
I am in the register.php code in vbulletin 3.8x on line 388.

I put in my code to register the user:

Code:
	$isbfguser = mysql_query("SELECT userid FROM bgallz_bfgamerz.users
	WHERE user_email = '".$vbulletin->GPC['email']."' LIMIT 1");

	if(mysql_num_rows($isbfguser) == 0){

	$activatecode = rand(1000000000,9999999999);
	$bfg_query = "INSERT INTO bgallz_bfgamerz.users
	(user_name,user_pass,user_email,user_hash,activate_code,timestamp,timezone)
	VALUES('".$vbulletin->GPC['username']."',
	'".$vbulletin->GPC['password_md5']."',
	'".$vbulletin->GPC['email']."',
	'".sha1($vbulletin->GPC['username'] . $vbulletin->GPC['password_md5'])."',
	'".$activatecode."',
	'".time()."',
	'".$vbulletin->GPC['timezoneoffset']."')";

	mysql_query($bfg_query) or die('Registration query error!');

For some reason the password field is sometimes empty. I have ran the registration on my own and tested it and it works. However I check the table in phpmyadmin and the password field for some people is blank and doesn't even exist (row) in the vbulletin sql table.

I assume it is a spambot or something but I wasn't sure if the variable:

$vbulletin->GPC['password_md5']

Was or could be empty sometimes...

Thanks!
 

Guernica

New Member
This seems to be happening when it is a spambot of some sort - going by the username's that they seem to be using.

I added:

if(empty($userdata->errors)){

// Reg code.

}

to make it better. Hopefully this will stop the mysql insert when it fails on vb's end. :p
 
Top