ソースを参照

clientareafunctions

andre 3 年 前
コミット
8ac3596c76
1 ファイル変更14 行追加1 行削除
  1. 14 1
      api/cwp7/Admin.php

+ 14 - 1
api/cwp7/Admin.php

@@ -249,7 +249,7 @@ class cwp7_Admin {
             'user'      => $params['user'],
             'type'      => $params['type'],
             'name'      => $params['name'],
-            'path'      => 'domains/' . $params['name'],
+            'path'      => '/domains/' . $params['name'],
             'autossl'   => 0,
         );
         return $this->doRequest('admindomains', 'add', $data);
@@ -398,6 +398,19 @@ class cwp7_Admin {
         curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
         curl_setopt($ch, CURLOPT_POST, 1);
         $response = curl_exec($ch);
+        if(curl_getinfo($ch, CURLINFO_RESPONSE_CODE) != 200) {
+            curl_close($ch);
+
+        logModuleCall(
+            'cwp7',
+            __FUNCTION__,
+            $data,
+            'debug addDomain',
+            $response
+        );
+
+            return array('status' => 'Error', 'err_msg' => curl_error($ch));
+        };
         curl_close($ch);
         return json_decode($response, true);
     }