Selaa lähdekoodia

Just start reconf-sogo to also trigger SOGos restart after a successful reconfiguration

andryyy 8 vuotta sitten
vanhempi
sitoutus
68d455e154
1 muutettua tiedostoa jossa 4 lisäystä ja 18 poistoa
  1. 4 18
      data/web/inc/call_sogo_ctrl.php

+ 4 - 18
data/web/inc/call_sogo_ctrl.php

@@ -17,23 +17,9 @@ if ($_GET['ACTION'] == "start") {
 	if (isset($response['faultString'])) {
 		echo '<b><span class="pull-right text-warning">' . $response['faultString'] . '</span></b>';
 	}
-	else {
-    sleep(4);
-    $request = xmlrpc_encode_request("supervisor.startProcess", 'sogo', array('encoding'=>'utf-8'));
-    $context = stream_context_create(array('http' => array(
-    'method' => "POST",
-    'header' => "Content-Length: " . strlen($request),
-    'content' => $request
-    )));
-    $file = @file_get_contents("http://sogo:9191/RPC2", false, $context) or die("Cannot connect to $remote_server:$listener_port");
-    $response = xmlrpc_decode($file);
-    if (isset($response['faultString'])) {
-      echo '<b><span class="pull-right text-warning">' . $response['faultString'] . '</span></b>';
-    }
-    else {
-      echo '<b><span class="pull-right text-success">OK</span></b>';
-    }
-	}
+  else {
+    echo '<b><span class="pull-right text-success">OK</span></b>';
+  }
 }
 elseif ($_GET['ACTION'] == "stop") {
 	$request = xmlrpc_encode_request("supervisor.stopProcess", 'sogo', array('encoding'=>'utf-8'));
@@ -48,7 +34,7 @@ elseif ($_GET['ACTION'] == "stop") {
 		echo '<b><span class="pull-right text-warning">' . $response['faultString'] . '</span></b>';
 	}
 	else {
-    sleep(1);
+    sleep(4);
     $request = xmlrpc_encode_request("supervisor.stopProcess", 'reconf-domains', array('encoding'=>'utf-8'));
     $context = stream_context_create(array('http' => array(
     'method' => "POST",