|
@@ -37,7 +37,7 @@ class AccountDataProvider extends BaseDataProvider
|
|
|
$hid = $this->request->get('id');
|
|
$hid = $this->request->get('id');
|
|
|
$hosting = Hosting::where('id', $hid)->first();
|
|
$hosting = Hosting::where('id', $hid)->first();
|
|
|
$this->data['domain'] = $this->getWhmcsParamByKey('customfields')['maildomain'];
|
|
$this->data['domain'] = $this->getWhmcsParamByKey('customfields')['maildomain'];
|
|
|
-
|
|
|
|
|
|
|
+ $this->data['quota'] = 0;
|
|
|
$lang = di('lang');
|
|
$lang = di('lang');
|
|
|
$this->availableValues['status'] = [
|
|
$this->availableValues['status'] = [
|
|
|
Kerio::ACC_STATUS_ACTIVE => $lang->absoluteT('kerio','account','status','active'),
|
|
Kerio::ACC_STATUS_ACTIVE => $lang->absoluteT('kerio','account','status','active'),
|
|
@@ -101,23 +101,24 @@ class AccountDataProvider extends BaseDataProvider
|
|
|
);
|
|
);
|
|
|
return ['error' => $error->getMessage()];
|
|
return ['error' => $error->getMessage()];
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- logModuleCall(
|
|
|
|
|
- 'kerioEmail',
|
|
|
|
|
- __FUNCTION__,
|
|
|
|
|
- $domainID,
|
|
|
|
|
- 'Debug Add Account',
|
|
|
|
|
- $userID
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
$account['fullName'] = $this->formData['display_name'];
|
|
$account['fullName'] = $this->formData['display_name'];
|
|
|
if ($this->formData['quota'] > 0) {
|
|
if ($this->formData['quota'] > 0) {
|
|
|
$account['diskSizeLimit']['isActive'] = TRUE;
|
|
$account['diskSizeLimit']['isActive'] = TRUE;
|
|
|
$account['diskSizeLimit']['limit']['value'] = $this->formData['quota'];
|
|
$account['diskSizeLimit']['limit']['value'] = $this->formData['quota'];
|
|
|
$account['diskSizeLimit']['limit']['unit'] = $this->formData['unit'];
|
|
$account['diskSizeLimit']['limit']['unit'] = $this->formData['unit'];
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ $result1 = $api->modifyUser($userID, $account);
|
|
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
|
|
+ logModuleCall(
|
|
|
|
|
+ 'kerioEmail',
|
|
|
|
|
+ __FUNCTION__,
|
|
|
|
|
+ $error,
|
|
|
|
|
+ 'Debug Error',
|
|
|
|
|
+ $error->getMessage()
|
|
|
|
|
+ );
|
|
|
|
|
+ return ['error' => $error->getMessage()];
|
|
|
|
|
+ }
|
|
|
$fields['firstName'] = $this->formData['firstname'];
|
|
$fields['firstName'] = $this->formData['firstname'];
|
|
|
$fields['surName'] = $this->formData['lastname'];
|
|
$fields['surName'] = $this->formData['lastname'];
|
|
|
$fields['commonName'] = $this->formData['display_name'];
|
|
$fields['commonName'] = $this->formData['display_name'];
|
|
@@ -127,6 +128,27 @@ class AccountDataProvider extends BaseDataProvider
|
|
|
$fields['phoneNumberMobile'] = $this->formData['mobile_phone'];
|
|
$fields['phoneNumberMobile'] = $this->formData['mobile_phone'];
|
|
|
$fields['departmentName'] = $this->formData['department'];
|
|
$fields['departmentName'] = $this->formData['department'];
|
|
|
$fields['profession'] = $this->formData['profession'];
|
|
$fields['profession'] = $this->formData['profession'];
|
|
|
|
|
+ try {
|
|
|
|
|
+ $result2 = $api->setAddress($userID, $fields);
|
|
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
|
|
+ logModuleCall(
|
|
|
|
|
+ 'kerioEmail',
|
|
|
|
|
+ __FUNCTION__,
|
|
|
|
|
+ $error,
|
|
|
|
|
+ 'Debug Error',
|
|
|
|
|
+ $error->getMessage()
|
|
|
|
|
+ );
|
|
|
|
|
+ return ['error' => $error->getMessage()];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ logModuleCall(
|
|
|
|
|
+ 'kerioEmail',
|
|
|
|
|
+ __FUNCTION__,
|
|
|
|
|
+ $result1,
|
|
|
|
|
+ 'Debug Add Account',
|
|
|
|
|
+ $result2
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
|
|
|
return (new HtmlDataJsonResponse())->setMessageAndTranslate('emailAccountHasBeenAdded')->setStatusSuccess();
|
|
return (new HtmlDataJsonResponse())->setMessageAndTranslate('emailAccountHasBeenAdded')->setStatusSuccess();
|
|
|
|
|
|