data['domain'] = $this->getWhmcsParamByKey('domain'); $api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0'); try { $api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword')); $domainID = $api->getDomainId($this->getWhmcsParamByKey('domain')); } catch (KerioApiException $error) { logModuleCall( 'kerioEmail', __FUNCTION__, $error, 'Debug Error', $error->getMessage() ); return ['error' => $error->getMessage()]; } $fields = array( "id", "loginName", "isEnabled"); try { $users = $api->getUsers($fields,$domainID); } catch (KerioApiException $error) { logModuleCall( 'kerioEmail', __FUNCTION__, $error, 'Debug Error', $error->getMessage() ); return ['error' => $error->getMessage()]; } $api->logout(); foreach($users as $user) { if($user['isEnabled']){ $this->availableValues['manager'][ $user['id']] = $user['loginName'] . '@' . $this->getWhmcsParamByKey('domain'); } } $lang = di('lang'); $this->availableValues['status'] = [ Kerio::ACC_STATUS_ACTIVE => $lang->absoluteT('kerio','account','status','active'), Kerio::ACC_STATUS_CLOSED => $lang->absoluteT('kerio','account','status','closed'), ]; $this->availableValues['type'] = [ Kerio::RES_TYPE_LOCATION => $lang->absoluteT('kerio','ressource','type','location'), Kerio::RES_TYPE_EQUIPMENT => $lang->absoluteT('kerio','ressource','type','equipment') ]; } public function create() { } public function updateStatus() { } public function update() { } }