alecpl
2009-12-05 a82dcd420a0b5266c543aa184fc0628f823e1d9f
commit | author | age
f11541 1 <?php
155bbb 2 /*
A 3
4  +-----------------------------------------------------------------------+
5  | bin/html2text.php                                                     |
6  |                                                                       |
7  | This file is part of the RoundCube Webmail client                     |
cbbef3 8  | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland                 |
155bbb 9  | Licensed under the GNU GPL                                            |
A 10  |                                                                       |
11  | PURPOSE:                                                              |
12  |   Convert HTML message to plain text                                  |
13  |                                                                       |
14  +-----------------------------------------------------------------------+
15  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16  +-----------------------------------------------------------------------+
17
18  $Id$
19
20 */
f11541 21
b685e9 22 define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/');
1608f4 23 require INSTALL_PATH . 'program/include/iniset.php';
f11541 24
1608f4 25 $RCMAIL = rcmail::get_instance();
f11541 26
1608f4 27 if (!empty($RCMAIL->user->ID)) {
T 28   $converter = new html2text($HTTP_RAW_POST_DATA);
29
30   header('Content-Type: text/plain; charset=UTF-8');
31   print trim($converter->get_text());
32 }
33 else {
34   header("HTTP/1.0 403 Forbidden");
35   echo "Requires a valid user session";
36 }
f11541 37
809428 38 ?>