Explorar el Código

add function testconnection

andre hace 3 años
padre
commit
547a25c325
Se han modificado 2 ficheros con 13 adiciones y 1 borrados
  1. 10 0
      api/cwp7/Admin.php
  2. 3 1
      cwp7.php

+ 10 - 0
api/cwp7/Admin.php

@@ -300,6 +300,16 @@ class cwp7_Admin {
         $data = array('user' => $params['user'], 'name' => $params['name']);
         return $this->doRequest('autossl', 'del', $data);
     }
+	/**
+	 * getServerType
+	 * 
+	 * @return array status or error
+	 */
+    public function getServerType()
+	{
+        $data = array();
+        return $this->doRequest('typeserver', 'list', $data);
+    }
 
     /**
      * doRequest

+ 3 - 1
cwp7.php

@@ -28,12 +28,14 @@ function cwp7_MetaData() {
 }
 
 function cwp7_Testconnection($params) {
+	$cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
+	$response = $cwp7->getServerType();
 	logModuleCall(
 		'cwp7',
 		__FUNCTION__,
 		$params,
 		'Debug',
-		''
+		$response
 	);
 	return array(
         'success' => true,