diff --git a/webui/system/misc.php b/webui/system/misc.php index 32059b95..ce9fff31 100644 --- a/webui/system/misc.php +++ b/webui/system/misc.php @@ -423,13 +423,17 @@ function fetch_url($url = '') { function fixup_date_condition($field = '', $date1 = 0, $date2 = 0) { + global $session; + $date = ""; - // Check if you want to apply a 'not before' value to a non-auditor user - if(Registry::get('auditor') == 0 && Registry::get('not_before_date')) { - $date1 = Registry::get('not_before_date'); + // Check if we want to apply a mandatory date1 (=not before) restriction + // to a non-auditor user + if(Registry::get('auditor') == 0 && $session->get('not_before_date')) { + $date1 = $session->get('not_before_date'); } + if($date1) { list($y,$m,$d) = preg_split("/(\.|\-|\/)/", $date1);