Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Integrating StopForumSpam

I was getting some nasty Tickets and I have done a bit of work to integrate StopForumSpam.

I did this by editing /open.php and adding the following code.

This work very well to check IP addresses but I would like to also check the email address.

Could someone tell me how to get the forms email address so that I can check that as well?

Thank you

====================================
        $ipAddress = $_SERVER['REMOTE_ADDR'];
        //$ipAddress = '91.200.12.7'; // Test IP -- See http://botscout.com/ for more..
        //$xmlUrl = "http://www.stopforumspam.com/api?email=" . urlencode($email) . "&ip=" . $loginip . "&f=json";
        $xmlUrl = "http://www.stopforumspam.com/api?ip=" . $ipAddress . "&f=json";

        $rawResult = null;
        $jsonResult = null;
        try {
            $rawResult = file_get_contents($xmlUrl); 
            $jsonResult = json_decode($rawResult);
        } catch (Exception $e) {
            $errors['err'] = $rawResult;
            $jsonResult = null;
        }

        if ($jsonResult && $jsonResult->success)
        {
            $isSpammerIP=($jsonResult->ip->appears == 1 ? true : false);
            $isSpammerEmail=($jsonResult->email->appears == 1 ? true : false);
            $isspammer |= $isSpammerIP || $isSpammerEmail;

            if ($isspammer)
                $errors['err']=__('You appear to be a submitting a SPAM request.');
        }
    }
==============================

Sign In or Register to comment.