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

Revision 5509, 2.3 KB checked in by gustavo, 12 years ago (diff)

Ticket #2488 - Adicionar cabecalho de licenca em arquivos que nao o possuem

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
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 */
31header("Content-Type: image/jpeg");
32
33if($_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}
42else 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}
62else
63       readfile("./../../contactcenter/templates/default/images/photo_celepar.png");
64//------------------------------------------//
65
66?>
Note: See TracBrowser for help on using the repository browser.