Пример #1
0
function databaseAliases($service_id, $name, $realm, $depth = 1, &$array, $hours = 720, &$iparray = array())
{
    if ($depth > 3) {
        return;
    }
    //set the parameter player as seen
    $array[$name . '@' . $realm] = true;
    //decrement depth
    $depth--;
    //find used IP addresses
    $used_ips = databaseIPlookup($service_id, $name, $realm, $hours);
    foreach ($used_ips as $ip) {
        if (!isset($iparray[$ip])) {
            $iparray[$ip] = true;
            $names = databaseNameLookup($service_id, $ip);
            foreach ($names as $p_array) {
                $player = $p_array[0] . "@" . $p_array[1];
                if (!isset($array[$player])) {
                    $array[$player] = true;
                    if ($depth > 0) {
                        databaseAliases($service_id, $p_array[0], $p_array[1], $depth, $array, $hours, $iparray);
                    }
                }
            }
        }
    }
}
Пример #2
0
<?php

include "../include/common.php";
include "../config.php";
include "../include/session.php";
include "../include/dbconnect.php";
include "../include/account.php";
include "../include/database.php";
if (isset($_SESSION['account_id']) && isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) && isset($_SESSION['is_' . $_REQUEST['id'] . '_database'])) {
    $ip = $_SERVER['REMOTE_ADDR'];
    if (isset($_REQUEST['ip'])) {
        $ip = htmlspecialchars($_REQUEST['ip']);
    }
    $players = databaseNameLookup($_REQUEST['id'], $ip);
    $nicePlayers = array();
    foreach ($players as $player) {
        $nicePlayers[] = array($player[0], $player[1], databaseLastPlayed($_REQUEST['id'], $player[0]));
    }
    get_page("namelookup", "database", array('service_id' => $_REQUEST['id'], 'players' => $nicePlayers));
} else {
    header("Location: ../panel/");
}