<?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) {

			/* Unset the user's entry from the channel nicknames list */
			$usersList = $this -> getChannelData($this -> channel, "users");
			$nickPosition = strpos($usersList, ":".$this -> nickname.",");
			$usersList = substr_replace($usersList, '', $nickPosition - 1, strlen($this -> nickname) + 3);
			$this -> setChannelData($this -> channel, "users", $usersList);
			
			/* Broadcast the message */
			$this -> sysMsg('SYS_QUIT', array($this -> nickname));
			
			/* Set a quit timer */
			$_SESSION["triton"]["quit"] = time();
			$_SESSION["triton"]["stamp"] = 0;
			session_write_close();
			
			die();
		}
	}
	
?>