piler/webui/controller/message/headers.php

56 lines
1.7 KiB
PHP
Raw Normal View History

2012-02-08 23:14:28 +01:00
<?php
class ControllerMessageHeaders extends Controller {
public function index(){
$this->id = "content";
if(MOBILE_DEVICE) {
$this->template = "message/headers-mobile.tpl";
} else {
$this->template = "message/headers.tpl";
}
2012-02-08 23:14:28 +01:00
$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('audit/audit');
2012-02-08 23:14:28 +01:00
$this->load->model('user/user');
$this->document->title = $this->data['text_message'];
$this->data['id'] = @$this->request->get['id'];
if(!verify_piler_id($this->data['id'])) {
2012-09-06 15:27:20 +02:00
AUDIT(ACTION_UNKNOWN, '', '', $this->data['id'], 'unknown id: ' . $this->data['id']);
2012-02-08 23:14:28 +01:00
die("invalid id: " . $this->data['id']);
}
2012-09-06 15:27:20 +02:00
if(!$this->model_search_search->check_your_permission_by_id($this->data['id'])) {
2012-02-08 23:14:28 +01:00
AUDIT(ACTION_UNAUTHORIZED_VIEW_MESSAGE, '', '', $this->data['id'], '');
die("no permission for " . $this->data['id']);
}
AUDIT(ACTION_VIEW_HEADER, '', '', $this->data['id'], '');
if(Registry::get('auditor_user') == 1) { $this->data['rcpt'] = $this->model_search_search->get_message_addresses_in_my_domain($this->data['id']); }
2012-09-06 15:27:20 +02:00
$this->data['piler_id'] = $this->model_search_message->get_piler_id_by_id($this->data['id']);
2013-07-12 11:14:09 +02:00
$this->data['message'] = $this->model_search_message->get_message_headers($this->data['piler_id']);
2012-02-08 23:14:28 +01:00
$this->data['can_download'] = $this->model_audit_audit->can_download();
$this->data['can_restore'] = $this->model_audit_audit->can_restore();
2012-02-08 23:14:28 +01:00
$this->render();
}
}
?>