<?php

	$sql = "INSERT IGNORE INTO ".DB_WARPIT_WEBCATI_BASE."._www_ids SET 
				id_user = 		".$_SESSION['UserInfo']['id'].",
				user_type =		4,
				id_project = 	".($_SESSION['capi']['id_project'] * -1).",
				id_site = 		".$lastID.",
				loginSID =		'".substr(md5(time().$_SESSION['UserInfo']['id'].$_SESSION['capi']['id_project']),0,15)."-'";	
	$db->SQLexecute($sql);
	
	$sql = "UPDATE IGNORE ".DB_WARPIT_WEBCATI_BASE."._www_ids 
				SET 
					loginSID = CONCAT(loginSID,id), 
					id_project = ".$_SESSION['capi']['id_project']." 
			
			WHERE id_project = -".$_SESSION['capi']['id_project'];				
	$db->SQLexecute($sql);

	$sql = "DELETE FROM  ".DB_WARPIT_WEBCATI_BASE."._www_ids WHERE id_project = -".$_SESSION['capi']['id_project'];				
	$db->SQLexecute($sql);
	
?>
