<?php declare(strict_types = 0);
class CControllerHousekeepingUpdate extends CController {
protected function checkInput(): bool {
'hk_trends' => 'db config.hk_trends|time_unit 0,'.implode(':', [SEC_PER_DAY, 25 * SEC_PER_YEAR]),
'hk_trends_global' => 'db config.hk_trends_global|in 1',
'hk_trends_mode' => 'db config.hk_trends_mode',
'hk_history' => 'db config.hk_history|time_unit 0,'.implode(':', [SEC_PER_HOUR, 25 * SEC_PER_YEAR]),
'hk_history_global' => 'db config.hk_history_global|in 1',
'hk_history_mode' => 'db config.hk_history_mode',
'hk_sessions' => 'db config.hk_sessions|time_unit '.implode(':', [SEC_PER_DAY, 25 * SEC_PER_YEAR]),
'hk_sessions_mode' => 'db config.hk_sessions_mode|in 1',
'hk_services' => 'db config.hk_services|time_unit '.implode(':', [SEC_PER_DAY, 25 * SEC_PER_YEAR]),
'hk_services_mode' => 'db config.hk_services_mode|in 1',
'hk_events_autoreg' => 'db config.hk_events_autoreg|time_unit '.implode(':', [SEC_PER_DAY, 25 * SEC_PER_YEAR]),
'hk_events_discovery' => 'db config.hk_events_discovery|time_unit '.implode(':', [SEC_PER_DAY, 25 * SEC_PER_YEAR]),
'hk_events_internal' => 'db config.hk_events_internal|time_unit '.implode(':', [SEC_PER_DAY, 25 * SEC_PER_YEAR]),
'hk_events_trigger' => 'db config.hk_events_trigger|time_unit '.implode(':', [SEC_PER_DAY, 25 * SEC_PER_YEAR]),
'hk_events_service' => 'db config.hk_events_service|time_unit '.implode(':', [SEC_PER_DAY, 25 * SEC_PER_YEAR]),
'hk_events_mode' => 'db config.hk_events_mode|in 1',
'compression_status' => 'db config.compression_status|in 1',
'compress_older' => 'db config.compress_older|time_unit '.implode(':', [7 * SEC_PER_DAY, 25 * SEC_PER_YEAR])
$ret = $this->validateInput($fields);
switch ($this->getValidationError()) {
case self::VALIDATION_ERROR:
$response = new CControllerResponseRedirect(
(new CUrl('zabbix.php'))->setArgument('action', 'housekeeping.edit')
$response->setFormData($this->getInputAll() + [
'hk_services_mode' => '0',
'hk_sessions_mode' => '0',
'hk_history_mode' => '0',
'hk_history_global' => '0',
'hk_trends_global' => '0',
'compression_status' => '0'
CMessageHelper::setErrorTitle(_('Cannot update configuration'));
$this->setResponse($response);
case self::VALIDATION_FATAL_ERROR:
$this->setResponse(new CControllerResponseFatal());