login($params['serverhostname'], $params['serverusername'], $params['serverpassword']); $domainID = $api->getDomainId($params['domain']); } catch (KerioApiException $error) { logModuleCall( 'kerioEmail', __FUNCTION__, $error, 'Debug Error', $error->getMessage() ); return ['error' => $error->getMessage()]; } if ($domainID === FALSE) { return "Error: Domain $domain not found"; } try { $users = $api->getUsers(['loginName'], $domainID); } catch (KerioApiException $error) { logModuleCall( 'kerioEmail', __FUNCTION__, $users, 'Debug Userlist', $domainID ); return ['error' => $error->getMessage()]; } return [ 'success' => true, 'accounts' => $users ]; } }