<?php declare(strict_types = 0);
class CControllerCorrelationList extends CController {
protected function init(): void {
$this->disableCsrfValidation();
protected function checkInput(): bool {
'sort' => 'in name,status',
'sortorder' => 'in '.ZBX_SORT_DOWN.','.ZBX_SORT_UP,
'filter_name' => 'string',
'filter_status' => 'in -1,'.ZBX_CORRELATION_ENABLED.','.ZBX_CORRELATION_DISABLED,
$ret = $this->validateInput($fields);
$this->setResponse(new CControllerResponseFatal());
protected function checkPermissions(): bool {
return $this->checkAccess(CRoleHelper::UI_CONFIGURATION_EVENT_CORRELATION);
protected function doAction(): void {
$sort_field = $this->getInput('sort', CProfile::get('web.correlation.php.sort', 'name'));
$sort_order = $this->getInput('sortorder', CProfile::get('web.correlation.php.sortorder', ZBX_SORT_UP));
CProfile::update('web.correlation.php.sort', $sort_field, PROFILE_TYPE_STR);
CProfile::update('web.correlation.php.sortorder', $sort_order, PROFILE_TYPE_STR);
if ($this->hasInput('filter_set')) {
CProfile::update('web.correlation.filter_name', $this->getInput('filter_name', ''), PROFILE_TYPE_STR);
CProfile::update('web.correlation.filter_status', $this->getInput('filter_status', -1), PROFILE_TYPE_INT);
elseif ($this->hasInput('filter_rst')) {
CProfile::delete('web.correlation.filter_name');
CProfile::delete('web.correlation.filter_status');