|
|
@@ -16,6 +16,7 @@ use ThurData\Servers\KerioEmail\Core\Http\JsonResponse;
|
|
|
use ThurData\Servers\KerioEmail\Core\Models\Whmcs\Hosting;
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\ResponseTemplates\HtmlDataJsonResponse;
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\DataProviders\BaseDataProvider;
|
|
|
+use ThurData\Servers\KerioEmail\Api\KerioWhmcs;
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
@@ -36,7 +37,7 @@ class AccountDataProvider extends BaseDataProvider
|
|
|
$hid = $this->request->get('id');
|
|
|
$hosting = Hosting::where('id', $hid)->first();
|
|
|
$this->data['domain'] = $this->getWhmcsParamByKey('customfields')['maildomain'];
|
|
|
-
|
|
|
+
|
|
|
$lang = di('lang');
|
|
|
$this->availableValues['status'] = [
|
|
|
Kerio::ACC_STATUS_ACTIVE => $lang->absoluteT('kerio','account','status','active'),
|
|
|
@@ -87,8 +88,9 @@ class AccountDataProvider extends BaseDataProvider
|
|
|
if ($domainID === FALSE) {
|
|
|
return "Error: Domain $maildomain not found";
|
|
|
}
|
|
|
+ $active = $this->formData['status'] === 'active' ? TRUE : FALSE;
|
|
|
try {
|
|
|
- $userID = $api->createUser($domainID, $this->formData['username'], $this->formData['password']);
|
|
|
+ $userID = $api->createUser($domainID, $this->formData['username'], $this->formData['password'], $active);
|
|
|
} catch (KerioApiException $error) {
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|