]> git.donarmstrong.com Git - roundcube.git/blob - bin/html2text.php
Merge commit 'debian/0.2.1-1' into debian
[roundcube.git] / bin / html2text.php
1 <?php
2 /*
3
4  +-----------------------------------------------------------------------+
5  | bin/html2text.php                                                     |
6  |                                                                       |
7  | This file is part of the RoundCube Webmail client                     |
8  | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland                 |
9  | Licensed under the GNU GPL                                            |
10  |                                                                       |
11  | PURPOSE:                                                              |
12  |   Convert HTML message to plain text                                  |
13  |                                                                       |
14  +-----------------------------------------------------------------------+
15  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16  +-----------------------------------------------------------------------+
17
18  $Id: html2text.php 2237 2009-01-17 01:55:39Z till $
19
20 */
21
22 define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/');
23 require INSTALL_PATH . 'program/include/iniset.php';
24
25 $RCMAIL = rcmail::get_instance();
26
27 if (!empty($RCMAIL->user->ID)) {
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 }
37
38 ?>