Jelajahi Sumber

Panel Setting API

own3mall 6 tahun lalu
induk
melakukan
7d429b9861
2 mengubah file dengan 6 tambahan dan 2 penghapusan
  1. 4 0
      includes/api_functions.php
  2. 2 2
      ogp_api.php

+ 4 - 0
includes/api_functions.php

@@ -55,6 +55,10 @@ function get_function_args($main_request)
 
 	//______________ Steam Workshop
 	$functions["steam_workshop/install"] = array("token" => true, "ip" => true, "port" => true, "mod_key" => false, "mods_list" => true);
+	
+	//______________ Settings
+	$functions["setting/get"] = array("token" => true, "setting_name" => true);
+	
 	if($main_request == "all")
 		return $functions;
 	return isset($functions["$main_request"])?$functions["$main_request"]:false;

+ 2 - 2
ogp_api.php

@@ -136,14 +136,14 @@ if(function_exists($function))
 			$function_args = get_function_args("$func_req");
 		
 		if(!$function_args)
-			outputJSON(array("status" => "400", "message" => "BAD REQUEST"));
+			outputJSON(array("status" => "400", "message" => "BAD REQUEST - CANT FIND FUNCTION ARGS"));
 		elseif(!(($func_req == "token/test" and isset($request[1])) OR ($func_req == "token/create" and isset($request[1]) and isset($request[2]))))
 		{
 			foreach($function_args as $arg => $mandatory)
 			{
 				if($mandatory and !isset($_POST["$arg"]))
 				{
-					outputJSON(array("status" => "400", "message" => "BAD REQUEST", "fields_supplied" => $_POST, "fields_required" => $function_args));
+					outputJSON(array("status" => "400", "message" => "BAD REQUEST - MISSING REQUIRED ARGS", "fields_supplied" => $_POST, "fields_required" => $function_args));
 					break;
 				}
 			}