|
@@ -14,33 +14,8 @@ if ($_SESSION['user'] != 'admin') {
|
|
|
// Check POST request
|
|
// Check POST request
|
|
|
if (!empty($_POST['save'])) {
|
|
if (!empty($_POST['save'])) {
|
|
|
|
|
|
|
|
- // Check token
|
|
|
|
|
- if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
|
|
|
|
|
- header('location: /login/');
|
|
|
|
|
- exit();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Set restart flag
|
|
|
|
|
- $v_restart = 'yes';
|
|
|
|
|
- if (empty($_POST['v_restart'])) $v_restart = 'no';
|
|
|
|
|
-
|
|
|
|
|
- // Update config
|
|
|
|
|
- if (!empty($_POST['v_config'])) {
|
|
|
|
|
- exec ('mktemp', $mktemp_output, $return_var);
|
|
|
|
|
- $new_conf = $mktemp_output[0];
|
|
|
|
|
- $fp = fopen($new_conf, 'w');
|
|
|
|
|
- fwrite($fp, str_replace("\r\n", "\n", $_POST['v_config']));
|
|
|
|
|
- fclose($fp);
|
|
|
|
|
- exec (HESTIA_CMD."v-change-sys-service-config ".$new_conf." crond ".$v_restart, $output, $return_var);
|
|
|
|
|
- check_return_code($return_var,$output);
|
|
|
|
|
- unset($output);
|
|
|
|
|
- unlink($new_conf);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// Set success message
|
|
// Set success message
|
|
|
- if (empty($_SESSION['error_msg'])) {
|
|
|
|
|
- $_SESSION['ok_msg'] = __('Changes has been saved.');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $_SESSION['ok_msg'] = __('Info (Read-only mode): Crontab can be edited only trough ssh');
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|