Quote:
Originally Posted by skydancer
Yes, just edit the plugin and add at the top:
if (THIS_SCRIPT=='register') {
and at the bottom:
}
|
Skydance so it should look like this if we only one it to check users as they register on a site?
Code:
if (THIS_SCRIPT=='register') {
if ($vbulletin->session->vars['OPM'] == 0) {
OPM_proxy_check(IPADDRESS);
}
if ($vbulletin->session->vars['OPM'] == 2) {
// parse some global templates
eval('$gobutton = "' . fetch_template('gobutton') . '";');
eval('$spacer_open = "' . fetch_template('spacer_open') . '";');
eval('$spacer_close = "' . fetch_template('spacer_close') . '";');
eval('$headinclude = "' . fetch_template('headinclude') . '";');
eval('$header = "' . fetch_template('header') . '";');
eval('$footer = "' . fetch_template('footer') . '";');
eval(standard_error(fetch_error('OPM_Deny',IPADDRESS)));
}
function OPM_proxy_check($OPMremote) {
global $vbulletin, $db;
$cleaned['sessionhash'] = "'" . $db->escape_string($vbulletin->session->vars['dbsessionhash']) . "'";
$OPMlist = array(
"xbl.spamhaus.org" => array(4,5,6)
);
$OPMreverse = implode('.',array_reverse(explode('.',$OPMremote)));
foreach ($OPMlist as $OPMhost => $OPMcodes) {
$OPMresult = explode('.',gethostbyname($OPMreverse.".".$OPMhost));
if($OPMresult[0] = 127 && in_array($OPMresult[3],$OPMcodes)) {
$db->query_write("
UPDATE " . TABLE_PREFIX . "session
SET OPM = 2
WHERE " . TABLE_PREFIX . "sessionhash = $cleaned[sessionhash]
LIMIT 1
");
$vbulletin->session->vars['OPM'] = 2;
break;
}
}
if ($vbulletin->session->vars['OPM'] == 0) {
// This IP is okay for this session
$db->query_write("
UPDATE " . TABLE_PREFIX . "session
SET OPM = 1
WHERE " . TABLE_PREFIX . "sessionhash = $cleaned[sessionhash]
LIMIT 1
");
}
return;
}
}