<?php
/*
 *      Patrick Bores - WebUserPrefs - SpamAssassin user_prefs file editor
 *      Copyright (C) 2003  Patrick Bores
 *      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.
 */
	function report_keys(){
		return array("report_safe","use_terse_report");
	}

	function report_html(){

		$init_report_safe = get_pref("report_safe");
		if($init_report_safe == "") $init_report_safe = "1";

		$init_use_terse_report = get_pref("use_terse_report");
		if($init_use_terse_report == "") $init_use_terse_report = "0";

		eval("\$rc$init_report_safe = \"CHECKED\";");
		$terse_checked = ($init_use_terse_report == "1") ? "CHECKED" : "";

		echo "<b>Report</b><br />
			When the filter identifies a message as spam, it makes a report of all tests and scores assigned.<br /><br />
			<input type=\"radio\" name=\"report_safe_control\" value=\"0\" $rc0 /> Include report in headers of original message<br />
			<input type=\"radio\" name=\"report_safe_control\" value=\"1\" $rc1 /> Include original as MIME attachment to report (Default)<br />
			<input type=\"radio\" name=\"report_safe_control\" value=\"2\" $rc2 /> Include original as text-only attachment to report<br />
			<input type=\"checkbox\" name=\"terse_control\" value=\"1\" $terse_checked /> Use abbreviated report<br />
		";

	}

	function report_apply(){
	
		set_pref("report_safe",$_POST[report_safe_control]);

		$terse = ($_POST[terse_control] != "") ? "1" : "0";
		set_pref("use_terse_report",$terse);
	}

?>
