瀏覽代碼

add cwp7CheckLimit

andre 3 年之前
父節點
當前提交
1725ee6dc2
共有 1 個文件被更改,包括 24 次插入0 次删除
  1. 24 0
      cwp7.php

+ 24 - 0
cwp7.php

@@ -282,6 +282,8 @@ function cwp7_ClientArea($params) {
 			$response
 		);
 	}
+	cwp7CheckLimit($params,'test');
+
 	$domains = $response['result']['domains'];
 	$subDomains = $response['result']['subdomins'];
 	$clientInfo['domains'] = array();
@@ -1149,3 +1151,25 @@ function cwp7CheckSOA($domain, $nameserverIP, $nameserverName ) {
 	}
 	return $result->answer[0]->mname;
 }
+
+/**
+ * Check limits for a service of an account .
+ *
+ * @param array $params common module parameters
+ * @param string $service target service for check
+ *
+ * @see https://developers.whmcs.com/provisioning-modules/supported-functions/
+ *
+ * @return bool 'none' -> not registered, 'self' -> registered at own or the name of an other responsible nameserver
+ */
+function cwp7CheckLimit($params, $service) {
+	$cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
+	$response = $cwp7->getQuota($params['username']);
+	logModuleCall(
+		'cwp7',
+		__FUNCTION__,
+		$response,
+		'debug',
+		$service
+	);
+}