fix
This commit is contained in:
+18
-4
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user