<?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 sensitivity_keys(){
		return array("required_hits");
	}

	function sensitivity_html(){

		$init_hits = get_pref("required_hits");
		if($init_hits == "") $init_hits = "5";

		eval("\$sc$init_hits = \"CHECKED\";");

		echo "<b>Filter Sensitivity:</b><br />";
		echo "You can adjust how sensitive the filter is by using the scale
		below. A setting in the middle is usually sufficient.<br /><br />";

		echo "<center><table cellpadding=\"2\" cellspacing=\"2\" border=\"0\">
		    <tr>
		      <td align=\"left\" rowspan=\"1\" colspan=\"5\">Less Sensitive</td>
		      <td align=\"right\" rowspan=\"1\" colspan=\"5\">More Sensitive</td>
		    </tr>
		    <tr>
		      <td align=\"center\"><input type=\"radio\" name=\"s_control\" value=\"10\" $sc10 /></td>
		      <td align=\"center\"><input type=\"radio\" name=\"s_control\" value=\"9\" $sc9 /></td>
		      <td align=\"center\"><input type=\"radio\" name=\"s_control\" value=\"8\" $sc8 /></td>
		      <td align=\"center\"><input type=\"radio\" name=\"s_control\" value=\"7\" $sc7 /></td>
		      <td align=\"center\"><input type=\"radio\" name=\"s_control\" value=\"6\" $sc6 /></td>
		      <td align=\"center\"><input type=\"radio\" name=\"s_control\" value=\"5\" $sc5 /></td>
		      <td align=\"center\"><input type=\"radio\" name=\"s_control\" value=\"4\" $sc4 /></td>
		      <td align=\"center\"><input type=\"radio\" name=\"s_control\" value=\"3\" $sc3 /></td>
		      <td align=\"center\"><input type=\"radio\" name=\"s_control\" value=\"2\" $sc2 /></td>
		      <td align=\"center\"><input type=\"radio\" name=\"s_control\" value=\"1\" $sc1 /></td>
		    </tr>
		    <tr>
		      <td align=\"center\">10</td>
		      <td align=\"center\">9</td>
		      <td align=\"center\">8</td>
		      <td align=\"center\">7</td>
		      <td align=\"center\">6</td>
		      <td align=\"center\">5</td>
		      <td align=\"center\">4</td>
		      <td align=\"center\">3</td>
		      <td align=\"center\">2</td>
		      <td align=\"center\">1</td>
		    </tr>
		</table></center>";

	}

	function sensitivity_apply(){
		global $username;
		global $domain;
		set_pref("required_hits",$_POST[s_control]);
	}

?>
