diff --git a/contrib/webserver/piler-nginx.conf b/contrib/webserver/piler-nginx.conf index 34634603..59a3f41f 100644 --- a/contrib/webserver/piler-nginx.conf +++ b/contrib/webserver/piler-nginx.conf @@ -45,6 +45,7 @@ server { rewrite /message.php /index.php?route=message/view; rewrite /bulkrestore.php /index.php?route=message/bulkrestore; rewrite /bulkremove.php /index.php?route=message/bulkremove; + rewrite /rejectremove.php /index.php?route=message/rejectremove; rewrite /bulkpdf.php /index.php?route=message/bulkpdf; rewrite /folders.php /index.php?route=folder/list&; rewrite /settings.php /index.php?route=user/settings; diff --git a/webui/.htaccess b/webui/.htaccess index 6213a948..849f5498 100644 --- a/webui/.htaccess +++ b/webui/.htaccess @@ -9,6 +9,7 @@ RewriteRule ^audit-helper.php /index.php?route=audit/helper [L] RewriteRule ^message.php /index.php?route=message/view [L] RewriteRule ^bulkrestore.php /index.php?route=message/bulkrestore [L] RewriteRule ^bulkremove.php /index.php?route=message/bulkremove [L] +RewriteRule ^rejectremove.php /index.php?route=message/rejectremove [L] RewriteRule ^bulkpdf.php /index.php?route=message/bulkpdf [L] RewriteRule ^folders.php /index.php?route=folder/list& [QSA,L] RewriteRule ^settings.php /index.php?route=user/settings [L] diff --git a/webui/controller/login/login.php b/webui/controller/login/login.php index 67efb2f2..e378cf37 100644 --- a/webui/controller/login/login.php +++ b/webui/controller/login/login.php @@ -75,7 +75,7 @@ class ControllerLoginLogin extends Controller { if(isAdminUser() == 1) { header("Location: " . SITE_URL . "index.php?route=health/health"); exit; - } else ifisAdminUser() == 4) { + } else if(isDataOfficer() == 1) { header("Location: " . SITE_URL . "index.php?route=audit/removal"); exit; } diff --git a/webui/controller/message/rejectremove.php b/webui/controller/message/rejectremove.php new file mode 100644 index 00000000..9165e567 --- /dev/null +++ b/webui/controller/message/rejectremove.php @@ -0,0 +1,46 @@ +id = "content"; + $this->template = "audit/remove.tpl"; + $this->layout = "common/layout"; + + $session = Registry::get('session'); + $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']; + + if(!isset($this->request->post['id']) || $this->request->post['id'] == '') { die("no id parameter given"); } + if(!isset($this->request->post['confirmed']) || $this->request->post['confirmed'] != 1) { die("not confirmed"); } + if(!isset($this->request->post['reason2']) || $this->request->post['reason2'] == '') { die("no reason2 parameter given"); } + + $id = (int)$this->request->post['id']; + + if(!$this->model_search_search->check_your_permission_by_id($id)) { + die("no permission for $id"); + } + + $this->data['username'] = Registry::get('username'); + + if(Registry::get('data_officer') == 0) { + die("go away"); + } + + // Shouldn't we ask for a token or something as well? + + $db->query("UPDATE " . TABLE_DELETED . " SET deleted=0, date2=?, reason2=? WHERE id=?", [NOW, $this->request->post['reason2'], $id]); + syslog(LOG_INFO, $this->data['username'] . " rejected removing message: $id"); + + $this->render(); + } + +} diff --git a/webui/language/cz/messages.php b/webui/language/cz/messages.php index a0b7bbfc..94eb828a 100644 --- a/webui/language/cz/messages.php +++ b/webui/language/cz/messages.php @@ -484,4 +484,6 @@ $_['text_private'] = "Private"; $_['text_delete_reason'] = "Reason of removal"; $_['text_need_to_approve_removal'] = "Need to approve removal"; $_['text_deleted'] = "Deleted"; +$_['text_reason_of_rejection'] = "Reason of rejection"; +$_['text_reject'] = "Reject"; $_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/de/messages.php b/webui/language/de/messages.php index 62ee590e..cd0e675b 100644 --- a/webui/language/de/messages.php +++ b/webui/language/de/messages.php @@ -491,4 +491,6 @@ $_['text_private'] = "Privat"; $_['text_delete_reason'] = "Reason of removal"; $_['text_need_to_approve_removal'] = "Need to approve removal"; $_['text_deleted'] = "Deleted"; +$_['text_reason_of_rejection'] = "Reason of rejection"; +$_['text_reject'] = "Reject"; $_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/en/messages.php b/webui/language/en/messages.php index 61c92b39..da99cad7 100644 --- a/webui/language/en/messages.php +++ b/webui/language/en/messages.php @@ -284,6 +284,8 @@ $_['text_recipient'] = "Recipient"; $_['text_ref'] = "Reference"; $_['text_refresh_period'] = "Refresh period"; $_['text_refresh_qr_code'] = "Refresh QR code"; +$_['text_reject'] = "Reject"; +$_['text_reason_of_rejection'] = "Reason of rejection"; $_['text_relay_details'] = "Relay details"; $_['text_relay_status'] = "Relay status"; $_['text_remove'] = "Remove"; diff --git a/webui/language/es/messages.php b/webui/language/es/messages.php index bbfa752f..eb59a369 100644 --- a/webui/language/es/messages.php +++ b/webui/language/es/messages.php @@ -489,4 +489,6 @@ $_['text_private'] = "Private"; $_['text_delete_reason'] = "Reason of removal"; $_['text_need_to_approve_removal'] = "Need to approve removal"; $_['text_deleted'] = "Deleted"; +$_['text_reason_of_rejection'] = "Reason of rejection"; +$_['text_reject'] = "Reject"; $_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/fr/messages.php b/webui/language/fr/messages.php index 7a8dca7a..87c796cb 100644 --- a/webui/language/fr/messages.php +++ b/webui/language/fr/messages.php @@ -486,4 +486,6 @@ $_['text_private'] = "Private"; $_['text_delete_reason'] = "Reason of removal"; $_['text_need_to_approve_removal'] = "Need to approve removal"; $_['text_deleted'] = "Deleted"; +$_['text_reason_of_rejection'] = "Reason of rejection"; +$_['text_reject'] = "Reject"; $_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/hu/messages.php b/webui/language/hu/messages.php index 1314091e..974f34d4 100644 --- a/webui/language/hu/messages.php +++ b/webui/language/hu/messages.php @@ -281,10 +281,12 @@ $_['text_queue_status'] = "Queue státusz"; $_['text_quick_search'] = "Gyorskeresés"; $_['text_realname'] = "Név"; +$_['text_reason_of_rejection'] = "Elutasítás oka"; $_['text_recipient'] = "Címzett"; $_['text_ref'] = "Hivatkozás"; $_['text_refresh_period'] = "Frissítési periódus"; $_['text_refresh_qr_code'] = "QR kód frissítése"; +$_['text_reject'] = "Elutasítás"; $_['text_relay_details'] = "Relay részletek"; $_['text_relay_status'] = "Relay státusz"; $_['text_remove'] = "Törlés"; diff --git a/webui/language/pl/messages.php b/webui/language/pl/messages.php index 69a7f815..82927807 100644 --- a/webui/language/pl/messages.php +++ b/webui/language/pl/messages.php @@ -486,4 +486,6 @@ $_['text_private'] = "Private"; $_['text_delete_reason'] = "Reason of removal"; $_['text_need_to_approve_removal'] = "Need to approve removal"; $_['text_deleted'] = "Deleted"; +$_['text_reason_of_rejection'] = "Reason of rejection"; +$_['text_reject'] = "Reject"; $_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/pt/messages.php b/webui/language/pt/messages.php index d721f73e..faaa18b8 100644 --- a/webui/language/pt/messages.php +++ b/webui/language/pt/messages.php @@ -479,4 +479,6 @@ $_['text_private'] = "Private"; $_['text_delete_reason'] = "Reason of removal"; $_['text_need_to_approve_removal'] = "Need to approve removal"; $_['text_deleted'] = "Deleted"; +$_['text_reject'] = "Reject"; +$_['text_reason_of_rejection'] = "Reason of rejection"; $_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/ru/messages.php b/webui/language/ru/messages.php index 278b89c2..4c1ab15e 100644 --- a/webui/language/ru/messages.php +++ b/webui/language/ru/messages.php @@ -475,7 +475,7 @@ $_['text_domain_delete_confirm_message'] = 'Вы хотите удалить д $_['text_group_delete_confirm_message'] = 'Вы хотите удалить группу'; $_['text_ldap_delete_confirm_message'] = 'Вы хотите удалить настройки LDAP'; $_['text_customer_delete_confirm_message'] = 'Вы хотите уделить потребителя'; -$_['text_with_selected'] = 'С выделенным'; +$_['text_with_selected'] = 'С выделенным'; $_['text_assigned_email_addresses'] = "Assigned email addresses"; $_['text_storage'] = "Storage"; @@ -487,4 +487,6 @@ $_['text_private'] = "Private"; $_['text_delete_reason'] = "Reason of removal"; $_['text_need_to_approve_removal'] = "Need to approve removal"; $_['text_deleted'] = "Deleted"; +$_['text_reason_of_rejection'] = "Reason of rejection"; +$_['text_reject'] = "Reject"; $_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/tr/messages.php b/webui/language/tr/messages.php index 31160f49..317d4dc1 100644 --- a/webui/language/tr/messages.php +++ b/webui/language/tr/messages.php @@ -487,4 +487,6 @@ $_['text_private'] = "Private"; $_['text_delete_reason'] = "Reason of removal"; $_['text_need_to_approve_removal'] = "Need to approve removal"; $_['text_deleted'] = "Deleted"; +$_['text_reason_of_rejection'] = "Reason of rejection"; +$_['text_reject'] = "Reject"; $_['text_user_data_officer'] = "Data officer"; diff --git a/webui/view/javascript/piler-in.js b/webui/view/javascript/piler-in.js index a9004ae3..db84830d 100644 --- a/webui/view/javascript/piler-in.js +++ b/webui/view/javascript/piler-in.js @@ -385,6 +385,23 @@ var Piler = }, + reject_removing_message:function(id, reason2) + { + Piler.log("[reject_removing_message]", id, reason2); + + Piler.poor_mans_keepalive_for_dummy_browsers(); + + jQuery.ajax('/index.php?route=message/rejectremove', { + data: { id: id, confirmed: 1, reason2: reason2 }, + type: "POST" + }) + .done( function( a ) {}) + .fail(function( a, b ) { alert("Problem retrieving XML data:" + b) }); + + $('#delete-rejected-modal').modal('hide') + }, + + bulk_restore_messages:function(msg, email) { Piler.log("[bulk_restore_messages]", email); diff --git a/webui/view/theme/default/templates/common/layout-audit.tpl b/webui/view/theme/default/templates/common/layout-audit.tpl index ba61d60a..8912ccfd 100644 --- a/webui/view/theme/default/templates/common/layout-audit.tpl +++ b/webui/view/theme/default/templates/common/layout-audit.tpl @@ -12,19 +12,16 @@ - + - - - - - - + + + diff --git a/webui/view/theme/default/templates/common/layout-email.tpl b/webui/view/theme/default/templates/common/layout-email.tpl index d7fa49cf..bab0d680 100644 --- a/webui/view/theme/default/templates/common/layout-email.tpl +++ b/webui/view/theme/default/templates/common/layout-email.tpl @@ -18,7 +18,7 @@ - + diff --git a/webui/view/theme/default/templates/common/layout-search.tpl b/webui/view/theme/default/templates/common/layout-search.tpl index adf91671..522dd991 100644 --- a/webui/view/theme/default/templates/common/layout-search.tpl +++ b/webui/view/theme/default/templates/common/layout-search.tpl @@ -20,19 +20,15 @@ - + - - - - - - + +
diff --git a/webui/view/theme/default/templates/common/layout.tpl b/webui/view/theme/default/templates/common/layout.tpl index 47357ddb..d3aeff10 100644 --- a/webui/view/theme/default/templates/common/layout.tpl +++ b/webui/view/theme/default/templates/common/layout.tpl @@ -18,14 +18,12 @@ - - - + + + - - - +