0) { break; } // if } // foreach return $email_address; } // GetEmails function LogViolation ($ip, $email_address, $page) { global $date; $filename = "/web/violation.log"; $fh = fopen ($filename, "a"); $msg = ""; if ($email_address == "") { $msg = "$date $ip attempted to access $page - No email address found to report violation to\n"; } else { $msg = "$date $ip attempted to access $page - violation reported to $email_address\n"; } // if fwrite ($fh, $msg); fclose ($fh); } // LogViolation function SendViolation ($ip, $email_address) { $domain = "DeFaria.com"; $contact = "Andrew@DeFaria.com"; $subject = "Illegal attempts to break into $domain from your domain ($ip)"; $message = " $subject

$subject

On $date somebody from your domain with an IP Address of $ip has been attempting to break into my domain, $domain. Breaking into somebody else's computer is illegal and criminal prosecution can result. As a responsible ISP it is in your best interests to investigate such activity and to shutdown any such illegal activity as it is a violation of law and most likely a violation of your user level agreement. It is expected that you will investigate this and send the result and/or disposition of your investigation back to $contact. If you fail to do so then criminal prosecution may result! "; // To send HTML mail, the Content-type header must be set $extra_headers = "MIME-Version: 1.0\n"; $extra_headers .= "Content-type: text/html; charset=iso-8859-1\n"; // Additional headers $extra_headers .= "From: Andrew DeFaria <$contact>\n"; //$extra_headers .= "Cc: $contact\n"; if (mail ($email_address, $subject, $message, $extra_headers)) { print "Sent violation report to $email_address
"; } else { print "Error sending violation report to $email_address
"; } // if } // function ?>

Your violation has been reported!

You have purposely and illegal probed my site to arrive at this page. As a result your IP address has been logged and a report was sent to your ISP.

", $page); } else { foreach ($email_addresses as $email_address) { SendViolation ($ip, $email_address); LogViolation ($ip, $email_address, $page); } // foreach } // if ?>