Ejemplo n.º 1
0
define('DIRECT_ACCESS', 1);
if (!defined('DIRECT_ACCESS')) {
    // if our flag is not defined,
    // user is accessing our file directly
    die('ERR: access denied');
    exit;
}
require_once 'f-settings.php';
require_once 'c-pdo.php';
$db = new dbHelper();
error_log("{$time} [{$script_name}] [dosportal] [{$remote_addr}-{$myuser}] [request for {$script_name}]\n", 3, $log_file);
$error = "";
if (isset($_GET['ip'])) {
    $ip = $_GET['ip'];
    if (filter_var($ip, FILTER_VALIDATE_IP)) {
        $rows = $db->rawSelect("SELECT id, inet6_ntop(sourceip) as ip, cidr, type, inserttime, expiretime, hits, country, comment, insertby, allow_edit FROM history WHERE inet6_ntop(sourceip)='{$ip}'");
    } else {
        $error = "YES";
        $rows['status'] = " warning ";
        $rows['messages'] = " no data returned ";
    }
} else {
    // no GET parameters sent, someone is malicious
    $error = "YES";
    $rows['status'] = " warning ";
    $rows['messages'] = " no data returned ";
}
?>
<!doctype html>
<html lang="en-US">
<head>