Merge branch '5027-pandora-db-error-history-db-step' into 'develop'

Added control for int values

See merge request artica/pandorafms!2927
This commit is contained in:
vgilc 2020-01-07 10:20:26 +01:00
commit c14a462e63
1 changed files with 20 additions and 4 deletions

View File

@ -1411,19 +1411,35 @@ function config_update_config()
$error_update[] = __('Database password');
}
if (!config_update_value('history_db_days', get_parameter('history_db_days'))) {
$history_db_days = get_parameter('history_db_days');
if (!is_numeric($history_db_days)
|| $history_db_days <= 0
|| !config_update_value('history_db_days', $history_db_days)
) {
$error_update[] = __('Days');
}
if (!config_update_value('history_event_days', get_parameter('history_event_days'))) {
$history_event_days = get_parameter('history_event_days');
if (!is_numeric($history_event_days)
|| $history_event_days <= 0
|| !config_update_value('history_event_days', $history_event_days)
) {
$error_update[] = __('Event Days');
}
if (!config_update_value('history_db_step', get_parameter('history_db_step'))) {
$history_db_step = get_parameter('history_db_step');
if (!is_numeric($history_db_step)
|| $history_db_step <= 0
|| !config_update_value('history_db_step', $history_db_step)
) {
$error_update[] = __('Step');
}
if (!config_update_value('history_db_delay', get_parameter('history_db_delay'))) {
$history_db_delay = get_parameter('history_db_delay');
if (!is_numeric($history_db_delay)
|| $history_db_delay <= 0
|| !config_update_value('history_db_delay', $history_db_delay)
) {
$error_update[] = __('Delay');
}
break;