fix email account controller

This commit is contained in:
yuri
2019-03-06 16:19:32 +02:00
parent 5e3a4359f8
commit 247b42474d
5 changed files with 39 additions and 68 deletions
+10 -15
View File
@@ -41,24 +41,20 @@ class InboundEmail extends \Espo\Core\Controllers\Record
}
}
public function actionGetFolders($params, $data, $request)
public function postActionGetFolders($params, $data, $request)
{
return $this->getRecordService()->getFolders(array(
'host' => $request->get('host'),
'port' => $request->get('port'),
'ssl' => $request->get('ssl') === 'true',
'username' => $request->get('username'),
'password' => $request->get('password'),
'id' => $request->get('id')
));
return $this->getRecordService()->getFolders([
'host' => $data->host ?? null,
'port' => $data->port ?? null,
'ssl' => $data->ssl ?? false,
'username' => $data->username ?? null,
'password' => $data->password ?? null,
'id' => $data->id ?? null,
]);
}
public function actionTestConnection($params, $data, $request)
public function postActionTestConnection($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
}
if (is_null($data->password)) {
$inboundEmail = $this->getEntityManager()->getEntity('InboundEmail', $data->id);
if (!$inboundEmail || !$inboundEmail->id) {
@@ -69,5 +65,4 @@ class InboundEmail extends \Espo\Core\Controllers\Record
return $this->getRecordService()->testConnection(get_object_vars($data));
}
}