class CControllerGuiUpdate extends CController {
protected function checkInput() {
$themes = array_keys(APP::getThemes());
$timezones = array_keys(CTimezoneHelper::getList());
'default_lang' => 'in '.implode(',', array_keys(getLocales())),
'default_timezone' => 'required|in '.ZBX_DEFAULT_TIMEZONE.','.implode(',', $timezones),
'default_theme' => 'required|in '.implode(',', $themes),
'search_limit' => 'required|ge 1|le 999999',
'max_overview_table_size' => 'required|ge 5|le 999999',
'max_in_table' => 'required|ge 1|le 99999',
'server_check_interval' => 'required|in 0,'.SERVER_CHECK_INTERVAL,
'work_period' => 'required|time_periods',
'show_technical_errors' => 'in 0,1',
'history_period' => 'required|time_unit '.implode(':', [SEC_PER_DAY, 7 * SEC_PER_DAY]),
'period_default' => 'required|time_unit_year '.implode(':', [SEC_PER_MIN, 10 * SEC_PER_YEAR]),
'max_period' => 'required|time_unit_year '.implode(':', [SEC_PER_YEAR, 10 * SEC_PER_YEAR])
$ret = $this->validateInput($fields);
switch ($this->GetValidationError()) {
case self::VALIDATION_ERROR:
$response = new CControllerResponseRedirect((new CUrl('zabbix.php'))
->setArgument('action', 'gui.edit')
$response->setFormData($this->getInputAll());
CMessageHelper::setErrorTitle(_('Cannot update configuration'));
$this->setResponse($response);
case self::VALIDATION_FATAL_ERROR:
$this->setResponse(new CControllerResponseFatal());
protected function checkPermissions() {
return $this->checkAccess(CRoleHelper::UI_ADMINISTRATION_GENERAL);