summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/comandos/gestores/gestor_Comandos.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/WebConsole/comandos/gestores/gestor_Comandos.php')
-rw-r--r--admin/WebConsole/comandos/gestores/gestor_Comandos.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/admin/WebConsole/comandos/gestores/gestor_Comandos.php b/admin/WebConsole/comandos/gestores/gestor_Comandos.php
index 2f6c706c..35c6c671 100644
--- a/admin/WebConsole/comandos/gestores/gestor_Comandos.php
+++ b/admin/WebConsole/comandos/gestores/gestor_Comandos.php
@@ -83,6 +83,7 @@ $atributos=str_replace('$',chr(9),$atributos);
$cadenaid="";
$cadenaip="";
$cadenamac="";
+$cadenaoga=""; // Clave de acceso a la API REST de OGAgent.
if(!empty($filtro)){ // Ambito restringido a un subconjuto de ordenadores
if(substr($filtro,strlen($cadenaid)-1,1)==";") // Si el Ășltimo caracter es una coma
@@ -208,11 +209,15 @@ if($sw_ejya=='on' || $sw_ejprg=="on" ){
$urls = array();
$ipsuccess = '';
// Compose array of REST URLs.
- foreach (explode (';', $cadenaip) as $ip) {
- $urls[$ip] = "https://$ip:8000/opengnsys/$urlcomando";
+ $auxIp = explode(';', $cadenaip);
+ $auxKey = explode(";", $cadenaoga);
+ $i = 0;
+ foreach ($auxIp as $ip) {
+ $urls[$ip] = "https://$ip:8000/opengnsys/$urlcomando?secret=".$auxKey[$i];
+ $i++;
}
// Launch concurrent requests.
- $responses = multiRequest($urls, array(CURLOPT_SSL_VERIFYHOST => false, CURLOPT_SSL_VERIFYPEER => false));
+ $responses = multiRequest($urls);
// Process responses array (IP as array index).
foreach ($responses as $ip => $data) {
if (isset($data)) {