mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-04 12:14:12 +00:00 
			
		
		
		
	Created components class & default userID
This commit is contained in:
		@@ -23,12 +23,12 @@ require PROJECT_PATH."3rdparty/RestServer/RestServer.php";
 | 
			
		||||
//Allow remote requests
 | 
			
		||||
header("Access-Control-Allow-Origin: *");
 | 
			
		||||
 | 
			
		||||
//By default format is json
 | 
			
		||||
//By default return format is json
 | 
			
		||||
if(!isset($_GET["format"]))
 | 
			
		||||
	$_GET['format'] = "json";
 | 
			
		||||
 | 
			
		||||
//Check client tokens
 | 
			
		||||
if($cs->config->get("site_mode") == "debug"){
 | 
			
		||||
if($cs->config->get("site_mode") == "debug"){ //DEBUG ONLY
 | 
			
		||||
	$_POST['serviceName'] = "testService";
 | 
			
		||||
	$_POST['serviceToken'] = "testPasswd";
 | 
			
		||||
}
 | 
			
		||||
@@ -50,6 +50,10 @@ if(isset($_POST['userToken1']) AND isset($_POST['userToken2'])){
 | 
			
		||||
	//Else save userID
 | 
			
		||||
	define("userID", $userID);
 | 
			
		||||
}
 | 
			
		||||
else {
 | 
			
		||||
	//Defined userID is number 0
 | 
			
		||||
	define("userID", 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Handle Rest requests
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user