From abe7fb7c2dc7f845e5577bc40c7361150ac83c94 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Thu, 15 Nov 2012 16:38:47 +0100 Subject: [PATCH] Rollback of Session Abondoned Error and new variable, $no_check_edit_conflicts in config.php. --- config.default.php | 3 +++ includes/session.inc | 3 +-- sales/includes/sales_ui.inc | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config.default.php b/config.default.php index 49486957..21c0cb99 100644 --- a/config.default.php +++ b/config.default.php @@ -68,6 +68,9 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_ $power_by = "FrontAccounting"; $power_url = "http://frontaccounting.com"; + /* No check on edit conflicts. Maybe needed to be set to 1 in certains Windows Servers */ + $no_check_edit_conflicts = 0; + /* Do not print zero lines amount of 0.00 in Sales Documents if service item. 1 = do not */ $no_zero_lines_amount = 1; diff --git a/includes/session.inc b/includes/session.inc index ed5f5c03..9eb70019 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -76,8 +76,7 @@ class SessionManager $_SESSION['EXPIRES'] = time() + 10; // Create new session without destroying the old one - session_regenerate_id(version_compare(PHP_VERSION, '5.1.0') >= 0 && (substr(strtoupper(PHP_OS),0,3) == "WIN")); - + session_regenerate_id(); // Grab current session ID and close both sessions to allow other scripts to use them $newSession = session_id(); session_write_close(); diff --git a/sales/includes/sales_ui.inc b/sales/includes/sales_ui.inc index 49232d81..8c56d4d3 100644 --- a/sales/includes/sales_ui.inc +++ b/sales/includes/sales_ui.inc @@ -44,9 +44,9 @@ function processing_active() */ function check_edit_conflicts($cartname='Items') { - global $Ajax; + global $Ajax, $no_check_edit_conflicts; - if (get_post('cart_id') && $_POST['cart_id'] != $_SESSION[$cartname]->cart_id) { + if ((!isset($no_check_edit_conflicts) || $no_check_edit_conflicts==0) && get_post('cart_id') && $_POST['cart_id'] != $_SESSION[$cartname]->cart_id) { display_error(_('This edit session has been abandoned by opening sales document in another browser tab. You cannot edit more than one sales document at once.')); $Ajax->activate('_page_body'); display_footer_exit(); -- 2.30.2