diff --git a/config.php.in b/config.php.in index 806d7b1f..61356182 100644 --- a/config.php.in +++ b/config.php.in @@ -160,7 +160,7 @@ $config['PASSWORD_CHANGE_ENABLED'] = 0; $config['ENABLE_STATISTICS'] = 1; $config['ENABLE_HISTORY'] = 1; $config['ENABLE_DELETE'] = 0; -$config['AUTHORIZE_DELETE'] = 0; +$config['NEED_TO_APPROVE_DELETE'] = 0; $config['ENABLE_REMOTE_IMAGES'] = '0'; $config['ENABLE_ON_THE_FLY_VERIFICATION'] = 0; $config['ENABLE_LDAP_IMPORT_FEATURE'] = 0; diff --git a/util/db-mysql.sql b/util/db-mysql.sql index 5f6dd737..58b01f62 100644 --- a/util/db-mysql.sql +++ b/util/db-mysql.sql @@ -472,11 +472,12 @@ create table if not exists `timestamp` ( create table if not exists `deleted` ( - `id` bigint unsigned not null auto_increment, + `id` bigint unsigned not null unique, `email` varchar(128) not null, `reason` varchar(128) not null, - `date1` int unsigned not null, - `date2` int unsigned not null, + `date1` int unsigned default 0, + `date2` int unsigned default 0, `deleted` tinyint(1) default 0, - primary key (`id`) + key (`id`), + key (deleted) ) Engine=InnoDB; diff --git a/webui/controller/audit/removal.php b/webui/controller/audit/removal.php new file mode 100644 index 00000000..fe89fa52 --- /dev/null +++ b/webui/controller/audit/removal.php @@ -0,0 +1,26 @@ +id = "content"; + $this->template = "audit/removal.tpl"; + $this->layout = "common/layout-audit"; + + $request = Registry::get('request'); + $db = Registry::get('db'); + + $this->load->model('audit/removal'); + + if(Registry::get('admin_user') == 0 && Registry::get('auditor_user') == 0) { + die("go away"); + } + + $this->data['data'] = $this->model_audit_removal->get_pending_removals(); + + $this->render(); + } + +} diff --git a/webui/controller/message/bulkremove.php b/webui/controller/message/bulkremove.php index 3af7571b..528b5791 100644 --- a/webui/controller/message/bulkremove.php +++ b/webui/controller/message/bulkremove.php @@ -33,10 +33,16 @@ class ControllerMessageBulkremove extends Controller { die("go away"); } - foreach($idlist as $id) { - $db->query("INSERT INTO " . TABLE_DELETED . " (id, email, reason, date1) VALUES(?,?,?,?)", [$id, $this->data['username'], $this->request->post['reason'], NOW]); + if(NEED_TO_APPROVE_DELETE) { + $deleted = 0; + } else { + $deleted = 1; + } - if(AUTHORIZE_DELETE) { + foreach($idlist as $id) { + $db->query("INSERT INTO " . TABLE_DELETED . " (id, email, reason, date1, deleted) VALUES(?,?,?,?,?)", [$id, $this->data['username'], $this->request->post['reason'], NOW, $deleted]); + + if(NEED_TO_APPROVE_DELETE) { AUDIT(ACTION_MARK_MESSAGE_FOR_REMOVAL, '', '', $id, ''); syslog(LOG_INFO, $this->data['username'] . " marked message for removal: $id"); } else { diff --git a/webui/index.php b/webui/index.php index 2a1b7946..0c284fc0 100644 --- a/webui/index.php +++ b/webui/index.php @@ -31,6 +31,7 @@ Registry::set('username', getAuthenticatedUsername()); Registry::set('admin_user', isAdminUser()); Registry::set('auditor_user', isAuditorUser()); Registry::set('readonly_admin', isReadonlyAdmin()); +Registry::set('data_officer', isDataOfficer()); $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_PREFIX); diff --git a/webui/language/cz/messages.php b/webui/language/cz/messages.php index 7b162dec..a0b7bbfc 100644 --- a/webui/language/cz/messages.php +++ b/webui/language/cz/messages.php @@ -481,4 +481,7 @@ $_['text_with_selected'] = 'S označenými'; $_['text_compliance_warning'] = 'The delete feature is enabled, therefore the archive is NOT compliant!'; $_['text_private'] = "Private"; -$_['text_delete_reason'] = "Delete reason"; +$_['text_delete_reason'] = "Reason of removal"; +$_['text_need_to_approve_removal'] = "Need to approve removal"; +$_['text_deleted'] = "Deleted"; +$_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/de/messages.php b/webui/language/de/messages.php index e8f20a7b..62ee590e 100644 --- a/webui/language/de/messages.php +++ b/webui/language/de/messages.php @@ -488,4 +488,7 @@ $_['text_compliance_warning'] = 'Die Löschfunktion ist aktiviert, aus diesem Gr $_['text_folder_rules'] = "Verzeichnisregeln"; $_['text_private'] = "Privat"; -$_['text_delete_reason'] = "Delete reason"; +$_['text_delete_reason'] = "Reason of removal"; +$_['text_need_to_approve_removal'] = "Need to approve removal"; +$_['text_deleted'] = "Deleted"; +$_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/en/messages.php b/webui/language/en/messages.php index f7ee37a8..61c92b39 100644 --- a/webui/language/en/messages.php +++ b/webui/language/en/messages.php @@ -79,7 +79,8 @@ $_['text_deferred_queue'] = "deferred queue"; $_['text_deferred_queue_sender'] = "deferred queue vs. sender"; $_['text_delay'] = "Delay"; $_['text_delete_confirm_message'] = "Do you wish to delete"; -$_['text_delete_reason'] = "Delete reason"; +$_['text_delete_reason'] = "Reason of removal"; +$_['text_deleted'] = "Deleted"; $_['text_deleted_users'] = "deleted"; $_['text_deliver'] = "Deliver"; $_['text_delivered'] = "Delivered"; @@ -228,6 +229,7 @@ $_['text_monitor'] = "Monitor"; $_['text_months'] = "months"; $_['text_monthly_report'] = "Monthly report"; +$_['text_need_to_approve_removal'] = "Need to approve removal"; $_['text_new'] = "new"; $_['text_new_users'] = "new"; $_['text_next'] = "Next"; @@ -384,6 +386,7 @@ $_['text_user'] = "User"; $_['text_users'] = "Users"; $_['text_user_id'] = "User id"; $_['text_user_auditor'] = "Auditor"; +$_['text_user_data_officer'] = "Data officer"; $_['text_user_domainadmin'] = "Domain admin"; $_['text_user_management'] = "User management"; $_['text_user_masteradmin'] = "Master admin"; diff --git a/webui/language/es/messages.php b/webui/language/es/messages.php index fe6717f9..bbfa752f 100644 --- a/webui/language/es/messages.php +++ b/webui/language/es/messages.php @@ -486,4 +486,7 @@ $_['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"; -$_['text_delete_reason'] = "Delete reason"; +$_['text_delete_reason'] = "Reason of removal"; +$_['text_need_to_approve_removal'] = "Need to approve removal"; +$_['text_deleted'] = "Deleted"; +$_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/fr/messages.php b/webui/language/fr/messages.php index 53a35f6d..7a8dca7a 100644 --- a/webui/language/fr/messages.php +++ b/webui/language/fr/messages.php @@ -483,4 +483,7 @@ $_['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"; -$_['text_delete_reason'] = "Delete reason"; +$_['text_delete_reason'] = "Reason of removal"; +$_['text_need_to_approve_removal'] = "Need to approve removal"; +$_['text_deleted'] = "Deleted"; +$_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/hu/messages.php b/webui/language/hu/messages.php index 4a33f47d..1314091e 100644 --- a/webui/language/hu/messages.php +++ b/webui/language/hu/messages.php @@ -80,6 +80,7 @@ $_['text_deferred_queue_sender'] = "későbbi kiküldésre váró üzenetsor (fe $_['text_delay'] = "Késleltetés"; $_['text_delete_confirm_message'] = "Törölni akarja"; $_['text_delete_reason'] = "Törlés oka"; +$_['text_deleted'] = "Törölt"; $_['text_deleted_users'] = "törölt"; $_['text_deliver'] = "Kézbesítés"; $_['text_delivered'] = "Kézbesített"; @@ -229,6 +230,7 @@ $_['text_monitor'] = "Monitor"; $_['text_months'] = "hónap"; $_['text_monthly_report'] = "Havi jelentés"; +$_['text_need_to_approve_removal'] = "Jóvá kell hagyatni a törlést"; $_['text_new'] = "új"; $_['text_new_users'] = "új"; $_['text_next'] = "Következő"; @@ -386,6 +388,7 @@ $_['text_user'] = "Felhasználó"; $_['text_users'] = "Felhasználók"; $_['text_user_id'] = "Felhasználó azonosító"; $_['text_user_auditor'] = "Auditor"; +$_['text_user_data_officer'] = "Adatvédelmi biztos"; $_['text_user_domainadmin'] = "Domain admin"; $_['text_user_management'] = "Felhasználók"; $_['text_user_masteradmin'] = "Mester admin"; diff --git a/webui/language/pl/messages.php b/webui/language/pl/messages.php index d75ba6aa..69a7f815 100644 --- a/webui/language/pl/messages.php +++ b/webui/language/pl/messages.php @@ -483,4 +483,7 @@ $_['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"; -$_['text_delete_reason'] = "Delete reason"; +$_['text_delete_reason'] = "Reason of removal"; +$_['text_need_to_approve_removal'] = "Need to approve removal"; +$_['text_deleted'] = "Deleted"; +$_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/pt/messages.php b/webui/language/pt/messages.php index 6c4db8f2..d721f73e 100644 --- a/webui/language/pt/messages.php +++ b/webui/language/pt/messages.php @@ -476,4 +476,7 @@ $_['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"; -$_['text_delete_reason'] = "Delete reason"; +$_['text_delete_reason'] = "Reason of removal"; +$_['text_need_to_approve_removal'] = "Need to approve removal"; +$_['text_deleted'] = "Deleted"; +$_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/ru/messages.php b/webui/language/ru/messages.php index cb3dec6e..278b89c2 100644 --- a/webui/language/ru/messages.php +++ b/webui/language/ru/messages.php @@ -484,4 +484,7 @@ $_['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"; -$_['text_delete_reason'] = "Delete reason"; +$_['text_delete_reason'] = "Reason of removal"; +$_['text_need_to_approve_removal'] = "Need to approve removal"; +$_['text_deleted'] = "Deleted"; +$_['text_user_data_officer'] = "Data officer"; diff --git a/webui/language/tr/messages.php b/webui/language/tr/messages.php index 2e25c377..31160f49 100644 --- a/webui/language/tr/messages.php +++ b/webui/language/tr/messages.php @@ -484,4 +484,7 @@ $_['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"; -$_['text_delete_reason'] = "Delete reason"; +$_['text_delete_reason'] = "Reason of removal"; +$_['text_need_to_approve_removal'] = "Need to approve removal"; +$_['text_deleted'] = "Deleted"; +$_['text_user_data_officer'] = "Data officer"; diff --git a/webui/model/audit/removal.php b/webui/model/audit/removal.php new file mode 100644 index 00000000..a256e6c0 --- /dev/null +++ b/webui/model/audit/removal.php @@ -0,0 +1,16 @@ + 0) { $limit = " LIMIT " . (int)$from . ", " . (int)$page_len; } + + $query = $this->db->query("SELECT * FROM " . TABLE_DELETED . " WHERE deleted=0 ORDER BY date1 DESC $limit"); + + return $query->rows; + } + +} diff --git a/webui/system/misc.php b/webui/system/misc.php index 8908461e..99145407 100644 --- a/webui/system/misc.php +++ b/webui/system/misc.php @@ -77,6 +77,14 @@ function isReadonlyAdmin() { return 0; } +function isDataOfficer() { + $session = Registry::get('session'); + + if($session->get("admin_user") == 4){ return 1; } + + return 0; +} + function logout() { $session = Registry::get('session'); diff --git a/webui/view/theme/default/templates/audit/removal.tpl b/webui/view/theme/default/templates/audit/removal.tpl new file mode 100644 index 00000000..e2debc75 --- /dev/null +++ b/webui/view/theme/default/templates/audit/removal.tpl @@ -0,0 +1,51 @@ +