Quote:
Originally Posted by ShannonA
Maybe I'm misunderstanding you, but the code certainly seems to add the email address all on its own:
In this example, $field would be email and $data would be $email.
The problem is that sfsProcess() seems to be getting really weird results from the two variables I noted:
Including blanks for $email, or at least that's what it's logging.
|
change
PHP Code:
global $vbulletin;
$ip = $vbulletin->session->vars['host'];
$username = $vbulletin->userinfo['username'];
$email = $vbulletin->GPC['email'];
// todo handle the null error results.
$result = checkSFSSpam($username, 'username');
if ($result !== VBSFS_NO_TEST) {
sfsActions('username', $username, $username, $email,$ip, $result);
}
$result = checkSFSSpam($ip, 'ip');
if ($result !== VBSFS_NO_TEST) {
sfsActions('ip', $ip, $username, $email, $ip, $result);
}
$result = checkSFSSpam($email, 'email');
if ($result !== VBSFS_NO_TEST) {
sfsActions ('email', $email, $username, $email, $ip, $result);
}
to
PHP Code:
global $vbulletin, $userdata;
$ip = $vbulletin->session->vars['host'];
$username = $vbulletin->userinfo['username'];
$email = $vbulletin->GPC['email'];
if (($email == '') && (isset($userdata))) { // hook for new FB Connect procedures
$username = $userdata->fetch_field('username');
$email = $userdata->fetch_field('email');
}
$message = ' GPC_user: '.$vbulletin->GPC['username'].' GPC_email: '.$vbulletin->GPC['email'];
$message .= ' Data_user: '.$userdata->fetch_field('username').' Data_email:'.$userdata->fetch_field('email');
$message .= ' Info_user: '.$vbulletin->userinfo['username'].' Info_email: '.$vbulletin->userinfo['email'];
$message .= ' REQ_username: '.$_REQUEST['username'].' REQ_email: '.$_REQUEST['email'];
if (($username != '') && ($username != 'Unregistered')) { //disable check if not set
$result = VBSFSSpam($username, 'username');
if ($result !== VBSFS_NO_TEST) {
sfsActions ('username', $username, $username, $email, $ip, $result);
}
}
if ($email != '') { //disable check if not set
$result = VBSFSSpam($email, 'email');
if ($result !== VBGHSFS_NO_TEST) {
sfsActions ('email', $email, $username, $email, $ip, $result);
}
}
$result = VBSFSSpam($ip, 'ip');
if ($result !== VBSFS_NO_TEST) {
sfsActions ('ip', $ip, $username, $email, $ip, $result);
}