mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
empty value validation
This commit is contained in:
parent
4082765c65
commit
47d84faaa2
1 changed files with 51 additions and 53 deletions
|
@ -12,16 +12,14 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
|
||||||
// Panel
|
// Panel
|
||||||
top_panel($user,$TAB);
|
top_panel($user,$TAB);
|
||||||
|
|
||||||
// Are you admin?
|
if (!empty($_POST['ok'])) {
|
||||||
//if ($_SESSION['user'] == 'admin') {
|
|
||||||
if (!empty($_POST['ok'])) {
|
|
||||||
// Check input
|
// Check input
|
||||||
if (!isset($_POST['v_min'])) $errors[] = __('minute');
|
if ((!isset($_POST['v_min'])) && ($_POST['v_min'] != '')) $errors[] = __('minute');
|
||||||
if (!isset($_POST['v_hour'])) $errors[] = __('hour');
|
if ((!isset($_POST['v_hour'])) && ($_POST['v_hour'] != '')) $errors[] = __('hour');
|
||||||
if (!isset($_POST['v_day'])) $errors[] = __('day');
|
if ((!isset($_POST['v_day'])) && ($_POST['v_day'] != '')) $errors[] = __('day');
|
||||||
if (!isset($_POST['v_month'])) $errors[] = __('month');
|
if ((!isset($_POST['v_month'])) && ($_POST['v_month'] != '')) $errors[] = __('month');
|
||||||
if (!isset($_POST['v_wday'])) $errors[] = __('day of week');
|
if ((!isset($_POST['v_wday'])) && ($_POST['v_wday'] != '')) $errors[] = __('day of week');
|
||||||
if (!isset($_POST['v_cmd'])) $errors[] = __('cmd');
|
if ((!isset($_POST['v_cmd'])) && ($_POST['v_cmd'] != '')) $errors[] = __('cmd');
|
||||||
|
|
||||||
// Protect input
|
// Protect input
|
||||||
$v_min = escapeshellarg($_POST['v_min']);
|
$v_min = escapeshellarg($_POST['v_min']);
|
||||||
|
@ -63,15 +61,15 @@ top_panel($user,$TAB);
|
||||||
unset($output);
|
unset($output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exec (VESTA_CMD."v-list-database-types 'json'", $output, $return_var);
|
|
||||||
$db_types = json_decode(implode('', $output), true);
|
|
||||||
unset($output);
|
|
||||||
|
|
||||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_cron.html');
|
exec (VESTA_CMD."v-list-database-types 'json'", $output, $return_var);
|
||||||
unset($_SESSION['error_msg']);
|
$db_types = json_decode(implode('', $output), true);
|
||||||
unset($_SESSION['ok_msg']);
|
unset($output);
|
||||||
//}
|
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_cron.html');
|
||||||
|
unset($_SESSION['error_msg']);
|
||||||
|
unset($_SESSION['ok_msg']);
|
||||||
|
|
||||||
// Footer
|
// Footer
|
||||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
|
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue