Merge branch 'ent-13575-seccion-api-checker-no-funciona' into 'develop'

Ent 13575 Sección Api Checker no funciona.

See merge request artica/pandorafms!7333
This commit is contained in:
Diego Muñoz-Reja 2024-05-03 12:13:17 +00:00
commit d30cc27112
1 changed files with 28 additions and 25 deletions

View File

@ -69,38 +69,41 @@ function api_execute(
if (empty($url) === true) { if (empty($url) === true) {
$url = 'http://'.$ip.$pandora_url.'/include/api.php?'; $url = 'http://'.$ip.$pandora_url.'/include/api.php?';
} else {
$url_schema = parse_url($url);
$url = $url_schema['scheme'].'://'.$url_schema['host'].$pandora_url.'/include/api.php?';
}
if (empty($op) === false) { if (empty($op) === false) {
$data['op'] = $op; $data['op'] = $op;
} }
if (empty($op2) === false) { if (empty($op2) === false) {
$data['op2'] = $op2; $data['op2'] = $op2;
} }
if (empty($id) === false) { if (empty($id) === false) {
$data['id'] = $id; $data['id'] = $id;
} }
if (empty($id2) === false) { if (empty($id2) === false) {
$data['id2'] = $id2; $data['id2'] = $id2;
} }
if (empty($return_type) === false) { if (empty($return_type) === false) {
$data['return_type'] = $return_type; $data['return_type'] = $return_type;
} }
if (empty($other) === false) { if (empty($other) === false) {
$data['other_mode'] = $other_mode; $data['other_mode'] = $other_mode;
$data['other'] = $other; $data['other'] = $other;
} }
// If token is not reported,use old method. // If token is not reported,use old method.
if (empty($token) === true) { if (empty($token) === true) {
$data['apipass'] = $apipass; $data['apipass'] = $apipass;
$data['user'] = $user; $data['user'] = $user;
$data['pass'] = $password; $data['pass'] = $password;
}
} }
$url_protocol = parse_url($url)['scheme']; $url_protocol = parse_url($url)['scheme'];