source: trunk/expressoMail1_2/inc/show_img.php @ 5317

Revision 5317, 1.5 KB checked in by niltonneto, 12 years ago (diff)

Ticket #2423 - Corrigido problema ocasionado por erro de sintaxe.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2/*
3 * Requieres
4 */
5 require_once '../../header.session.inc.php';
6 require_once dirname(__FILE__).'/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 */
21header("Content-Type: image/jpeg");
22
23if($_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}
32else 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}
52else
53       readfile("./../../contactcenter/templates/default/images/photo_celepar.png");
54//------------------------------------------//
55
56?>
Note: See TracBrowser for help on using the repository browser.