Merge branch 'develop' of github.com:MISP/MISP into develop

pull/9594/head
Christian Studer 2024-02-27 17:39:43 +01:00
commit fdfd783f0f
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
6 changed files with 35 additions and 17 deletions

View File

@ -80,6 +80,9 @@ class AnalystData extends AppModel
'belongsTo' => [
'Org' => [
'className' => 'Organisation',
'fields' => [
'id', 'name', 'uuid', 'type', 'description', 'sector', 'nationality', 'local'
],
'foreignKey' => false,
'conditions' => [
sprintf('%s.org_uuid = Org.uuid', $this->alias)
@ -87,6 +90,9 @@ class AnalystData extends AppModel
],
'Orgc' => [
'className' => 'Organisation',
'fields' => [
'id', 'name', 'uuid','type', 'sector', 'nationality', 'local'
],
'foreignKey' => false,
'conditions' => [
sprintf('%s.orgc_uuid = Orgc.uuid', $this->alias)
@ -94,6 +100,9 @@ class AnalystData extends AppModel
],
'SharingGroup' => [
'className' => 'SharingGroup',
'fields' => [
'id', 'name', 'uuid', 'releasability', 'description', 'org_id', 'active', 'roaming', 'local'
],
'foreignKey' => false,
'conditions' => [
sprintf('%s.sharing_group_id = SharingGroup.id', $this->alias)
@ -110,7 +119,6 @@ class AnalystData extends AppModel
parent::afterFind($results, $primary);
$this->setUser();
foreach ($results as $i => $v) {
$results[$i][$this->alias]['note_type'] = $this->current_type_id;
$results[$i][$this->alias]['note_type_name'] = $this->current_type;
@ -119,7 +127,6 @@ class AnalystData extends AppModel
$results[$i] = $this->rearrangeSharingGroup($results[$i], $this->current_user);
$results[$i][$this->alias]['_canEdit'] = $this->canEditAnalystData($this->current_user, $v, $this->alias);
if (!empty($this->fetchRecursive) && !empty($results[$i][$this->alias]['uuid'])) {
$this->Note = ClassRegistry::init('Note');
$this->Opinion = ClassRegistry::init('Opinion');
@ -148,6 +155,17 @@ class AnalystData extends AppModel
$this->data[$this->current_type]['authors'] = $this->current_user['email'];
}
}
if (isset($this->data[$this->current_type]['distribution'])) {
if (
$this->data[$this->current_type]['distribution'] != 4 &&
(
isset($this->data[$this->current_type]['sharing_group_id']) &&
$this->data[$this->current_type]['sharing_group_id'] != 0
)
) {
$this->data[$this->current_type]['sharing_group_id'] = 0;
}
}
return true;
}
@ -167,7 +185,7 @@ class AnalystData extends AppModel
public function getEditableFields(): array
{
return array_merge(self::BASE_EDITABLE_FIELDS, $this->EDITABLE_FIELDS);
return array_merge(self::BASE_EDITABLE_FIELDS, static::EDITABLE_FIELDS);
}
/**
@ -256,7 +274,15 @@ class AnalystData extends AppModel
if (!isset($analystData['SharingGroup'])) {
$this->SharingGroup = ClassRegistry::init('SharingGroup');
$sg = $this->SharingGroup->fetchSG($analystData[$this->alias]['sharing_group_id'], $user, true);
$analystData[$this->alias]['SharingGroup'] = $sg['SharingGroup'];
$sgData = array_intersect_key(
$sg['SharingGroup'], array_flip(
[
'id', 'name', 'uuid', 'releasability', 'description', 'org_id',
'active', 'roaming', 'local'
]
)
);
$analystData[$this->alias]['SharingGroup'] = $sgData;
} else {
$analystData[$this->alias]['SharingGroup'] = $analystData['SharingGroup'];
}

View File

@ -7,7 +7,7 @@ class Module_tag_replacement_generic extends Module_tag_operation
public $blocking = false;
public $id = 'tag_replacement_generic';
public $name = 'Tag Replacement Generic';
public $description = 'Toggle or remove the IDS flag on selected attributes.';
public $description = 'Attach a tag, or substitue a tag by another';
public $icon = 'tags';
public $inputs = 1;
public $outputs = 1;

View File

@ -62,14 +62,6 @@
'title' => __('Analyst Data Blocklist Index'),
'description' => __('List all analyst data that will be prevented to be created (also via synchronization) on this instance'),
'actions' => array(
array(
'title' => 'Edit',
'url' => '/analyst_data_blocklists/edit',
'url_params_data_paths' => array(
'AnalystDataBlocklist.id'
),
'icon' => 'edit',
),
array(
'title' => 'Delete',
'url' => $baseurl . '/analyst_data_blocklists/delete',

View File

@ -205,7 +205,7 @@ var baseNoteTemplate = doT.template('\
<span role="button" onclick="addOpinion(this, \'{{!it.uuid}}\', \'{{!it.note_type_name}}\')" title="<?= __('Add an opinion to this note') ?>"><i class="<?= $this->FontAwesome->getClass('gavel') ?> useCursorPointer"></i></span> \
{{?}} \
{{? 1 == <?= $me['Role']['perm_modify'] ? 1 : 0 ?> }} \
<span role="button" onclick="addNote(this, \'{{!it.uuid}}\', \'{{!it.note_type_name}}\')" title="<?= __('Add a note to this note') ?>"><i class="<?= $this->FontAwesome->getClass('comment-alt') ?> useCursorPointer"></i></span> \
<span role="button" onclick="addNote(this, \'{{!it.uuid}}\', \'{{!it.note_type_name}}\')" title="<?= __('Add a note to this ') ?>{{!it.note_type_name}}"><i class="<?= $this->FontAwesome->getClass('comment-alt') ?> useCursorPointer"></i></span> \
{{?}} \
{{? it._canEdit }} \
<span role="button" onclick="editNote(this, {{!it.id}}, \'{{!it.note_type_name}}\')" title="<?= __('Edit this note') ?>"><i class="<?= $this->FontAwesome->getClass('edit') ?> useCursorPointer"></i></span> \
@ -259,7 +259,7 @@ var relationshipDefaultEntryTemplate = doT.template('\
{{?}} \
</span> \
<i class="<?= $this->FontAwesome->getClass('long-arrow-alt-right') ?>" style="font-size: 1.5em; color: #555"></i> \
<div style="margin-left: 0.5rem;">{{!it.content}}</div> \
<div style="margin-left: 0.5rem;">{{=it.content}}</div> \
</div> \
{{? it.comment }} \
<div style="max-width: 40vw; margin: 0.5rem 0 0 0.5rem; position: relative;" class="v-bar-text-opinion"> \

@ -1 +1 @@
Subproject commit 7e8d57e741ee1ba6e764c1a5e0ba236fc2f64126
Subproject commit 838f6497660af602c5d7bde93ce34be1783287dd

@ -1 +1 @@
Subproject commit 80eb7028f9de974d7f163a7563e66b582f61cec0
Subproject commit 2765252e7d097703828cd8b3bdd63ba8ba75c63b