fix: contact reporter via API

pull/5079/head
Pierre-Jean Grenier 2019-08-28 14:07:55 +02:00
parent cdc4b2ccdd
commit 14314ebd75
1 changed files with 5 additions and 1 deletions

View File

@ -2623,6 +2623,7 @@ class EventsController extends AppController
// Users with a GnuPG key will get the mail encrypted, other users will get the mail unencrypted
public function contact($id = null)
{
$id = $this->Toolbox->findIdByUuid($this->Event, $id);
$this->Event->id = $id;
if (!$this->Event->exists()) {
throw new NotFoundException(__('Invalid event'));
@ -2643,7 +2644,10 @@ class EventsController extends AppController
}
}
$creator_only = $this->request->data['Event']['person'];
$creator_only = false;
if (isset($this->request->data['Event']['person'])) {
$creator_only = $this->request->data['Event']['person'];
}
$user = $this->Auth->user();
$user['gpgkey'] = $this->Event->User->getPGP($user['id']);
$user['certif_public'] = $this->Event->User->getCertificate($user['id']);