1 | <?php |
---|
2 | /* |
---|
3 | * Requieres |
---|
4 | */ |
---|
5 | require_once '../../header.session.inc.php'; |
---|
6 | require_once $_SESSION['rootPath'].'/expressoMail1_2/inc/class.attachment.inc.php'; |
---|
7 | //------------------------// |
---|
8 | |
---|
9 | /* |
---|
10 | * Get variables |
---|
11 | */ |
---|
12 | $fileType = $_GET['file_type']; |
---|
13 | $msgFolder = $_GET['msg_folder']; |
---|
14 | $msgNumber = $_GET['msg_num']; |
---|
15 | $part = $_GET['msg_part']; |
---|
16 | //-------------------------------------// |
---|
17 | |
---|
18 | /* |
---|
19 | * Main |
---|
20 | */ |
---|
21 | header("Content-Type: image/jpeg"); |
---|
22 | |
---|
23 | if($_GET['msg_num'] != null && $_GET['msg_part'] != null && $_GET['msg_folder'] != null) |
---|
24 | { |
---|
25 | $attachmentObj = new attachment(); |
---|
26 | $attachmentObj->setStructureFromMail($msgFolder, $msgNumber); |
---|
27 | $fileContent = $attachmentObj->getAttachment($part); |
---|
28 | header("Content-Disposition: inline"); |
---|
29 | |
---|
30 | echo $fileContent; |
---|
31 | } |
---|
32 | else if($_SESSION['phpgw_info']['expressomail']['contact_photo']) |
---|
33 | { |
---|
34 | $data = $_SESSION['phpgw_info']['expressomail']['contact_photo']; |
---|
35 | |
---|
36 | if($data) |
---|
37 | { |
---|
38 | $photo = imagecreatefromstring($data[0]); |
---|
39 | if($photo) |
---|
40 | { |
---|
41 | $width = imagesx($photo); |
---|
42 | $height = imagesy($photo); |
---|
43 | $twidth = 60; |
---|
44 | $theight = 80; |
---|
45 | $small_photo = imagecreatetruecolor ($twidth, $theight); |
---|
46 | imagecopyresampled($small_photo, $photo, 0, 0, 0, 0,$twidth, $theight, $width, $height); |
---|
47 | imagejpeg($small_photo,'',100); |
---|
48 | unset($_SESSION['phpgw_info']['expressomail']['contact_photo']); |
---|
49 | } |
---|
50 | } |
---|
51 | } |
---|
52 | else |
---|
53 | readfile("./../../contactcenter/templates/default/images/photo_celepar.png"); |
---|
54 | //------------------------------------------// |
---|
55 | |
---|
56 | ?> |
---|