mirror of https://github.com/MISP/MISP
fix: [required taxonomies] not firing via regular publishing only via publish (no email), fixes #4546
parent
b671306059
commit
18104c0a08
|
@ -2488,6 +2488,13 @@ class EventsController extends AppController
|
|||
$errors = array();
|
||||
// only allow form submit CSRF protection
|
||||
if ($this->request->is('post') || $this->request->is('put')) {
|
||||
if (!$this->_isRest()) {
|
||||
$publishable = $this->Event->checkIfPublishable($id);
|
||||
if ($publishable !== true) {
|
||||
$this->Flash->error(__('Could not publish event - no tag for required taxonomies missing: %s', implode(', ', $publishable)));
|
||||
$this->redirect(array('action' => 'view', $id));
|
||||
}
|
||||
}
|
||||
// send out the email
|
||||
$emailResult = $this->Event->sendAlertEmailRouter($id, $this->Auth->user(), $this->Event->data['Event']['publish_timestamp']);
|
||||
if (is_bool($emailResult) && $emailResult == true) {
|
||||
|
|
Loading…
Reference in New Issue