|
@@ -32,8 +32,7 @@ require_once(__DIR__ . '/api/Zm/Server.php');
|
|
|
* @param string $needle key to search for values
|
|
* @param string $needle key to search for values
|
|
|
* @return array of values
|
|
* @return array of values
|
|
|
*/
|
|
*/
|
|
|
-function zimbraSingleFindAll($haystack, $needle)
|
|
|
|
|
-{
|
|
|
|
|
|
|
+function zimbraSingleFindAll($haystack, $needle) {
|
|
|
$values = array();
|
|
$values = array();
|
|
|
$iterator = new RecursiveArrayIterator((array)$haystack);
|
|
$iterator = new RecursiveArrayIterator((array)$haystack);
|
|
|
$recursive = new RecursiveIteratorIterator(
|
|
$recursive = new RecursiveIteratorIterator(
|
|
@@ -247,19 +246,18 @@ function zimbraSingle_UsageUpdate($params) {
|
|
|
);
|
|
);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- $mboxObj = $apiAccountManager->getMailbox($product['username']);
|
|
|
|
|
- if(is_a($mboxObj, 'Exception')) {
|
|
|
|
|
|
|
+ $mboxInfo = $apiAccountManager->getMailbox($product['username']);
|
|
|
|
|
+ if(is_a($mboxInfo, 'Exception')) {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: could not fetch mailbox info for ' . $product['username'],
|
|
'Error: could not fetch mailbox info for ' . $product['username'],
|
|
|
- $mboxObj
|
|
|
|
|
|
|
+ $mboxInfo
|
|
|
);
|
|
);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- $mboxVars = get_object_vars($mboxObj);
|
|
|
|
|
- $mboxSize = $mboxVars['S'];
|
|
|
|
|
|
|
+ $mboxSize = $mboxInfo['S'];
|
|
|
try {
|
|
try {
|
|
|
Capsule::table('tblhosting')
|
|
Capsule::table('tblhosting')
|
|
|
->where('id', '=', $product['id'])
|
|
->where('id', '=', $product['id'])
|
|
@@ -392,6 +390,9 @@ function zimbraSingle_CreateAccount($params) {
|
|
|
return 'Error: could not find serviceclass ' . $params['configoption1'];
|
|
return 'Error: could not find serviceclass ' . $params['configoption1'];
|
|
|
}
|
|
}
|
|
|
$attrs['zimbraCOSId'] = $cosID;
|
|
$attrs['zimbraCOSId'] = $cosID;
|
|
|
|
|
+ $baseQuota = $params['configoption2'] ? $params['configoption2'] : 1;
|
|
|
|
|
+ $addonQuota = $params['configoptions']['addonQuota'] ? $params['configoptions']['addonQuota'] : 0;
|
|
|
|
|
+ $attrs['zimbraMailQuota'] = ($baseQuota + $addonQuota) * 1048576;
|
|
|
$zimbraID = $apiAccountManager->createAccount($params['username'], $params['password'], $attrs);
|
|
$zimbraID = $apiAccountManager->createAccount($params['username'], $params['password'], $attrs);
|
|
|
if(is_a($zimbraID, 'Exception')) {
|
|
if(is_a($zimbraID, 'Exception')) {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
@@ -703,6 +704,13 @@ function zimbraSingle_ConfigOptions($params) {
|
|
|
'Options' => implode(',', $cosNames),
|
|
'Options' => implode(',', $cosNames),
|
|
|
'Description' => 'Select COS',
|
|
'Description' => 'Select COS',
|
|
|
);
|
|
);
|
|
|
|
|
+ $configOptions['quota'] = array(
|
|
|
|
|
+ 'Type' => 'text',
|
|
|
|
|
+ 'Description' => 'Basis Mailbox-Quota für dieses Produkt in GB',
|
|
|
|
|
+ 'Default' => '5',
|
|
|
|
|
+ 'Size' => '3',
|
|
|
|
|
+ 'FriendlyName' => 'Mailbox Quota',
|
|
|
|
|
+ );
|
|
|
return $configOptions;
|
|
return $configOptions;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -743,7 +751,7 @@ function zimbraSingle_ServiceSingleSignOn($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error : could not fetch options for ' . $params['customfields']['maildomain'],
|
|
'Error : could not fetch options for ' . $params['customfields']['maildomain'],
|
|
|
- $domainOptions->getMessage()
|
|
|
|
|
|
|
+ $domainOptions
|
|
|
);
|
|
);
|
|
|
return array(
|
|
return array(
|
|
|
'success' => false,
|
|
'success' => false,
|