mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-12 23:17:02 +02:00
update the gui for per user legal hold
This commit is contained in:
50
webui/model/policy/hold.php
Normal file
50
webui/model/policy/hold.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
class ModelPolicyHold extends Model {
|
||||
|
||||
|
||||
public function get_emails($s = '') {
|
||||
|
||||
if($s) {
|
||||
$query = $this->db->query("SELECT email FROM " . TABLE_LEGAL_HOLD . " WHERE email LIKE ? ORDER BY email ASC", array('%' . $s . '%'));
|
||||
} else {
|
||||
$query = $this->db->query("SELECT email FROM " . TABLE_LEGAL_HOLD . " ORDER BY email ASC");
|
||||
}
|
||||
|
||||
if(isset($query->rows)) { return $query->rows; }
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
public function delete_email($email = '') {
|
||||
if($email == "") { return 0; }
|
||||
|
||||
$query = $this->db->query("DELETE FROM " . TABLE_LEGAL_HOLD . " WHERE email=?", array($email));
|
||||
|
||||
$rc = $this->db->countAffected();
|
||||
|
||||
LOGGER("remove from legal hold: $email (rc=$rc)");
|
||||
|
||||
return $rc;
|
||||
}
|
||||
|
||||
|
||||
public function add_email($email = '') {
|
||||
if($email == "") { return 0; }
|
||||
|
||||
$email = strtolower($email);
|
||||
|
||||
$query = $this->db->query("INSERT INTO " . TABLE_LEGAL_HOLD . " (email) VALUES (?)", array($email));
|
||||
$rc = $this->db->countAffected();
|
||||
if($rc == 1) {
|
||||
LOGGER("add legal hold: $email (rc=$rc)");
|
||||
}
|
||||
|
||||
return $rc;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user