summaryrefslogtreecommitdiff
path: root/listdrobpoxes.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'listdrobpoxes.cgi')
-rwxr-xr-xlistdrobpoxes.cgi35
1 files changed, 35 insertions, 0 deletions
diff --git a/listdrobpoxes.cgi b/listdrobpoxes.cgi
new file mode 100755
index 0000000..4f7050a
--- /dev/null
+++ b/listdrobpoxes.cgi
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+
+use strict;
+use File::Basename;
+use lib dirname( __FILE__ ) . '/lib';
+use rddb;
+
+my $status = 'ERROR';
+my $errorstring = 'unknown';
+my $responsecode = 500;
+
+my $username = '';
+my $token = '';
+
+
+my $dbh;
+$dbh, $status, $errorstring) = rddb::opendb();
+if(defined $dbh) {
+ ($result, $status, $errorstring) = rddb::check_token($dbh, $username, $token);
+ if($result == 1) {
+ $responsecode = 200;
+ } elsif($result == 0) {
+ $responsecode = 403;
+ } else {
+ $responsecode = 500;
+ }
+ rddb::closedb($dbh);
+}
+
+print "Content-type: application/xml\n\n";
+
+print "<RDWebResult>\n";
+print " <ResponseCode>" . $responsecode . "</ResponseCode>\n";
+print " <ErrorString>" . $errorstring . "</ErrorString>\n";
+print "</RDWebResult>\n";