diff options
author | Christian Pointner <equinox@helsinki.at> | 2014-09-18 18:35:48 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2014-09-18 18:35:48 (GMT) |
commit | 8d02a9dca021a9b772dd96b513be0533c575703f (patch) | |
tree | dd184b385fb3a0e2a7578bc02f27e3d75478f42d /listdrobpoxes.cgi | |
parent | 2a871af1e12a222a95b0f6c534e5ef6a00de1009 (diff) |
added listdropboxes command (preliminary)
Diffstat (limited to 'listdrobpoxes.cgi')
-rwxr-xr-x | listdrobpoxes.cgi | 35 |
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"; |