<?
//   XUL Webmail, a web based mailclient
//
//   Copyright (C) 2004 Wouter van Wijk (wvw@dds.nl),
//   based on XUL Channels, Copyright (C) 2003 Tim Broddin
//
//   This program is free software; you can redistribute it and/or modify
//   it under the terms of the GNU General Public License as published by
//   the Free Software Foundation; either version 2 of the License, or
//   (at your option) any later version.
//
//   This program is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with this program; if not, write to the Free Software
//   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

// session check
session_start();
if (!isset($_SESSION['user']))
{
	header("Location: error.php?ec=2");
	exit;
}

header ("Content-type: application/vnd.mozilla.xul+xml; charset=iso-8859-15");
echo '<' . '?xml version="1.0" encoding="iso-8859-15" ?' . '>';
echo '<' . '?xml-stylesheet href="chrome://global/skin/" type="text/css"?' . '>' . "\n";
echo '<' . '?xml-stylesheet href="xulwebmail.css" type="text/css"?' . '>' . "\n";

include('settings.php');


?>

<window title="View Source"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="margin: 10px;"
id="about">
	<script type="application/x-javascript" src="chrome://global/content/dialogOverlay.js" />
	<vbox flex="1">
		<textbox readonly="true" style="margin-bottom: 5px;" multiline="true" flex="5" value="<?
   $id=$_GET['id'];
   $mailbox=$_GET['mailbox'];
//not done yet, linebreaks don't work
   if (($id != '') && ($id != 0)) {
          echo htmlspecialchars(getMessageSource($mailbox, $id));
   } else {
   	echo "<h1>$standardtitle</h1><p>Please select a mailbox and a message.</p>";
   }
?>" />
		<button onclick="window.close();" label="Close" />
	</vbox>
</window>
