ajout des commmandes enable/disable hooks
This commit is contained in:
		@@ -119,9 +119,13 @@ function apiServer($read)
 | 
			
		||||
						case "type":
 | 
			
		||||
							logger(DEBUG, $command . _(" reached"), __FILE__ . ":" . __LINE__);
 | 
			
		||||
							//htmlSend($spawn, apiDisplayByType($argList));
 | 
			
		||||
						/*case "stats":
 | 
			
		||||
						case "enable":
 | 
			
		||||
							logger(DEBUG, $command . _(" reached"), __FILE__ . ":" . __LINE__);
 | 
			
		||||
							displayStats($spawn, $argList);*/
 | 
			
		||||
							htmlSend($spawn, apiHookActive($argList, true));
 | 
			
		||||
							break;
 | 
			
		||||
						case "disable":
 | 
			
		||||
							logger(DEBUG, $command . _(" reached"), __FILE__ . ":" . __LINE__);
 | 
			
		||||
							htmlSend($spawn, apiHookActive($argList, false));
 | 
			
		||||
							break;
 | 
			
		||||
						case "verbose":
 | 
			
		||||
							logger(DEBUG, $command . _(" reached"), __FILE__ . ":" . __LINE__);
 | 
			
		||||
 
 | 
			
		||||
@@ -507,6 +507,26 @@ function PropertiesDashboard($argList)
 | 
			
		||||
	}
 | 
			
		||||
	return "json=" . $response;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function apiHookActive($argList, $status)
 | 
			
		||||
{
 | 
			
		||||
	global $hooks;
 | 
			
		||||
	if (array_key_exists($argList["hook"], $hooks))
 | 
			
		||||
	{
 | 
			
		||||
		$hooks[$argList["hook"]]->active = $status;
 | 
			
		||||
		if ($status)
 | 
			
		||||
		{
 | 
			
		||||
			return $argList["hook"] . _(" has been enabled");
 | 
			
		||||
		}else
 | 
			
		||||
		{
 | 
			
		||||
			return $argList["hook"] . _(" has been disabled");
 | 
			
		||||
		}
 | 
			
		||||
	}else
 | 
			
		||||
	{
 | 
			
		||||
		return _("Hook does not exists");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
/*
 | 
			
		||||
function apiDisplayByType($argList)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user