diff --git a/webui/controller/message/bulkremove.php b/webui/controller/message/bulkremove.php index 50fd1716..4678bf9c 100644 --- a/webui/controller/message/bulkremove.php +++ b/webui/controller/message/bulkremove.php @@ -15,8 +15,6 @@ class ControllerMessageBulkremove extends Controller { $this->load->model('search/search'); $this->load->model('search/message'); - //$this->load->model('message/remove'); - $this->load->model('user/user'); @@ -29,23 +27,21 @@ class ControllerMessageBulkremove extends Controller { $this->data['username'] = Registry::get('username'); - $this->model_search_message->connect_to_pilergetd(); + if(Registry::get('auditor_user') == 0) { + die("go away"); + } foreach($idlist as $id) { AUDIT(ACTION_REMOVE_MESSAGE, '', '', $id, ''); - $piler_id = $this->model_search_message->get_piler_id_by_id($id); + $db->query("UPDATE " . TABLE_META . " SET retained=? WHERE id=?", array(NOW, $id)); -syslog(LOG_INFO, "removing $piler_id"); + syslog(LOG_INFO, $this->data['username'] . " removed message: $id"); - $x = 1; - - if($x == 1) { $this->data['removed']++; } + $this->data['removed']++; } - $this->model_search_message->disconnect_from_pilergetd(); - $this->render(); } diff --git a/webui/model/search/search.php b/webui/model/search/search.php index f4d15621..34606c7e 100644 --- a/webui/model/search/search.php +++ b/webui/model/search/search.php @@ -556,6 +556,8 @@ class ModelSearchSearch extends Model { $this->model_search_message->connect_to_pilergetd(); foreach($query->rows as $m) { + if($m['retained'] < NOW) continue; + $m['shortfrom'] = make_short_string($m['from'], MAX_CGI_FROM_SUBJ_LEN); $m['from'] = escape_gt_lt_quote_symbols($m['from']);