mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-13 01:37:02 +02:00
download attachments in 1 zip file
This commit is contained in:
45
webui/controller/message/attachments.php
Normal file
45
webui/controller/message/attachments.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerMessageAttachments extends Controller {
|
||||
|
||||
public function index(){
|
||||
|
||||
$this->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('message/zip');
|
||||
|
||||
$this->document->title = $this->data['text_message'];
|
||||
|
||||
$this->data['id'] = @$this->request->get['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']);
|
||||
}
|
||||
|
||||
$this->data['piler_id'] = $this->model_search_message->get_piler_id_by_id($this->data['id']);
|
||||
|
||||
//AUDIT(ACTION_DOWNLOAD_ATTACHMENT, '', '', $messageid, $this->data['id']);
|
||||
|
||||
$this->model_message_zip->download_attachments_as_zip($this->data['piler_id']);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user