diff options
author | Janik Kleinhoff <ilbelkyr@shalture.org> | 2016-03-13 21:40:02 +0000 |
---|---|---|
committer | Janik Kleinhoff <ilbelkyr@shalture.org> | 2016-03-13 21:40:45 +0000 |
commit | 8994c5df135bc2fe266fe24d7d297608e397893c (patch) | |
tree | a2bb8e3c6782ed89f66b0a6a4baaea4aab87e702 | |
parent | 8f49cfc49cd71de07d48f10d5c3584e7834d9c17 (diff) | |
download | antispammeta-web.tar.bz2 antispammeta-web.tar.xz antispammeta-web.tar.zst |
JSONifyweb
-rwxr-xr-x | cgi-bin/query.pl | 9 | ||||
-rwxr-xr-x | cgi-bin/secret/investigate.pl | 9 | ||||
-rwxr-xr-x | cgi-bin/showUsers.pl | 7 |
3 files changed, 11 insertions, 14 deletions
diff --git a/cgi-bin/query.pl b/cgi-bin/query.pl index eef0b09..d9e4573 100755 --- a/cgi-bin/query.pl +++ b/cgi-bin/query.pl @@ -7,11 +7,10 @@ use DBI; use CGI; -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' }); +use JSON qw(decode_json); +use IO::All; + +my $sqlconf = decode_json(io->file("/home/icxcnika/AntiSpamMeta/config-main/mysql.json")->all); my $dbh = DBI->connect("DBI:mysql:database=" . $sqlconf->{db} . ";host=" . $sqlconf->{host} . ";port=" . $sqlconf->{port}, $sqlconf->{user}, $sqlconf->{pass}); diff --git a/cgi-bin/secret/investigate.pl b/cgi-bin/secret/investigate.pl index 6b48027..60120ab 100755 --- a/cgi-bin/secret/investigate.pl +++ b/cgi-bin/secret/investigate.pl @@ -6,11 +6,10 @@ use strict; use DBI; use CGI; -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' }); +use JSON qw(decode_json); +use IO::All; + +my $sqlconf = decode_json(io->file("/home/icxcnika/AntiSpamMeta/config-main/mysql.json")->all); my $dbh = DBI->connect("DBI:mysql:database=" . $sqlconf->{db} . ";host=" . $sqlconf->{host} . ";port=" . $sqlconf->{port}, $sqlconf->{user}, $sqlconf->{pass}); $dbh->do("SET time_zone = '+0:00';"); diff --git a/cgi-bin/showUsers.pl b/cgi-bin/showUsers.pl index 3fb668e..7146192 100755 --- a/cgi-bin/showUsers.pl +++ b/cgi-bin/showUsers.pl @@ -4,8 +4,8 @@ use Data::Dumper; use strict; use DBI; -use XML::Simple qw(:strict); - +use JSON qw(decode_json); +use IO::All; print "Content-type: text/html", "\n\n"; print <<HTML; @@ -33,8 +33,7 @@ print <<HTML; </tr> HTML -my $xs1 = XML::Simple->new( KeyAttr => ['id'], Cache => [ qw/memcopy/ ]); -my $users = $xs1->XMLin( "/home/icxcnika/AntiSpamMeta/config-main/users.xml", ForceArray => 'person'); +my $users = decode_json(io->file("/home/icxcnika/AntiSpamMeta/config-main/users.json")->all); sub printout { |