fix: [decaying:import] imported models from directory are correctly

saved as default
pull/5032/head
mokaddem 2019-09-06 15:50:24 +02:00
parent 0d0002ee70
commit ecbea013a1
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
3 changed files with 3 additions and 2 deletions

View File

@ -70,7 +70,7 @@ class DecayingModelController extends AppController
unset($json['uuid']);
$json['default'] = 0;
$json['org_id'] = $this->Auth->user()['org_id'];
if ($this->DecayingModel->save($json)) {
$this->Flash->success(__('The model has been imported.'));
} else {

View File

@ -168,6 +168,7 @@ class DecayingModel extends AppModel
}
} else {
$this->create();
$new_model['default'] = true;
$this->save($new_model);
}
}

View File

@ -15,7 +15,7 @@
'html' => sprintf(
'%s %s',
h($decaying_model['DecayingModel']['name']),
!is_null($decaying_model['DecayingModel']['uuid']) ? '<img src="' . $baseurl . '/img/orgs/MISP.png" width="24" height="24" style="padding-bottom:3px;" title="' . __('Default Model from MISP Project') . '" />' : ''
$decaying_model['DecayingModel']['default'] ? '<img src="' . $baseurl . '/img/orgs/MISP.png" width="24" height="24" style="padding-bottom:3px;" title="' . __('Default Model from MISP Project') . '" />' : ''
)
);
$table_data[] = array('key' => __('Description'), 'value' => $decaying_model['DecayingModel']['description']);