<?php
///////////////////////////////////////////////////////////////////////////////////////
// PHPizabi 0.848b C1 [ALICIA]                               http://www.phpizabi.net //
///////////////////////////////////////////////////////////////////////////////////////
// Please read the license.txt file before using / modifying this software           //
// Original author:         Claude Desjardins, R - feedback@realitymedias.com        //
// Last modification date:  February 21th 2007                                       //
// Version:                 PHPizabi 0.848b C1                                       //
//                                                                                   //
// (C) 2005, 2007 Real!ty Medias / PHPizabi - All rights reserved                    //
///////////////////////////////////////////////////////////////////////////////////////

	class t_command extends triton {
		function runCommand($param, $channel=NULL) {
		
			if (is_file("../../system/cache/chat/u_".$param[1].".txt")) {
			
				$whois = file_get_contents("../../system/cache/chat/u_".$param[1].".txt");
				list($u_ip, $u_age, $u_gender, $u_picture, $u_logintime, $u_id) = explode("|", $whois);
				
				if (isset($_SESSION["triton"]["ircop"])) {
					
					if (preg_match('/\\b(?:[0-9]{1,3}\\.){3}[0-9]{1,3}\\b/', $u_ip)) {
						if ($result = gethostbyaddr($u_ip))
							$u_host = $result;
						else $u_host = $u_ip;
					}
					
					else {
						$u_host = $u_ip;
						if ($result = gethostbyname($u_host))
							$u_ip = $result;
					}
				}
				
				else {
					$u_ip = "N/A";
					$u_host = "N/A";
				}
				
				$this -> localEcho('ECHO_WHOIS', array(
					$param[1], 
					$u_ip,
					$u_host,
					$u_age,
					$u_gender,
					$u_id,
					date("r", $u_logintime)
				));

			}
			else $this -> localEcho('ERR_NOSUCHNICK', array($param[1]));
		}
	}

?>