This commit is contained in:
2022-05-30 08:59:05 -04:00
parent 30f19d771d
commit cd8afaf1b1
4 changed files with 82 additions and 52 deletions
+18 -4
View File
@@ -30,10 +30,13 @@ $endpoints = array(
'getpendingjobs' => array('POST'),
'taskmessage' => array('POST'),
'sendtaskmessage' => array('POST'),
'getwallets' => array('POST')
'getwallets' => array('POST'),
'sitecontact' => array('POST')
);
$call_backend = true; // sometimes we need to overwite the call to the extenstion API
$local_out = []; // use local out to send output when the result is not from the extenstion
$ret = -1;
/*
header("Access-Control-Allow-Origin: *");
@@ -91,6 +94,10 @@ if ($_SERVER["REQUEST_METHOD"] == "GET") {
}
$in["loc"] = $_SERVER["REMOTE_ADDR"];
switch ($endpoint) {
case 'sitecontact':
$local_out = ['result'=>'100','msg'=>'Recieved'];
$call_backend = false;
break;
case 'generics':
case 'apigate':
//$in["action"] = WRENCHBOARD_ACCOUNT_LOGIN;
@@ -179,8 +186,15 @@ $in["pid"] = 100;
//file_put_contents("in_debug.log", $in); // DEBUG
$out = array();
$ret = $wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret; // this is reserved array parameter - to be caprured and reoved before you use the out array()
if ( $call_backend == true){
$ret = $wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret; // this is reserved array parameter - to be caprured and reoved before you use the out array()
}
else
{
$out = $local_out;
}
header("HTTP/1.1 200 OK");
header("Status: 200 OK");