1 | <?php |
---|
2 | /*************************************************************************** |
---|
3 | * Expresso Livre * |
---|
4 | * http://www.expressolivre.org * |
---|
5 | * -------------------------------------------- * |
---|
6 | * This program is free software; you can redistribute it and/or modify it * |
---|
7 | * under the terms of the GNU General Public License as published by the * |
---|
8 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
9 | * option) any later version. * |
---|
10 | \**************************************************************************/ |
---|
11 | |
---|
12 | /* |
---|
13 | * Requieres |
---|
14 | */ |
---|
15 | require_once '../../header.session.inc.php'; |
---|
16 | require_once dirname(__FILE__).'/class.attachment.inc.php'; |
---|
17 | //------------------------// |
---|
18 | |
---|
19 | /* |
---|
20 | * Get variables |
---|
21 | */ |
---|
22 | $fileType = $_GET['file_type']; |
---|
23 | $msgFolder = $_GET['msg_folder']; |
---|
24 | $msgNumber = $_GET['msg_num']; |
---|
25 | $part = $_GET['msg_part']; |
---|
26 | //-------------------------------------// |
---|
27 | |
---|
28 | /* |
---|
29 | * Main |
---|
30 | */ |
---|
31 | header("Content-Type: image/jpeg"); |
---|
32 | |
---|
33 | if($_GET['msg_num'] != null && $_GET['msg_part'] != null && $_GET['msg_folder'] != null) |
---|
34 | { |
---|
35 | $attachmentObj = new attachment(); |
---|
36 | $attachmentObj->setStructureFromMail($msgFolder, $msgNumber); |
---|
37 | $fileContent = $attachmentObj->getAttachment($part); |
---|
38 | header("Content-Disposition: inline"); |
---|
39 | |
---|
40 | echo $fileContent; |
---|
41 | } |
---|
42 | else if($_SESSION['phpgw_info']['expressomail']['contact_photo']) |
---|
43 | { |
---|
44 | $data = $_SESSION['phpgw_info']['expressomail']['contact_photo']; |
---|
45 | |
---|
46 | if($data) |
---|
47 | { |
---|
48 | $photo = imagecreatefromstring($data[0]); |
---|
49 | if($photo) |
---|
50 | { |
---|
51 | $width = imagesx($photo); |
---|
52 | $height = imagesy($photo); |
---|
53 | $twidth = 60; |
---|
54 | $theight = 80; |
---|
55 | $small_photo = imagecreatetruecolor ($twidth, $theight); |
---|
56 | imagecopyresampled($small_photo, $photo, 0, 0, 0, 0,$twidth, $theight, $width, $height); |
---|
57 | imagejpeg($small_photo,'',100); |
---|
58 | unset($_SESSION['phpgw_info']['expressomail']['contact_photo']); |
---|
59 | } |
---|
60 | } |
---|
61 | } |
---|
62 | else |
---|
63 | readfile("./../../contactcenter/templates/default/images/photo_celepar.png"); |
---|
64 | //------------------------------------------// |
---|
65 | |
---|
66 | ?> |
---|