getUser()->isAdmin(); } public function postActionGetFolders(Request $request): array { $data = $request->getParsedBody(); $params = [ 'host' => $data->host ?? null, 'port' => $data->port ?? null, 'security' => $data->security ?? null, 'username' => $data->username ?? null, 'password' => $data->password ?? null, 'id' => $data->id ?? null, ]; return $this->getRecordService()->getFolders($params); } public function postActionTestConnection(Request $request): bool { $data = $request->getParsedBody(); if (is_null($data->password)) { $inboundEmail = $this->entityManager->getEntity('InboundEmail', $data->id); if (!$inboundEmail || !$inboundEmail->id) { throw new Error(); } $data->password = $this->getContainer() ->get('crypt') ->decrypt($inboundEmail->get('password')); } $this->getRecordService()->testConnection(get_object_vars($data)); return true; } }