<?php

/******************************************************************

	Sample INDEXU Integration codes
	This file should be in 3rd party script

******************************************************************/


include "nusoap.php";

/******************************************************************/

$indexu_username = "dody";
$indexu_password = "dody";
$indexu_soap_key = "aabbcc";
$indexu_soap_url = "http://localhost/indexu/dev/upload/soap/server.php";

IndexuLogout(); 


/******************************************************************/
/* DO NOT CHANGE THE CODES BELOW                                  */
/******************************************************************/

function IndexuLogout() {
	
	global $indexu_soap_key, $indexu_soap_url;
	
  // GetUrl 

  $parameters = array('api_key' => $indexu_soap_key);
 	$soapclient = new soapclient($indexu_soap_url);
 	$url = $soapclient->call('GetUrl',$parameters);

		
	$arr = parse_url($url);
	$domain = $arr['host'];
	$path   = $arr['path'];
	$expire = time()-3600; 
		
  setcookie("COOKIE_USER_AUTHENTICATED", //string name
            "",                         //string value
            $expire,                     //int expire
            "$path",                     //string path
            "$domain",                   //string domain
            0                            //int secure
  );

  setcookie("COOKIE_USERNAME", //string name
            "",       //string value
             $expire,           //int expire
             "$path",           //string path
             "$domain",         //string domain
             0                  //int secure
  );

  setcookie("COOKIE_PASSWORD", //string name
            "",       //string value
            $expire,           //int expire
            "$path",           //string path
            "$domain",         //string domain
            0                  //int secure
  );			
}

?>