added an option to limit message restores

This commit is contained in:
SJ
2015-07-28 22:10:50 +02:00
parent 8bde6d145a
commit c95e1b23e7
12 changed files with 30 additions and 7 deletions

View File

@ -40,6 +40,7 @@ class ControllerMessageHeaders extends Controller {
$this->data['message'] = $this->model_search_message->get_message_headers($this->data['piler_id']);
$this->data['can_download'] = $this->model_audit_audit->can_download();
$this->data['can_restore'] = $this->model_audit_audit->can_restore();
$this->render();
}

View File

@ -40,6 +40,7 @@ class ControllerMessageJournal extends Controller {
$this->data['data'] = $this->model_search_message->get_message_journal($this->data['piler_id']);
$this->data['can_download'] = $this->model_audit_audit->can_download();
$this->data['can_restore'] = $this->model_audit_audit->can_restore();
$this->render();
}

View File

@ -15,7 +15,7 @@ class ControllerMessageRestore extends Controller {
$this->load->model('search/search');
$this->load->model('search/message');
$this->load->model('audit/audit');
$this->load->model('user/user');
$this->load->model('mail/mail');
@ -38,6 +38,10 @@ class ControllerMessageRestore extends Controller {
}
if(!$this->model_audit_audit->can_restore()) {
die("cannot restore at the moment");
}
if(!verify_piler_id($this->data['id'])) {
AUDIT(ACTION_UNKNOWN, '', '', $this->data['id'], 'unknown piler id: ' . $this->data['id']);
die("invalid id: " . $this->data['id']);

View File

@ -81,6 +81,7 @@ class ControllerMessageView extends Controller {
$this->data['images'] = array();
$this->data['can_download'] = $this->model_audit_audit->can_download();
$this->data['can_restore'] = $this->model_audit_audit->can_restore();
foreach($this->data['attachments'] as $a) {
if(preg_match("/image/", $a['type'])) {