<?php include "config.php"; include "pdo.class.php"; include "ImageFilter.class.php"; include "functions.php"; $pdo = Db::singleton(); $body = censorString(cleanVar($_POST['Body'], 'text')); $from = cleanVar($_POST['From'], 'phone'); $media = ''; $numMedia = $_POST['NumMedia']; if ($numMedia > 0) { for ($i = 0; $i <= $numMedia; $i++) { $key = 'MediaUrl' . $i; $media = $_POST[$key]; if (isset($media) && !empty($media)) { $media = cache_image($media, $id); $filter = new ImageFilter(); $score = $filter->GetScore($media); if (isset($score)) { if ($score >= 30) { unlink($media); } else { $res = $pdo->query("INSERT INTO call_log SET msg='{$body}',phonenumber='{$from}',photo='{$media}',type='s'"); } } } } }
print "ERR\n"; continue; } $szFilename = GetImageFile($szUrl, $GLOBALS["HELPER"]); if ($szFilename == null) { if ($GLOBALS["DEBUG_LEVEL"] > 0) { $GLOBALS["HELPER"]->WLOG(basename($szUrl) . " SKIP (no image)"); } print "ERR\n"; continue; } $t = time(); if ($GLOBALS["DEBUG_LEVEL"] > 0) { $GLOBALS["HELPER"]->WLOG("GetScore of {$szFilename}"); } $iScore = intval($filter->GetScore($szFilename)); @unlink($szFilename); $t2 = time(); $seconds = $t2 - $t; if ($GLOBALS["DEBUG_LEVEL"] > 0) { $GLOBALS["HELPER"]->WLOG(basename($szUrl) . ": {$iScore}% in ({$seconds}s)"); } SetCache($szUrl, $iScore); if ($iScore >= $iPicScanVal) { $array["POURC"] = $iScore; $tfile = "/var/log/squid/nudity/" . md5(serialize($array)); if (!is_file($tfile)) { @file_put_contents($tfile, serialize($array)); } if ($GLOBALS["DEBUG_LEVEL"] > 1) { $GLOBALS["HELPER"]->WLOG("BLOCK->" . $szMac . " " . $szUrl . " score:" . $iScore . " " . $iPicScanVal . " " . $iRes);
// // ISLAMIC RULES should be followed and respected if they differ // than terms of the GNU LESSER GENERAL PUBLIC LICENSE // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the license with this software; // If not, please contact support @ S y s T u r n .com to receive a copy. // if (isset($_FILES['userimage'])) { require_once 'filter.class.php'; $filter = new ImageFilter(); $score = $filter->GetScore($_FILES['userimage']['tmp_name']); } ?> <html> <head> <title>Image Filter Example</title> </head> <body> <?php if (isset($score)) { ?> <?php if ($score >= 30) { ?>