PHRAS-3694 notif by email on delete inactif account, admin filter (#4216)

This commit is contained in:
Aina Sitraka
2023-01-19 16:03:28 +03:00
committed by GitHub
parent d04a3a0d6e
commit 170125b9bb
14 changed files with 446 additions and 241 deletions

View File

@@ -63,6 +63,7 @@ class User_Query
protected $only_user_templates = false;
protected $templates_only = false;
protected $mail_locked_only = false;
protected $grace_period_only = false;
protected $email_not_null = false;
protected $base_ids = [];
protected $sbas_ids = [];
@@ -264,6 +265,20 @@ class User_Query
return $this;
}
/**
* Restrict only on grace period
*
* @param $boolean
*
* @return $this
*/
public function grace_period_only($boolean)
{
$this->grace_period_only = !!$boolean;
return $this;
}
/**
* Restrict to user with an email
*
@@ -1003,6 +1018,10 @@ class User_Query
$sql .= ' AND mail_locked = 1';
}
if ($this->grace_period_only) {
$sql .= ' AND Users.nb_inactivity_email > 0 ';
}
if ($this->emailDomains) {
$sql .= $this->generate_field_constraints('email', $this->emailDomains, 'LIKE');
}