diff options
| author | 2015-12-18 12:13:16 +0400 | |
|---|---|---|
| committer | 2015-12-18 12:13:16 +0400 | |
| commit | 71c6714f447542ad2e765be3458e3aa3b3e456bb (patch) | |
| tree | 4e5715d1e3fe1bd52f02b04fc1af6af3534f1cdc /cgi-bin/query.pl | |
| parent | 0c1b6cc2808b4fd45779cce4835a6a80eae48265 (diff) | |
Make web scripts load DB configuration from ASM
Diffstat (limited to 'cgi-bin/query.pl')
| -rwxr-xr-x | cgi-bin/query.pl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cgi-bin/query.pl b/cgi-bin/query.pl index 4a9ed26..35c2455 100755 --- a/cgi-bin/query.pl +++ b/cgi-bin/query.pl @@ -7,7 +7,13 @@ use DBI; use CGI_Lite; -my $dbh = DBI->connect("DBI:mysql:database=asm_main;host=localhost;port=3306", 'USER', 'PASSWORD'); +use XML::Simple qw(:strict); +my $xs1 = XML::Simple->new( KeyAttr => ['id'], Cache => [ qw/memcopy/ ]); +my $sqlconf = $xs1->XMLin( "/home/icxcnika/AntiSpamMeta/config-main/mysql.xml", + ForceArray => ['ident', 'geco'], + 'GroupTags' => { ignoredidents => 'ident', ignoredgecos => 'geco' }); + +my $dbh = DBI->connect("DBI:mysql:database=" . $sqlconf->{db} . ";host=" . $sqlconf->{host} . ";port=" . $sqlconf->{port}, $sqlconf->{user}, $sqlconf->{pass}); my $debug = 0; |
