summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README2
-rwxr-xr-xauthtoken.json12
2 files changed, 12 insertions, 2 deletions
diff --git a/README b/README
index 8dddeca..ed533cc 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
Installation
============
-# sudo aptitude install apache2 libapache2-mod-perl2 libjs-jquery rivendell-server
+# sudo aptitude install apache2 libapache2-mod-perl2 libconfig-inifiles-perl libdbd-mysql-perl libjs-jquery rivendell-server
# sudo a2enmod ssl authnz_ldap perl
# sudo /etc/init.d/apache2 restart
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";