#!/usr/local/bin/perl # edit_score.cgi # Display a form for editing spam scoring options require './spam-lib.pl'; &can_use_check("score"); &ui_print_header(undef, $text{'score_title'}, ""); $conf = &get_config(); print "$text{'score_desc'}

\n"; &start_form("save_score.cgi", $text{'score_header'}); $hits_param = &version_atleast(3.0) ? "required_score" : "required_hits"; print " $text{'score_hits'} "; $hits = &find($hits_param, $conf); &opt_field($hits_param, $hits, 5, "5"); print " \n"; print " $text{'score_auto'} "; $auto = &find("auto_whitelist_factor", $conf); &opt_field("auto_whitelist_factor", $auto, 5, "0.5"); print " \n"; print " $text{'score_bayes'} "; $bayes = &find("use_bayes", $conf); &yes_no_field("use_bayes", $bayes, 1); print " \n"; print " $text{'score_mx'} "; $mx = &find("check_mx_attempts", $conf); &opt_field("check_mx_attempts", $mx, 4, "2"); print " \n"; print " $text{'score_mxdelay'} "; $mxdelay = &find("check_mx_delay", $conf); &opt_field("check_mx_delay", $mxdelay, 4, "2"); print " \n"; print " $text{'score_rbl'} "; $rbl = &find("skip_rbl_checks", $conf); &yes_no_field("skip_rbl_checks", $rbl, 0); print " \n"; print " $text{'score_timeout'} "; $timeout = &find("rbl_timeout", $conf); &opt_field("rbl_timeout", $timeout, 5, "30"); print " \n"; print " $text{'score_received'} "; $received = &find("num_check_received", $conf); &opt_field("num_check_received", $received, 5, 2); print " \n"; print "


\n"; @langs = &find_value("ok_languages", $conf); %langs = map { $_, 1 } split(/\s+/, join(" ", @langs)); $lmode = !@langs ? 2 : $langs{'all'} ? 1 : 0; print " $text{'score_langs'} \n"; printf " %s (%s)
\n", $lmode == 2 ? 'checked' : '', $text{'default'}, $text{'score_langsall'}; printf " %s
\n", $lmode == 1 ? 'checked' : '', $text{'score_langsall'}; printf " %s
\n", $lmode == 0 ? 'checked' : '', $text{'score_langssel'}; print " \n"; @locales = &find_value("ok_locales", $conf); %locales = map { $_, 1 } split(/\s+/, join(" ", @locales)); $lmode = !@locales ? 2 : $locales{'all'} ? 1 : 0; print " $text{'score_locales'} \n"; printf " %s (%s)
\n", $lmode == 2 ? 'checked' : '', $text{'default'},$text{'score_localesall'}; printf " %s
\n", $lmode == 1 ? 'checked' : '', $text{'score_localesall'}; printf " %s
\n", $lmode == 0 ? 'checked' : '', $text{'score_localessel'}; print " \n"; &end_form(undef, $text{'save'}); &ui_print_footer("", $text{'index_return'});