mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-13 01:37:02 +02:00
step 1 to improve delete feature
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
@ -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 {
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user