mirror of https://github.com/MISP/MISP
fix: [decaying:import] imported models from directory are correctly
saved as defaultpull/5032/head
parent
0d0002ee70
commit
ecbea013a1
|
@ -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 {
|
||||
|
|
|
@ -168,6 +168,7 @@ class DecayingModel extends AppModel
|
|||
}
|
||||
} else {
|
||||
$this->create();
|
||||
$new_model['default'] = true;
|
||||
$this->save($new_model);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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']);
|
||||
|
|
Loading…
Reference in New Issue