CProfile::updateArray($prefix.'.host_groups', $this->getInput('filter_host_groups', []), PROFILE_TYPE_ID);
<?php declare(strict_types = 0);
class CControllerAvailabilityReportList extends CController {
protected function init(): void {
$this->disableCsrfValidation();
protected function checkInput(): bool {
'mode' => 'in '.AVAILABILITY_REPORT_BY_HOST.','.AVAILABILITY_REPORT_BY_TEMPLATE,
'filter_template_groups' => 'array_db hosts_groups.groupid',
'filter_templates' => 'array_db hosts.hostid',
'filter_triggers' => 'array_db triggers.triggerid',
'filter_host_groups' => 'array_db hosts_groups.groupid',
'filter_hosts' => 'array_db hosts.hostid',
$ret = $this->validateInput($fields) && $this->validateTimeSelectorPeriod();
$this->setResponse(new CControllerResponseFatal());
protected function checkPermissions(): bool {
return $this->checkAccess(CRoleHelper::UI_REPORTS_AVAILABILITY_REPORT);
protected function doAction(): void {
$report_mode = $this->getInput('mode',
CProfile::get('web.availabilityreport.filter.mode', AVAILABILITY_REPORT_BY_HOST)
$prefix = 'web.availabilityreport.filter.'.$report_mode;
CProfile::update('web.availabilityreport.filter.mode', $report_mode, PROFILE_TYPE_INT);
if ($this->hasInput('filter_set')) {
$this->updateProfiles($report_mode);
elseif ($this->hasInput('filter_rst')) {
$this->deleteProfiles($report_mode);