#!/usr/bin/perl # Show form for SpamAssassin DB options require './spam-lib.pl'; &ReadParse(); &set_config_file_in(\%in); &can_use_check("db"); &ui_print_header($header_subtext, $text{'db_title'}, ""); $conf = &get_config(); print "$text{'db_desc'}<p>\n"; &start_form("save_db.cgi", $text{'db_header'}); # Work out backend type $dsn = &find_value("user_scores_dsn", $conf); if ($dsn =~ /^DBI:([^:]+):([^:]+):([^:]+)(:(\d+))?$/) { # To database $mode = 1; ($dbdriver, $dbdb, $dbhost, $dbport) = ($1, $2, $3, $5); } elsif ($dsn =~ /^ldap:\/\/([^:]+)(:(\d+))?\/([^\?]+)\?([^\?]+)\?([^\?]+)\?([^=]+)=__USERNAME__/) { # To LDAP $mode = 3; ($ldaphost, $ldapport, $ldapdn, $ldapattr, $ldapscope, $ldapuid) = ($1, $3, $4, $5, $6, $7); } elsif ($dsn) { $mode = 4; } else { $mode = 0; } # Generate input blocks for SQL and LDAP $dbtable = &ui_table_start(undef, undef, 2, [ "nowrap" ]); $dbtable .= &ui_table_row($text{'db_dbdriver'}, &ui_select("dbdriver", $dbdriver || "mysql", [ [ "mysql", "MySQL" ], [ "Pg", "PostgreSQL" ] ], 1, 0, 1)); $dbtable .= &ui_table_row($text{'db_dbhost'}, &ui_textbox("dbhost", $dbhost, 40)); $dbtable .= &ui_table_row($text{'db_dbdb'}, &ui_textbox("dbdb", $dbdb, 40)); $dbtable .= &ui_table_row($text{'db_dbport'}, &ui_opt_textbox("dbport", $dbport, 5, $text{'default'})); $dbtable .= &ui_table_end(); $ldaptable = &ui_table_start(undef, undef, 2, [ "nowrap" ]); $ldaptable .= &ui_table_row($text{'db_ldaphost'}, &ui_textbox("ldaphost", $ldaphost, 40)); $ldaptable .= &ui_table_row($text{'db_ldapport'}, &ui_opt_textbox("ldapport", $ldapport, 5, $text{'default'})); $ldaptable .= &ui_table_row($text{'db_ldapdn'}, &ui_textbox("ldapdn", $ldapdn, 40)); $ldaptable .= &ui_table_row($text{'db_ldapattr'}, &ui_textbox("ldapattr", $ldapattr, 20)); $ldaptable .= &ui_table_row($text{'db_ldapscope'}, &ui_select("ldapscope", $ldapscope || "sub", [ [ "sub", $text{'db_ldapsub'} ], [ "one", $text{'db_ldapone'} ], [ "base", $text{'db_ldapbase'} ] ], 1, 0, 1)); $ldaptable .= &ui_table_row($text{'db_ldapuid'}, &ui_textbox("ldapuid", $ldapuid || "uid", 20)); $ldaptable .= &ui_table_end(); # Show backend type selector print &ui_table_row($text{'db_dsn'}, &ui_radio_table("mode", $mode, [ [ 0, $text{'db_mode0'} ], [ 1, $text{'db_mode1'}, $dbtable ], [ 3, $text{'db_mode3'}, $ldaptable ], [ 4, $text{'db_mode4'}, &ui_textbox("dsn", $dsn, 60) ] ])); print &ui_table_hr(); # DB login $user = &find("user_scores_sql_username", $conf); print &ui_table_row($text{'db_user'}, &opt_field("user_scores_sql_username", $user, 20, undef)); # DB password $pass = &find("user_scores_sql_password", $conf); print &ui_table_row($text{'db_pass'}, &opt_field("user_scores_sql_password", $pass, 20, undef)); print &ui_table_hr(); # LDAP login $user = &find("user_scores_ldap_username", $conf); print &ui_table_row($text{'db_luser'}, &opt_field("user_scores_ldap_username", $user, 40, undef)); # LDAP password $pass = &find("user_scores_ldap_password", $conf); print &ui_table_row($text{'db_lpass'}, &opt_field("user_scores_ldap_password", $pass, 20, undef)); &end_form(undef, $text{'save'}); &ui_print_footer($redirect_url, $text{'index_return'});
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
images | Folder | 0755 |
|
|
lang | Folder | 0755 |
|
|
CHANGELOG | File | 2.12 KB | 0644 |
|
acl_security.pl | File | 1.46 KB | 0755 |
|
apply.cgi | File | 229 B | 0755 |
|
backup_config.pl | File | 890 B | 0755 |
|
cgi_args.pl | File | 189 B | 0755 |
|
config | File | 236 B | 0644 |
|
config-AlmaLinux-7.0-ALL | File | 287 B | 0644 |
|
config-CentOS-Stream-Linux-8.0-ALL | File | 287 B | 0644 |
|
config-CloudLinux-8.0-ALL | File | 287 B | 0644 |
|
config-Oracle-Linux-8.0-ALL | File | 287 B | 0644 |
|
config-Rocky-Linux-7.0-ALL | File | 287 B | 0644 |
|
config-debian-linux | File | 246 B | 0644 |
|
config-debian-linux-10.0-ALL | File | 294 B | 0644 |
|
config-freebsd | File | 288 B | 0644 |
|
config-pardus-linux | File | 224 B | 0644 |
|
config-redhat-linux-24.0-ALL | File | 287 B | 0644 |
|
config-syno-linux | File | 277 B | 0644 |
|
config.info | File | 1.43 KB | 0644 |
|
config.info.ca | File | 1.66 KB | 0644 |
|
config.info.cs | File | 1.41 KB | 0644 |
|
config.info.de | File | 1.67 KB | 0644 |
|
config.info.el | File | 967 B | 0644 |
|
config.info.es | File | 450 B | 0644 |
|
config.info.fr | File | 482 B | 0644 |
|
config.info.hu | File | 0 B | 0644 |
|
config.info.nl | File | 1.45 KB | 0644 |
|
config.info.no | File | 1.41 KB | 0644 |
|
defaultacl | File | 71 B | 0644 |
|
delete_awl.cgi | File | 1.17 KB | 0755 |
|
deleteall_awl.cgi | File | 806 B | 0755 |
|
deleteone_awl.cgi | File | 560 B | 0755 |
|
edit_amavisd.cgi | File | 4.85 KB | 0755 |
|
edit_awl.cgi | File | 3.54 KB | 0755 |
|
edit_db.cgi | File | 3.17 KB | 0755 |
|
edit_header.cgi | File | 4.21 KB | 0755 |
|
edit_manual.cgi | File | 1.06 KB | 0755 |
|
edit_priv.cgi | File | 1.2 KB | 0755 |
|
edit_procmail.cgi | File | 1.87 KB | 0755 |
|
edit_report.cgi | File | 4.3 KB | 0755 |
|
edit_score.cgi | File | 3.18 KB | 0755 |
|
edit_setup.cgi | File | 1.57 KB | 0755 |
|
edit_simple.cgi | File | 1.5 KB | 0755 |
|
edit_user.cgi | File | 2.76 KB | 0755 |
|
edit_white.cgi | File | 4.38 KB | 0755 |
|
index.cgi | File | 5.18 KB | 0755 |
|
install_check.pl | File | 423 B | 0755 |
|
langs | File | 718 B | 0644 |
|
locales | File | 69 B | 0644 |
|
log_parser.pl | File | 329 B | 0755 |
|
module.info | File | 197 B | 0644 |
|
module.info.af | File | 0 B | 0644 |
|
module.info.af.auto | File | 151 B | 0644 |
|
module.info.ar | File | 0 B | 0644 |
|
module.info.ar.auto | File | 219 B | 0644 |
|
module.info.be | File | 0 B | 0644 |
|
module.info.be.auto | File | 231 B | 0644 |
|
module.info.bg | File | 0 B | 0644 |
|
module.info.bg.auto | File | 226 B | 0644 |
|
module.info.ca | File | 114 B | 0644 |
|
module.info.ca.auto | File | 21 B | 0644 |
|
module.info.cs | File | 36 B | 0644 |
|
module.info.cs.auto | File | 128 B | 0644 |
|
module.info.da | File | 0 B | 0644 |
|
module.info.da.auto | File | 154 B | 0644 |
|
module.info.de | File | 141 B | 0644 |
|
module.info.de.auto | File | 21 B | 0644 |
|
module.info.el | File | 0 B | 0644 |
|
module.info.el.auto | File | 266 B | 0644 |
|
module.info.es | File | 40 B | 0644 |
|
module.info.es.auto | File | 129 B | 0644 |
|
module.info.eu | File | 0 B | 0644 |
|
module.info.eu.auto | File | 164 B | 0644 |
|
module.info.fa | File | 0 B | 0644 |
|
module.info.fa.auto | File | 216 B | 0644 |
|
module.info.fi | File | 0 B | 0644 |
|
module.info.fi.auto | File | 156 B | 0644 |
|
module.info.fr | File | 40 B | 0644 |
|
module.info.fr.auto | File | 122 B | 0644 |
|
module.info.he | File | 0 B | 0644 |
|
module.info.he.auto | File | 191 B | 0644 |
|
module.info.hr | File | 0 B | 0644 |
|
module.info.hr.auto | File | 163 B | 0644 |
|
module.info.hu | File | 41 B | 0644 |
|
module.info.hu.auto | File | 129 B | 0644 |
|
module.info.it | File | 0 B | 0644 |
|
module.info.it.auto | File | 149 B | 0644 |
|
module.info.ja | File | 0 B | 0644 |
|
module.info.ja.auto | File | 220 B | 0644 |
|
module.info.ko | File | 0 B | 0644 |
|
module.info.ko.auto | File | 185 B | 0644 |
|
module.info.lt | File | 0 B | 0644 |
|
module.info.lt.auto | File | 190 B | 0644 |
|
module.info.lv | File | 0 B | 0644 |
|
module.info.lv.auto | File | 162 B | 0644 |
|
module.info.ms | File | 138 B | 0644 |
|
module.info.ms.auto | File | 21 B | 0644 |
|
module.info.mt | File | 0 B | 0644 |
|
module.info.mt.auto | File | 154 B | 0644 |
|
module.info.nl | File | 34 B | 0644 |
|
module.info.nl.auto | File | 121 B | 0644 |
|
module.info.no | File | 35 B | 0644 |
|
module.info.no.auto | File | 120 B | 0644 |
|
module.info.pl | File | 0 B | 0644 |
|
module.info.pl.auto | File | 172 B | 0644 |
|
module.info.pt | File | 0 B | 0644 |
|
module.info.pt.auto | File | 158 B | 0644 |
|
module.info.pt_BR | File | 0 B | 0644 |
|
module.info.pt_BR.auto | File | 167 B | 0644 |
|
module.info.ro | File | 0 B | 0644 |
|
module.info.ro.auto | File | 162 B | 0644 |
|
module.info.ru | File | 0 B | 0644 |
|
module.info.ru.auto | File | 235 B | 0644 |
|
module.info.sk | File | 0 B | 0644 |
|
module.info.sk.auto | File | 170 B | 0644 |
|
module.info.sl | File | 0 B | 0644 |
|
module.info.sl.auto | File | 161 B | 0644 |
|
module.info.sv | File | 0 B | 0644 |
|
module.info.sv.auto | File | 170 B | 0644 |
|
module.info.th | File | 0 B | 0644 |
|
module.info.th.auto | File | 271 B | 0644 |
|
module.info.tr | File | 0 B | 0644 |
|
module.info.tr.auto | File | 177 B | 0644 |
|
module.info.uk | File | 0 B | 0644 |
|
module.info.uk.auto | File | 253 B | 0644 |
|
module.info.ur | File | 0 B | 0644 |
|
module.info.ur.auto | File | 244 B | 0644 |
|
module.info.vi | File | 0 B | 0644 |
|
module.info.vi.auto | File | 185 B | 0644 |
|
module.info.zh | File | 0 B | 0644 |
|
module.info.zh.auto | File | 142 B | 0644 |
|
module.info.zh_TW | File | 0 B | 0644 |
|
module.info.zh_TW.auto | File | 151 B | 0644 |
|
save_amavisd.cgi | File | 2.54 KB | 0755 |
|
save_db.cgi | File | 1.87 KB | 0755 |
|
save_header.cgi | File | 2.99 KB | 0755 |
|
save_manual.cgi | File | 727 B | 0755 |
|
save_priv.cgi | File | 879 B | 0755 |
|
save_procmail.cgi | File | 1.75 KB | 0755 |
|
save_report.cgi | File | 2.14 KB | 0755 |
|
save_score.cgi | File | 2.05 KB | 0755 |
|
save_simple.cgi | File | 2.75 KB | 0755 |
|
save_user.cgi | File | 1.64 KB | 0755 |
|
save_white.cgi | File | 2.1 KB | 0755 |
|
setup.cgi | File | 2.71 KB | 0755 |
|
spam-amavis-lib.pl | File | 2.72 KB | 0755 |
|
spam-lib.pl | File | 28.79 KB | 0755 |
|