Hi Guys... I’ve done it... so here it is....
This needs to go at the top of the file (eform.inc.php)....
$remoteip = $_SERVER["REMOTE_ADDR"];
then add this to your eform.inc.php file just under the vericode check on line 224....
// Add $remoteip to placeholder
if(!strstr($tpl,'[+remoteip+]'))
$fields['remoteip'] = str_replace('[+remoteip+]', 'IP:', $remoteip);
if ($eFormOnValidate) {
//Check banned IPs
$banipres = $modx->db->select('ip', $modx->getFullTableName('banip'),"ip='".$remoteip."'");
$baniprows = mysql_num_rows($banipres);
if ($baniprows > 0){
$url = $modx->makeURL('11'); // Please note put your resource id... in here!
$modx->sendRedirect($url); // return 'The Banned Email list!'; //we have a match - this email is banned
}
//Check banned emails
$banemailres = $modx->db->select('email', $modx->getFullTableName('banemail'),"email='".$fields['email']."'");
$banrows = mysql_num_rows($banemailres);
if ($banrows > 0){
$url = $modx->makeURL('11'); Please note put your resource id... in here!
$modx->sendRedirect($url); // return 'The Banned Email list!'; //we have a match - this email is banned
}
}
and to give us the details of the Remote IP [+remoteip+] in the chunk (report) which is sent with all emails!
I owe a big thanks to J Stover from Connecticut, USA who has helped me on this one!
Please let me know if you have problems implementing, I will be glad to help!
Thanks all!
Paul