Sfoglia il codice sorgente

check reserved addresses

andre 4 anni fa
parent
commit
2b9903a98e
1 ha cambiato i file con 16 aggiunte e 0 eliminazioni
  1. 16 0
      zimbraAddressAvailable.php

+ 16 - 0
zimbraAddressAvailable.php

@@ -21,6 +21,8 @@ if($pos===false) {
 require_once(__DIR__ . '/../../../init.php');
 require_once(__DIR__ . '/api/Zm/Auth.php');
 require_once(__DIR__ . '/api/Zm/Account.php');
+// Mailhosting = 1, Nextcloudhosting = 3; Mailhosting + Nextcloud = 8
+define('zmAuthGids', [1, 3, 8]);
 use WHMCS\Database\Capsule;
 
 $whmcs = App::self();
@@ -30,7 +32,21 @@ if(!filter_var($accountName, FILTER_VALIDATE_EMAIL)) {
     echo "invalid";
     exit;
 }
+// check reserved mail addresses 
+$zmAuthPIDs = Capsule::table('tblproducts')
+	->select('id')
+	->where('gid', 'IN', zmAuthGids)
+	->get();
+logModuleCall(
+	'zimbrasingle',
+	__FUNCTION__,
+	$zmAuthPIDs,
+	'debug',
+	$accountName
+);
+
 
+// check active Zimbra Accounts
 $accessData = array('zimbraServer' => '', 'adminUser' => '', 'adminPass' => '');
 $serverGroupIDObj = Capsule::table('tblproducts')
 	->select('servergroup')