andre пре 10 месеци
родитељ
комит
bf6b6e7870
3 измењених фајлова са 25 додато и 4 уклоњено
  1. 21 0
      api/sitebuilder.php
  2. 3 3
      siteBuilder.php
  3. 1 1
      whmcs.json

+ 21 - 0
api/sitebuilder.php

@@ -9,6 +9,27 @@ class ApiClient {
         $this->apiKey = $apiKey;
     }
      
+    /**
+     * Check accessibility to the Server
+     *
+     * @param adminName:       The Super-Admin User of the CRM System (usually the e-mail of the customer
+     * @param adminPassword:   A self randomly generated password
+     *
+     * @return string          'pong' on success
+     *
+     * Attention: The given parameters username, adminName and adminPassword must be
+     *            stored locally for the Single Sign on from whcms plugin
+     *
+     */
+    public function ping($adminName, $adminPassword) {
+        $url = "$this->apiUrl/ping/test/test";
+        $data = [
+            'admin_name' => $adminName,
+            'admin_password' => $adminPassword
+        ];
+        return $this->sendRequest('POST', $url, $data);
+    }
+  
     /**
      * Initially deploy the development site for the customer
      *

+ 3 - 3
siteBuilder.php

@@ -54,9 +54,9 @@ function siteBuilder_MetaData() {
  * @return array
  */
 function siteBuilder_Testconnection($params) {
-	$siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
-	$response = $siteBuilder->getServerType();
-	if($response['status'] == 'OK') {
+	$siteBuilder = new ApiClient($params['serverhostname'], $params['serveraccesshash']);
+	$response = $siteBuilder->ping($params['serverusername'], $params['serverpassword']);
+	if($response == 'pong') {
 		return array(
 			'success' => true,
 			'error' => '',

+ 1 - 1
whmcs.json

@@ -6,7 +6,7 @@
   "category": "provisioning",
   "description": {
     "name": "siteBuilder",
-    "tagline": "Webhosting Provisioning Module for WHMCS.",
+    "tagline": "aiteBuilder Provisioning Module for WHMCS.",
     "short": "siteBuilder users can be easily provoked with this module. The customer can also reset his password.",
     "long": "The module allows single-user provisioning of siteBuilder accounts. It implements a simple hosting."
   },