<?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 (isset($_SESSION["triton"]["ircop"])) {
				
				if (is_file("../../system/cache/chat/u_".$param[1].".txt")) {
				
					if (isset($param[2])) 
						$channel = $param[2];
			
					$usernfo = file_get_contents("../../system/cache/chat/u_".$param[1].".txt");
					list($u_ip, $u_age, $u_gender, $u_picture, $u_logintime, $u_id) = explode("|", $usernfo);

					@touch("../../system/cache/chat/k_".ip2long($u_ip)."_".$channel.".txt");
					
					sleep(1);

					/* Unset the user's entry from the channel nicknames list */
					$usersList = $this -> getChannelData($channel, "users");
					$nickPosition = strpos($usersList, ":".$param[1].",");
					$usersList = substr_replace($usersList, '', $nickPosition - 1, strlen($param[1]) + 3);
					$this -> setChannelData($channel, "users", $usersList);

					$this -> sysMsg('SYS_KICK', array($param[1], $channel, $this->nickname));

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

?>