chg: [internal] Do not use ajax layout

pull/8310/head
Jakub Onderka 2022-04-28 14:51:21 +02:00
parent d4ca7f1987
commit a007089486
25 changed files with 51 additions and 51 deletions

View File

@ -118,7 +118,7 @@ class AttributesController extends AppController
}
if ($this->request->is('ajax')) {
$this->set('ajax', true);
$this->layout = 'ajax';
$this->layout = false;
} else {
$this->set('ajax', false);
}
@ -1951,7 +1951,7 @@ class AttributesController extends AppController
$this->set('value', $result);
$this->set('object', $attribute);
$this->set('field', $field);
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/attributeViewFieldForm');
}
@ -1989,7 +1989,7 @@ class AttributesController extends AppController
if (!$this->__canModifyEvent($attribute)) {
throw new ForbiddenException(__('You do not have permission to do that'));
}
$this->layout = 'ajax';
$this->layout = false;
if ($field === 'distribution') {
$distributionLevels = $this->Attribute->shortDist;
unset($distributionLevels[4]);
@ -2026,7 +2026,7 @@ class AttributesController extends AppController
}
$this->set('event_id', $id);
if ($this->request->is('get')) {
$this->layout = 'ajax';
$this->layout = false;
$this->request->data['Attribute']['event_id'] = $id;
// combobox for types
@ -2135,7 +2135,7 @@ class AttributesController extends AppController
$message .= $results['untouched'] . ' attributes left untouched. ';
$this->autoRender = false;
$this->layout = 'ajax';
$this->layout = false;
if ($success) {
return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => $message)), 'status'=>200, 'type' => 'json'));
} else {
@ -2480,7 +2480,7 @@ class AttributesController extends AppController
}
$this->set('persistent', $persistent);
$this->set('results', $resultArray);
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/hover_enrichment');
}

View File

@ -125,7 +125,7 @@ class CerebratesController extends AppController
$this->set('title', __('Sync organisation information'));
$this->set('question', __('Are you sure you want to download and add / update the remote organisations from the Cerebrate node?'));
$this->set('actionName', __('Pull all'));
$this->layout = 'ajax';
$this->layout = false;
$this->render('/genericTemplates/confirm');
}
}
@ -165,7 +165,7 @@ class CerebratesController extends AppController
$this->set('title', __('Sync sharing group information'));
$this->set('question', __('Are you sure you want to download and add / update the remote sharing group from the Cerebrate node?'));
$this->set('actionName', __('Pull all'));
$this->layout = 'ajax';
$this->layout = false;
$this->render('/genericTemplates/confirm');
}
}
@ -237,7 +237,7 @@ class CerebratesController extends AppController
$this->set('title', __('Download organisation information'));
$this->set('question', __('Are you sure you want to download and add / update the remote organisation?'));
$this->set('actionName', __('Download'));
$this->layout = 'ajax';
$this->layout = false;
$this->render('/genericTemplates/confirm');
}
}
@ -309,7 +309,7 @@ class CerebratesController extends AppController
$this->set('title', __('Download sharing group information'));
$this->set('question', __('Are you sure you want to download and add / update the remote sharing group?'));
$this->set('actionName', __('Download'));
$this->layout = 'ajax';
$this->layout = false;
$this->render('/genericTemplates/confirm');
}
}

View File

@ -123,7 +123,7 @@ class CorrelationExclusionsController extends AppController
$this->set('title', __('Clean up correlations'));
$this->set('question', __('Execute the cleaning of all correlations that are at odds with the exclusion rules? This will delete all matching correlations.'));
$this->set('actionName', 'clean');
$this->layout = 'ajax';
$this->layout = false;
$this->render('/genericTemplates/confirm');
}
}

View File

@ -95,7 +95,7 @@ class CryptographicKeysController extends AppController
nl2br(h($key['CryptographicKey']['key_data']))
)
);
$this->layout = 'ajax';
$this->layout = false;
$this->render('/genericTemplates/display');
}
}

View File

@ -139,7 +139,7 @@ class EventReportsController extends AppController
if (!$this->request->is('ajax')) {
throw new MethodNotAllowedException(__('This function can only be reached via AJAX.'));
} else {
$this->layout = 'ajax';
$this->layout = false;
$this->set('report', $report);
$this->render('ajax/delete');
}
@ -163,7 +163,7 @@ class EventReportsController extends AppController
if (!$this->request->is('ajax')) {
throw new MethodNotAllowedException(__('This function can only be reached via AJAX.'));
} else {
$this->layout = 'ajax';
$this->layout = false;
$this->set('report', $report);
}
}
@ -230,7 +230,7 @@ class EventReportsController extends AppController
return $this->__getFailResponseBasedOnContext($errorMessage, array(), 'applySuggestions', $reportId);
}
}
$this->layout = 'ajax';
$this->layout = false;
$this->set('reportId', $reportId);
$this->render('ajax/extractAllFromReport');
}
@ -286,7 +286,7 @@ class EventReportsController extends AppController
return $this->__getFailResponseBasedOnContext($errorMessage, array(), 'applySuggestions', $reportId);
}
}
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/replaceSuggestionInReport');
}
}
@ -325,7 +325,7 @@ class EventReportsController extends AppController
}
$this->set('importModuleEnabled', is_array($fetcherModule));
$this->set('event_id', $event_id);
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/importReportFromUrl');
}
@ -367,7 +367,7 @@ class EventReportsController extends AppController
}
}
$this->set('event_id', $eventId);
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/reportFromEvent');
}

