DB Structure Updated 2 new settings config_backup_enable and config_backup_path. This is to fix an issue where not specifying the full backup path would cause cron to error out and not run completely

This commit is contained in:
johnnyq
2022-03-29 12:59:42 -04:00
parent bb24cc7112
commit 8c98163e1c
6 changed files with 124 additions and 55 deletions

View File

@@ -1068,6 +1068,29 @@ if(isset($_POST['edit_online_payment_settings'])){
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
if(isset($_POST['edit_backup_settings'])){
if($session_user_role != 3){
$_SESSION['alert_type'] = "danger";
$_SESSION['alert_message'] = "You are not permitted to do that!";
header("Location: " . $_SERVER["HTTP_REFERER"]);
exit();
}
$config_backup_enable = intval($_POST['config_backup_enable']);
$config_backup_path = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_backup_path'])));
mysqli_query($mysqli,"UPDATE settings SET config_backup_enable = $config_backup_enable, config_backup_path = '$config_backup_path' WHERE company_id = $session_company_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modify', log_description = '$session_name modified backup settings', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_created_at = NOW(), log_user_id = $session_user_id, company_id = $session_company_id");
$_SESSION['alert_message'] = "Backup Settings updated";
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
if(isset($_POST['enable_2fa'])){
$token = mysqli_real_escape_string($mysqli,$_POST['token']);