Location: PHPKode > scripts > HTTP class > http-class/sihelper.php
<?php
	// Helper class for transfering (updating) accounts to the data server
	class CSiServer
	{
		var $dns;
		var $http_user;
		var $http_pass;
		var $http_script;
		function CSiServer()
		{
			$this->dns;
			$this->http_user;
			$this->http_pass;
			$this->http_script;
		}
	}
	class CSiDSKey
	{
		var $keyVal;
		var $features;
		var $start;
		var $expireDate;
		var $downloads;
		var $enabled;
		var $trial;
		var $internal;
		var $id;
		function CSiDSKey()
		{
			$this->keyVal = "";
			$this->features = 0;
			$this->expireDate = "";
			$this->Start = "";
			$this->downloads = 0;
			$this->enabled = true;
			$this->trial = false;
			$this->internal = false;
			$this->id = 0;
		}
		function UpdateAccount(&$server, $bUpdate = false)
		{
			$flag = false;
			require_once("http.php");
			$http = &new CHttp;
			
			$http->server = $server->dns;
			$http->user = $server->http_user;
			$http->pass = $server->http_pass;
			$http->file = $server->http_script;

			$array = array();
			$array['id'] = $this->id;
			$array['key'] = $this->keyVal;
			$array['features'] = $this->features;
			$array['downloads'] = $this->downloads;
			$array['exp'] = $this->expireDate;
			$array['start'] = $this->start;
			$array['enabled'] = $this->enabled;
			$array['trial'] = $this->trial;
			$array['internal'] = $this->internal;
			if ($bUpdate)
				$array['update'] = true;
			if ($http->RequestFile($server->http_script, $response, $array) && IsResponseOk($response))
				$flag = true;
			return $flag;
		}
	}

	// Helper function to see if internal response is ok
	function IsResponseOk($response)
	{
		$flag = false;
		if (!empty($response))
		{
			require_once("xml.php");
			require_once("si_define.php");
			$xml = &new CXml;
			if ($xml->Parse($response) && $xml->root->name == KSDS_XML_TRANSFER_RESPONSE && ($item = $xml->root->FindNode(KSDS_XML_TRANSFER_RESPONSE_ERROR)) && !$item->value)
				$flag = true;
		}
		return $flag;	
	}
?>
Return current item: HTTP class