View File

@ -1210,7 +1210,7 @@ class EventsController extends AppController
$this->set('tags', $tagNames);
$this->set('tagJSON', json_encode($tagJSON));
$this->set('rules', $rules);
$this->layout = 'ajax';
$this->layout = false;
}
/**
@ -3933,7 +3933,7 @@ class EventsController extends AppController
}
$this->set('event_id', $event['Event']['id']);
if ($this->request->is('get')) {
$this->layout = 'ajax';
$this->layout = false;
$this->request->data['Attribute']['event_id'] = $event['Event']['id'];
} else if ($this->request->is('post')) {
@ -5605,7 +5605,7 @@ class EventsController extends AppController
return $this->RestResponse->viewData($event, $this->response->type());
} else {
if ($this->request->is('ajax')) {
$this->layout = 'ajax';
$this->layout = false;
}
$this->set('analysisLevels', $this->Event->analysisLevels);
$this->set('validUuid', Validation::uuid($id));
@ -5650,7 +5650,7 @@ class EventsController extends AppController
} else {
$this->loadModel('Module');
$modules = $this->Module->getEnabledModules($this->Auth->user(), 'expansion');
$this->layout = 'ajax';
$this->layout = false;
$this->set('modules', $modules);
$this->render('ajax/enrich_event');
}
@ -6220,7 +6220,7 @@ class EventsController extends AppController
__('Are you sure you want to switch the event to unprotected mode? Unprotected mode is the default behaviour of MISP events, with creation and modification being purely limited by the distribution mechanism and eligible sync users.')
);
$this->set('actionName', $protect ? __('Switch to protected mode') : __('Remove protected mode'));
$this->layout = 'ajax';
$this->layout = false;
$this->render('/genericTemplates/confirm');
}
}

View File

@ -52,7 +52,7 @@ class FavouriteTagsController extends AppController
if (!$this->request->is('ajax')) {
throw new MethodNotAllowedException('This action is available via AJAX only.');
}
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/getToggleField');
}
}

View File

@ -155,7 +155,7 @@ class GalaxyClustersController extends AppController
$this->set('custom_cluster_count', $customClusterCount);
if ($this->request->is('ajax')) {
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/index');
}
}

View File

@ -53,7 +53,7 @@ class GalaxyElementsController extends AppController
$this->set('JSONElements', $expanded);
}
if ($this->request->is('ajax')) {
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/index');
}
}
@ -82,7 +82,7 @@ class GalaxyElementsController extends AppController
if (!$this->request->is('ajax')) {
throw new MethodNotAllowedException(__('This function can only be reached via AJAX.'));
} else {
$this->layout = 'ajax';
$this->layout = false;
$this->set('elementId', $elementId);
$this->render('ajax/delete');
}
@ -110,7 +110,7 @@ class GalaxyElementsController extends AppController
}
$this->set('clusterId', $clusterId);
if ($this->request->is('ajax')) {
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/flattenJson');
}
}

View File

@ -168,7 +168,7 @@ class NoticelistsController extends AppController
if (!$this->request->is('ajax')) {
throw new MethodNotAllowedException('This action is available via AJAX only.');
}
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/getToggleField');
}

View File

@ -147,7 +147,7 @@ class ObjectReferencesController extends AppController
$this->set('relationships', $relationships);
$this->set('event', $event);
$this->set('objectId', $object['Object']['id']);
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/add');
}
}

View File

@ -19,7 +19,7 @@ class ObjectTemplateElementsController extends AppController
$this->paginate['conditions'] = array('ObjectTemplateElement.object_template_id' => $id);
$elements = $this->paginate();
$this->set('list', $elements);
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/view_elements');
}
}

View File

@ -158,7 +158,7 @@ class ObjectTemplatesController extends AppController
'conditions' => array('ObjectTemplateElement.object_template_id' => $id)
));
$this->set('list', $elements);
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/view_elements');
}
@ -293,7 +293,7 @@ class ObjectTemplatesController extends AppController
if (!$this->request->is('ajax')) {
throw new MethodNotAllowedException('This action is available via AJAX only.');
}
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/getToggleField');
}

View File

@ -600,7 +600,7 @@ class ObjectsController extends AppController
}
$this->set('value', $result);
$this->set('field', $field);
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/objectViewFieldForm');
}
@ -632,7 +632,7 @@ class ObjectsController extends AppController
if (!$this->__canModifyEvent($object)) {
throw new NotFoundException(__('Invalid object'));
}
$this->layout = 'ajax';
$this->layout = false;
if ($field == 'distribution') {
$distributionLevels = $this->MispObject->shortDist;
unset($distributionLevels[4]);

View File

@ -39,7 +39,7 @@ class PostsController extends AppController
$event_id = 0;
$post_id = 0;
if ($this->request->is('ajax')) {
$this->layout = 'ajax';
$this->layout = false;
}
// we have a target type and a target id. The target id defines what type of object we want to attach this event to (is it a reply to another post,
// did someone add a post to a thread, does a thread for the event exist already, etc.

View File

@ -254,7 +254,7 @@ class ShadowAttributesController extends AppController
{
if ($this->request->is('ajax')) {
$this->set('ajax', true);
$this->layout = 'ajax';
$this->layout = false;
} else {
$this->set('ajax', false);
}

View File

@ -151,7 +151,7 @@ class SharingGroupBlueprintsController extends AppController
$this->set('title', __('Execute Sharing Group Blueprint'));
$this->set('question', __('Are you sure you want to (re)create a sharing group based on the Sharing Group Blueprint?'));
$this->set('actionName', __('Execute'));
$this->layout = 'ajax';
$this->layout = false;
$this->render('/genericTemplates/confirm');
}
}
@ -189,7 +189,7 @@ class SharingGroupBlueprintsController extends AppController
$this->set('title', __('Detach Sharing Group Blueprint'));
$this->set('question', __('Are you sure you want to detach the associated sharing group from this Sharing Group Blueprint? This action is irreversible.'));
$this->set('actionName', __('Detach'));
$this->layout = 'ajax';
$this->layout = false;
$this->render('/genericTemplates/confirm');
}
}

View File

@ -315,7 +315,7 @@ class SightingsController extends AppController
}
$this->set('csv', $statistics['csv']['all']);
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/view_sightings');
}

View File

@ -387,7 +387,7 @@ class TagCollectionsController extends AppController
$this->set('tag_id', $tag_id);
$this->set('model', 'tag_collection');
$this->set('model_name', $tagCollection['TagCollection']['name']);
$this->layout = 'ajax';
$this->layout = false;
$this->render('/Attributes/ajax/tagRemoveConfirmation');
} else {
$rearrangeRules = array(

View File

@ -371,7 +371,7 @@ class TagsController extends AppController
$tagConflicts = $this->Taxonomy->checkIfTagInconsistencies($event['EventTag']);
$this->set('tagConflicts', $tagConflicts);
$this->set('event', $event);
$this->layout = 'ajax';
$this->layout = false;
$this->render('/Events/ajax/ajaxTags');
}
@ -402,7 +402,7 @@ class TagsController extends AppController
$this->set('attributeId', $id);
$tagConflicts = $this->Taxonomy->checkIfTagInconsistencies($attributeTags);
$this->set('tagConflicts', $tagConflicts);
$this->layout = 'ajax';
$this->layout = false;
$this->render('/Attributes/ajax/ajaxAttributeTags');
}
@ -435,7 +435,7 @@ class TagsController extends AppController
'conditions' => array('Event.id' => $id)
));
$this->set('event', $event);
$this->layout = 'ajax';
$this->layout = false;
$this->render('/Events/ajax/ajaxTags');
}

View File

@ -494,7 +494,7 @@ class TaxonomiesController extends AppController
$this->set('required', !$taxonomy['Taxonomy']['required']);
$this->set('id', $id);
$this->autoRender = false;
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/toggle_required');
}

View File

@ -57,7 +57,7 @@ class TemplateElementsController extends AppController
throw new MethodNotAllowedException('This action is for ajax requests only.');
}
$this->set('id', $id);
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/template_element_add_choices');
}

View File

@ -139,7 +139,7 @@ class ThreadsController extends AppController
}
}
if ($this->request->is('ajax')) {
$this->layout = 'ajax';
$this->layout = false;
$this->render('/Elements/eventdiscussion');
}
}

View File

@ -541,7 +541,7 @@ class UsersController extends AppController
$rules = $this->_arrayToValuesIndexArray($rules);
$this->set('rules', $rules);
$this->set('baseurl', Configure::read('MISP.baseurl'));
$this->layout = 'ajax';
$this->layout = false;
}
public function admin_view($id = null)
@ -1481,7 +1481,7 @@ class UsersController extends AppController
$this->set('typeDb', $typeDb);
$this->set('sigTypes', $sigTypes);
$this->layout = 'ajax';
$this->layout = false;
}
public function terms()
@ -1723,7 +1723,7 @@ class UsersController extends AppController
$error = 'No encryption key found for the user and the instance posture blocks non encrypted e-mails from being sent.';
}
$this->set('error', $error);
$this->layout = 'ajax';
$this->layout = false;
$this->set('user', $user);
$this->set('firstTime', $firstTime);
$this->render('ajax/passwordResetConfirmationForm');

View File

@ -321,7 +321,7 @@ class WarninglistsController extends AppController
if (!$this->request->is('ajax')) {
throw new MethodNotAllowedException(__('This action is available via AJAX only.'));
}
$this->layout = 'ajax';
$this->layout = false;
$this->render('ajax/getToggleField');
}