source: trunk/expressoMail1_2/inc/show_embedded_attach.php @ 2360

Revision 2360, 1.9 KB checked in by amuller, 14 years ago (diff)

Ticket #1008 - Adicionando informações sobre licenças

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2
3/***************************************************************************
4        * Expresso Livre                                                           *
5        * http://www.expressolivre.org                                             *
6        * --------------------------------------------                             *
7        *  This program is free software; you can redistribute it and/or modify it *
8        *  under the terms of the GNU General Public License as published by the   *
9        *  Free Software Foundation; either version 2 of the License, or (at your  *
10        *  option) any later version.                                              *
11        \**************************************************************************/
12
13        require_once '../../header.session.inc.php';
14
15        $username = $_SESSION['phpgw_info']['expressomail']['user']['userid'];
16        $password = $_SESSION['phpgw_info']['expressomail']['user']['passwd'];
17        $imap_server = $_SESSION['phpgw_info']['expressomail']['email_server']['imapServer'];
18        $imap_port      = $_SESSION['phpgw_info']['expressomail']['email_server']['imapPort'];
19        $msg_folder = $_GET['msg_folder'];
20        $msg_folder = mb_convert_encoding($msg_folder,"UTF7-IMAP", mb_detect_encoding($msg_folder, "UTF-8, ISO-8859-1", true));
21        if ($_SESSION['phpgw_info']['expressomail']['email_server']['imapTLSEncryption'] == 'yes')
22        {
23                $imap_options = '/tls/novalidate-cert';
24        }
25        else
26        {
27                $imap_options = '/notls/novalidate-cert';
28        }
29       
30        if (is_array($_SESSION['phpgw_info']['expressomail']['email_server']))
31        {
32                $mb = imap_open("{".$imap_server.":".$imap_port.$imap_options."}".$msg_folder, $username, $password);
33       
34                if ($mb)
35                {
36                        $msgno = $_GET['msg_num'];
37                        $embedded_part = $_GET['msg_part'];
38       
39                        $embedded_body = imap_fetchbody($mb, $msgno, $embedded_part, FT_UID);
40       
41                        header("Content-Type: image/jpeg");
42                        header("Content-Disposition: inline");
43                        echo imap_base64($embedded_body);
44                }
45        }
46?>
Note: See TracBrowser for help on using the repository browser.