diff --git a/util/db-mysql.sql b/util/db-mysql.sql index 7e81030f..e23dccc7 100644 --- a/util/db-mysql.sql +++ b/util/db-mysql.sql @@ -314,6 +314,12 @@ create table if not exists `note` ( ) ENGINE=InnoDB; +create table if not exists `private` ( + `id` bigint unsigned not null unique, + key (`id`) +) ENGINE=InnoDB; + + create table if not exists `remote` ( `remotedomain` char(64) not null primary key, `remotehost` char(64) not null, diff --git a/webui/config.php b/webui/config.php index e9b3e576..66daa5f4 100644 --- a/webui/config.php +++ b/webui/config.php @@ -377,6 +377,7 @@ define('TABLE_GOOGLE_IMAP', 'google_imap'); define('TABLE_AUTOSEARCH', 'autosearch'); define('TABLE_LEGAL_HOLD', 'legal_hold'); define('TABLE_TIMESTAMP', 'timestamp'); +define('TABLE_PRIVATE', 'private'); define('VIEW_MESSAGES', 'v_messages'); define('EOL', "\n"); @@ -448,6 +449,7 @@ define('ACTION_DOWNLOAD_ATTACHMENT', 15); define('ACTION_UNAUTHORIZED_DOWNLOAD_ATTACHMENT', 16); define('ACTION_VIEW_JOURNAL', 17); define('ACTION_NOT_SPAM', 18); +define('ACTION_MARK_AS_PRIVATE', 19); $actions = array( 'unknown' => 1, @@ -461,7 +463,8 @@ $actions = array( 'search' => 10, 'save_search' => 11, 'download_attachment' => 15, - 'journal' => 17 + 'journal' => 17, + 'private' => 19 ); diff --git a/webui/controller/message/private.php b/webui/controller/message/private.php new file mode 100644 index 00000000..5bcc099d --- /dev/null +++ b/webui/controller/message/private.php @@ -0,0 +1,50 @@ +id = "content"; + $this->template = "message/headers.tpl"; + $this->layout = "common/layout-empty"; + + $request = Registry::get('request'); + $db = Registry::get('db'); + + $this->load->model('search/search'); + $this->load->model('search/message'); + + $this->load->model('user/user'); + + $this->document->title = $this->data['text_message']; + + $this->data['id'] = $this->request->post['id']; + + if(!verify_piler_id($this->data['id'])) { + AUDIT(ACTION_UNKNOWN, '', '', $this->data['id'], 'unknown id: ' . $this->data['id']); + die("invalid id: " . $this->data['id']); + } + + if(!$this->model_search_search->check_your_permission_by_id($this->data['id'])) { + AUDIT(ACTION_UNAUTHORIZED_VIEW_MESSAGE, '', '', $this->data['id'], ''); + die("no permission for " . $this->data['id']); + } + + AUDIT(ACTION_MARK_AS_PRIVATE, '', '', $this->data['id'], ''); + + $this->data['username'] = Registry::get('username'); + + if(Registry::get('auditor_user') == 1) { +syslog(LOG_INFO, "hokamoka:" . $this->data['id']); + + $this->model_search_message->mark_as_private($this->data['id']); + } + + + } + + +} + +?> diff --git a/webui/language/cz/messages.php b/webui/language/cz/messages.php index b15c87af..521d7aad 100644 --- a/webui/language/cz/messages.php +++ b/webui/language/cz/messages.php @@ -480,5 +480,6 @@ $_['text_customer_delete_confirm_message'] = 'Opravdu chcete smazat zákazníka' $_['text_with_selected'] = 'S označenými'; $_['text_compliance_warning'] = 'The delete feature is enabled, therefore the archive is NOT compliant!'; +$_['text_private'] = "Private"; ?> diff --git a/webui/language/de/messages.php b/webui/language/de/messages.php index 1286043f..d466cfa4 100644 --- a/webui/language/de/messages.php +++ b/webui/language/de/messages.php @@ -486,5 +486,6 @@ $_['text_legal_hold'] = "Legal hold"; $_['text_compliance_warning'] = 'The delete feature is enabled, therefore the archive is NOT compliant!'; $_['text_folder_rules'] = "Folder rules"; +$_['text_private'] = "Private"; ?> diff --git a/webui/language/en/messages.php b/webui/language/en/messages.php index 8eb245cd..1027b9c4 100644 --- a/webui/language/en/messages.php +++ b/webui/language/en/messages.php @@ -265,6 +265,7 @@ $_['text_policy_group'] = "Policy group"; $_['text_policy_name'] = "Policy name"; $_['text_previous'] = "Previous"; $_['text_print_message'] = "Print"; +$_['text_private'] = "Private"; $_['text_processed_emails'] = "Processed emails"; $_['text_progress'] = "Progress"; $_['text_purge_all_messages_from_quarantine'] = "Purge all your own messages from quarantine"; diff --git a/webui/language/es/messages.php b/webui/language/es/messages.php index 76ea51e8..fc34f7a9 100644 --- a/webui/language/es/messages.php +++ b/webui/language/es/messages.php @@ -485,5 +485,6 @@ $_['text_legal_hold'] = "Legal hold"; $_['text_compliance_warning'] = 'The delete feature is enabled, therefore the archive is NOT compliant!'; $_['text_folder_rules'] = "Folder rules"; +$_['text_private'] = "Private"; ?> diff --git a/webui/language/fr/messages.php b/webui/language/fr/messages.php index 1423c387..31821eda 100644 --- a/webui/language/fr/messages.php +++ b/webui/language/fr/messages.php @@ -482,5 +482,6 @@ $_['text_legal_hold'] = "Legal hold"; $_['text_compliance_warning'] = 'The delete feature is enabled, therefore the archive is NOT compliant!'; $_['text_folder_rules'] = "Folder rules"; +$_['text_private'] = "Private"; ?> diff --git a/webui/language/hu/messages.iso-8859-2.php b/webui/language/hu/messages.iso-8859-2.php index dcb8b7f3..35fc8bd8 100644 --- a/webui/language/hu/messages.iso-8859-2.php +++ b/webui/language/hu/messages.iso-8859-2.php @@ -266,6 +266,7 @@ $_['text_policy_group'] = "H $_['text_policy_name'] = "Hzirend neve"; $_['text_previous'] = "Elz"; $_['text_print_message'] = "Nyomtats"; +$_['text_private'] = "Privt"; $_['text_processed_emails'] = "Feldolgozott levelek"; $_['text_progress'] = "Sttusz"; $_['text_purge_all_messages_from_quarantine'] = "sszes sajt zenet trlse a karantnbl"; diff --git a/webui/language/hu/messages.php b/webui/language/hu/messages.php index b1011d0e..78b938d4 100644 --- a/webui/language/hu/messages.php +++ b/webui/language/hu/messages.php @@ -266,6 +266,7 @@ $_['text_policy_group'] = "Házirend azonosító"; $_['text_policy_name'] = "Házirend neve"; $_['text_previous'] = "Előző"; $_['text_print_message'] = "Nyomtatás"; +$_['text_private'] = "Privát"; $_['text_processed_emails'] = "Feldolgozott levelek"; $_['text_progress'] = "Státusz"; $_['text_purge_all_messages_from_quarantine'] = "Összes saját üzenet törlése a karanténból"; diff --git a/webui/language/pl/messages.php b/webui/language/pl/messages.php index 6e49d01e..150633a1 100644 --- a/webui/language/pl/messages.php +++ b/webui/language/pl/messages.php @@ -482,5 +482,6 @@ $_['text_with_selected'] = 'wraz z zaznaczonymi'; $_['text_compliance_warning'] = 'The delete feature is enabled, therefore the archive is NOT compliant!'; $_['text_folder_rules'] = "Folder rules"; +$_['text_private'] = "Private"; ?> diff --git a/webui/language/pt/messages.php b/webui/language/pt/messages.php index 417c8bd8..c37a0e96 100644 --- a/webui/language/pt/messages.php +++ b/webui/language/pt/messages.php @@ -475,5 +475,6 @@ $_['text_legal_hold'] = "Legal hold"; $_['text_compliance_warning'] = 'The delete feature is enabled, therefore the archive is NOT compliant!'; $_['text_folder_rules'] = "Folder rules"; +$_['text_private'] = "Private"; ?> diff --git a/webui/language/ru/messages.php b/webui/language/ru/messages.php index 888a27a9..351b768c 100644 --- a/webui/language/ru/messages.php +++ b/webui/language/ru/messages.php @@ -483,5 +483,6 @@ $_['text_legal_hold'] = "Legal hold"; $_['text_compliance_warning'] = 'The delete feature is enabled, therefore the archive is NOT compliant!'; $_['text_folder_rules'] = "Folder rules"; +$_['text_private'] = "Private"; ?> diff --git a/webui/language/tr/messages.php b/webui/language/tr/messages.php index 6f65142c..b931dbd1 100644 --- a/webui/language/tr/messages.php +++ b/webui/language/tr/messages.php @@ -483,5 +483,6 @@ $_['text_legal_hold'] = "Legal hold"; $_['text_compliance_warning'] = 'The delete feature is enabled, therefore the archive is NOT compliant!'; $_['text_folder_rules'] = "Folder rules"; +$_['text_private'] = "Private"; ?> diff --git a/webui/model/search/message.php b/webui/model/search/message.php index 00bb0d30..c2f07305 100644 --- a/webui/model/search/message.php +++ b/webui/model/search/message.php @@ -870,6 +870,15 @@ class ModelSearchMessage extends Model { } + public function mark_as_private($id = 0) { + if($id > 0) { + $query = $this->db->query("INSERT INTO " . TABLE_PRIVATE . " (id) VALUES(?)", array($id)); + } + + return 1; + } + + public function get_message_tag($id = '', $uid = 0) { if($id == '' || $uid <= 0) { return ''; } diff --git a/webui/model/search/search.php b/webui/model/search/search.php index dbe0cd11..81fb4f1f 100644 --- a/webui/model/search/search.php +++ b/webui/model/search/search.php @@ -484,6 +484,7 @@ class ModelSearchSearch extends Model { $rcpt = $srcpt = array(); $tag = array(); $note = array(); + $private = array(); $q = ''; global $SUPPRESS_RECIPIENTS; @@ -515,6 +516,12 @@ class ModelSearchSearch extends Model { if(isset($query->rows)) { + $privates = $this->db->query("SELECT `id` FROM `" . TABLE_PRIVATE . "` WHERE id IN ($q)", $ids); + + foreach ($privates->rows as $p) { + $private[$p['id']] = 1; + } + array_unshift($ids, (int)$session->get("uid")); $tags = $this->db->query("SELECT `id`, `tag` FROM `" . TABLE_TAG . "` WHERE `uid`=? AND `id` IN ($q)", $ids); @@ -571,6 +578,8 @@ class ModelSearchSearch extends Model { $m['note'] = preg_replace("/\"/", "*", strip_tags($m['note'])); $m['tag'] = preg_replace("/\"/", "*", strip_tags($m['tag'])); + if(isset($private[$m['id']])) { $m['private'] = 1; } else { $m['private'] = 0; } + array_push($messages, $m); } @@ -693,6 +702,12 @@ class ModelSearchSearch extends Model { } } else { + + $query = $this->db->query("SELECT id FROM " . TABLE_PRIVATE . " WHERE id=?", array($id)); + if(isset($query->row['id'])) { + return 0; + } + $emails = $session->get("emails"); while(list($k, $v) = each($emails)) { diff --git a/webui/view/javascript/piler-in.js b/webui/view/javascript/piler-in.js index d7c2794f..1eaff6e9 100644 --- a/webui/view/javascript/piler-in.js +++ b/webui/view/javascript/piler-in.js @@ -328,6 +328,23 @@ var Piler = }, + mark_as_private:function(id) + { + Piler.log("[mark_as_private]", id); + + Piler.poor_mans_keepalive_for_dummy_browsers(); + + jQuery.ajax('index.php?route=message/private', { + data: { id: id }, + type: "POST" + }) + .done( function( a ) {}) + .fail(function(a, b) { alert("Problem retrieving XML data:" + b) }); + + Piler.show_message('messagebox1', "OK", 0.8); + }, + + restore_message:function(id) { Piler.log("[restore_message]"); diff --git a/webui/view/theme/default/assets/css/metro-bootstrap.css b/webui/view/theme/default/assets/css/metro-bootstrap.css index 2b175e5c..8e8be126 100644 --- a/webui/view/theme/default/assets/css/metro-bootstrap.css +++ b/webui/view/theme/default/assets/css/metro-bootstrap.css @@ -1690,6 +1690,7 @@ html,body{height:auto !important;height:100%;min-height:100%;} .resultrow{font-style:italic;cursor:pointer;} .resultrow.new{font-style:normal;} .xxx{color:#aaa;} +.private{color:red;} .table-striped tbody>tr.resultrow.selected:nth-child(odd)>td{background-color:#ffffdd;} .table-striped tbody>tr.resultrow.selected:nth-child(even)>td{background-color:#ffffdd;} table#resultstable{margin-bottom:0;} diff --git a/webui/view/theme/default/templates/message/view.tpl b/webui/view/theme/default/templates/message/view.tpl index 12e5625f..84bceeb0 100644 --- a/webui/view/theme/default/templates/message/view.tpl +++ b/webui/view/theme/default/templates/message/view.tpl @@ -25,6 +25,9 @@ |
+ + | + | diff --git a/webui/view/theme/default/templates/search/helper.tpl b/webui/view/theme/default/templates/search/helper.tpl index 8692670c..7b631fbe 100644 --- a/webui/view/theme/default/templates/search/helper.tpl +++ b/webui/view/theme/default/templates/search/helper.tpl @@ -51,7 +51,7 @@