andre 3 лет назад
Родитель
Сommit
f05abb1bfb
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      cwp7.php

+ 5 - 5
cwp7.php

@@ -478,13 +478,13 @@ function cwp7_delSubdomain($params) {
 		);
 	}
 	$domains = $response['result']['domains'];
-	$clientdomains = array();
-	foreach($domains as $domain){
-		if($domain['domain'] != $params['domain']) {
-			array_push($clientdomains, $domain['domain']);
+	$clientsubdomains = array();
+	foreach($subdomains as $subdomain){
+		if($subdomain['domain'] != $params['domain']) {
+			array_push($clientsubdomains, $subdomain['subdomain'] . "." . $subdomain['domain']);
 		}
 	}
-	if(!in_array($_POST['d'], $clientdomains)) {
+	if(!in_array($_POST['d'], $clientsubdomains)) {
 		return 'Error: ' . $_POST['d'] . ' not in client domains';
 	}