gui: use a session variable for "not before" feature

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2017-12-23 18:03:01 +01:00
parent b7b61a80e5
commit e3f53863b7

View File

@ -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);