gui: add mandatory start date to certain users preventing them to search for older emails

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2017-12-23 17:43:34 +01:00
parent 4b5f349710
commit b7b61a80e5
2 changed files with 9 additions and 0 deletions

View File

@ -487,6 +487,10 @@ class ModelUserAuth extends Model {
AUDIT(ACTION_LOGIN, $username, '', '', 'successful auth against LDAP');
if(CUSTOM_EMAIL_QUERY_FUNCTION && function_exists(CUSTOM_EMAIL_QUERY_FUNCTION)) {
call_user_func(CUSTOM_EMAIL_QUERY_FUNCTION, $username);
}
return 1;
}

View File

@ -425,6 +425,11 @@ function fetch_url($url = '') {
function fixup_date_condition($field = '', $date1 = 0, $date2 = 0) {
$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');
}
if($date1) {
list($y,$m,$d) = preg_split("/(\.|\-|\/)/", $date1);