step 1 to improve delete feature

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO
2019-07-14 19:20:49 +02:00
parent 7015e76a11
commit d1da0c93e7
23 changed files with 92 additions and 537 deletions

View File

@ -21,6 +21,7 @@ class ControllerMessageBulkremove extends Controller {
$this->document->title = $this->data['text_message'];
if(!isset($this->request->post['idlist']) || $this->request->post['idlist'] == '') { die("no idlist parameter given"); }
if(!isset($this->request->post['reason']) || $this->request->post['reason'] == '') { die("no reason parameter given"); }
$idlist = $this->model_search_search->check_your_permission_by_id_list(explode(",", $this->request->post['idlist']));
@ -33,12 +34,16 @@ class ControllerMessageBulkremove extends Controller {
}
foreach($idlist as $id) {
$db->query("INSERT INTO " . TABLE_DELETED . " (id, email, reason, date1) VALUES(?,?,?,?)", [$id, $this->data['username'], $this->request->post['reason'], NOW]);
AUDIT(ACTION_REMOVE_MESSAGE, '', '', $id, '');
$db->query("UPDATE " . TABLE_META . " SET retained=? WHERE id=?", array(NOW, $id));
syslog(LOG_INFO, $this->data['username'] . " removed message: $id");
if(AUTHORIZE_DELETE) {
AUDIT(ACTION_MARK_MESSAGE_FOR_REMOVAL, '', '', $id, '');
syslog(LOG_INFO, $this->data['username'] . " marked message for removal: $id");
} else {
AUDIT(ACTION_REMOVE_MESSAGE, '', '', $id, '');
$db->query("UPDATE " . TABLE_META . " SET retained=? WHERE id=?", [NOW, $id]);
syslog(LOG_INFO, $this->data['username'] . " removed message: $id");
}
$this->data['removed']++;
}
@ -48,5 +53,3 @@ class ControllerMessageBulkremove extends Controller {
}
?>