summaryrefslogtreecommitdiff
path: root/authtoken.json
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2014-09-17 19:52:25 (GMT)
committerChristian Pointner <equinox@helsinki.at>2014-09-17 19:52:25 (GMT)
commit00fd07f65c4d9d53562bd4510cbf19fc73e1ee50 (patch)
tree6bb21c9d997d50973f655340f6fc02f1d7f01269 /authtoken.json
parentd07fab87302b6cd976a7cf8c8e609c371696717c (diff)
reading db-config from rd.conf
Diffstat (limited to 'authtoken.json')
-rwxr-xr-xauthtoken.json12
1 files changed, 11 insertions, 1 deletions
diff --git a/authtoken.json b/authtoken.json
index 971b12e..2f00e57 100755
--- a/authtoken.json
+++ b/authtoken.json
@@ -2,8 +2,16 @@
use strict;
use warnings;
+use Config::IniFiles;
+
+
+my $RD_CONF = "/etc/rd.conf";
+my $cfg = Config::IniFiles->new(-file => $RD_CONF);
+my $dbhost = $cfg->val('mySQL', 'Hostname');
+my $dbname = $cfg->val('mySQL', 'Database');
+my $dbuser = $cfg->val('mySQL', 'Loginname');
+my $dbpasswd = $cfg->val('mySQL', 'Password');
-print "Content-type: application/json\n\n";
my $status = 'ERROR';
my $errorstring = 'unknown';
@@ -18,6 +26,8 @@ if(defined $ENV{REMOTE_USER}) {
$errorstring = 'no username defined';
}
+print "Content-type: application/json\n\n";
+
print "{\n";
print " 'status': '" . $status . "',\n";
print " 'errorstring': '" . $errorstring . "',\n";