|
|
@@ -11,6 +11,7 @@ use ThurData\Servers\KerioEmail\Core\UI\Interfaces\ClientArea;
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\Widget\DataTable\DataProviders\Providers\ArrayDataProvider;
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\Widget\DataTable\DataTable;
|
|
|
use ThurData\Servers\KerioEmail\Api\KerioWhmcs;
|
|
|
+use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
@@ -109,6 +110,7 @@ class Settings extends DataTable implements ClientArea
|
|
|
*/
|
|
|
public function loadData()
|
|
|
{
|
|
|
+ $maildomain = $this->getWhmcsParamByKey('domain');
|
|
|
$api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
|
|
|
try {
|
|
|
$api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
|
|
|
@@ -124,29 +126,36 @@ class Settings extends DataTable implements ClientArea
|
|
|
return ['error' => $error->getMessage()];
|
|
|
}
|
|
|
|
|
|
+ $api->logout();
|
|
|
+
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
__FUNCTION__,
|
|
|
$domains,
|
|
|
'Debug Settings',
|
|
|
- 'Debug Settings'
|
|
|
+ $this->params
|
|
|
);
|
|
|
|
|
|
foreach($domains as $domain) {
|
|
|
- if(($domain['name']) === $this->getWhmcsParamByKey('domain')){
|
|
|
+ if(($domain['name']) === $maildomain){
|
|
|
$aliasList = $domain['aliasList'];
|
|
|
}
|
|
|
}
|
|
|
- logModuleCall(
|
|
|
- 'kerioEmail',
|
|
|
- __FUNCTION__,
|
|
|
- $error,
|
|
|
- 'Debug Error',
|
|
|
- $error->getMessage()
|
|
|
- );
|
|
|
+ $dkimSet = $api->getDkimDnsRecord($maildomain);
|
|
|
+ $dkimArray = explode(PHP_EOL,$dkimSet['detail']);
|
|
|
+ $dkimValue = explode(":",$dkimArray[1]);
|
|
|
+ $this->domainKey = ltrim($dkimValue[1]);
|
|
|
+ $dkimName = explode(":",$dkimArray[0]);
|
|
|
+ $this->dkimName = ltrim($dkimName[1]);
|
|
|
|
|
|
$api->logout();
|
|
|
|
|
|
+ // get settings from product configuration
|
|
|
+ $productManager = new ProductManager();
|
|
|
+ $productManager->loadById($this->params['pid']);
|
|
|
+ $this->spfConfig = $productManager->get('spf_string');
|
|
|
+ $this->dmarcConfig = $productManager->get('dmarc_string');
|
|
|
+
|
|
|
/**
|
|
|
* format model to array
|
|
|
*/
|