|
|
@@ -186,6 +186,7 @@ class Ressources extends DataTable implements ClientArea
|
|
|
);
|
|
|
return ['error' => $error->getMessage()];
|
|
|
}
|
|
|
+ $api->logout();
|
|
|
|
|
|
/**
|
|
|
* format model to array
|
|
|
@@ -193,40 +194,24 @@ class Ressources extends DataTable implements ClientArea
|
|
|
$data = [];
|
|
|
foreach ($ressources as $ressource)
|
|
|
{
|
|
|
- try {
|
|
|
- $manager = $api->getUserById($ressource['manager']['id'], $domainID);
|
|
|
- } catch (KerioApiException $error) {
|
|
|
- logModuleCall(
|
|
|
- 'kerioEmail',
|
|
|
- __FUNCTION__,
|
|
|
- $error,
|
|
|
- 'Debug Error',
|
|
|
- $error->getMessage()
|
|
|
- );
|
|
|
- return ['error' => $error->getMessage()];
|
|
|
- }
|
|
|
-
|
|
|
$ressourceArray = [
|
|
|
'id' => $ressource['id'],
|
|
|
'ressource' => $ressource['name'],
|
|
|
'description' => $ressource['description'],
|
|
|
'type' => $ressource['type'],
|
|
|
- 'manager' => $manager ? $manager . '@' . $this->getWhmcsParamByKey('domain') : '-',
|
|
|
+ 'manager' => $ressource['manager']['name'] . '@' . $ressource['manager']['domainName'],
|
|
|
'status' => $ressource['isEnabled'] ? 'active' : 'default'
|
|
|
];
|
|
|
|
|
|
$data[] = $ressourceArray;
|
|
|
}
|
|
|
|
|
|
- $api->logout();
|
|
|
-
|
|
|
-
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
__FUNCTION__,
|
|
|
$ressources,
|
|
|
'Debug Error',
|
|
|
- $manager
|
|
|
+ $data
|
|
|
);
|
|
|
|
|
|
$dataProv = new ArrayDataProvider();
|