diff options
author | Christian Pointner <equinox@helsinki.at> | 2014-09-17 19:52:25 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2014-09-17 19:52:25 (GMT) |
commit | 00fd07f65c4d9d53562bd4510cbf19fc73e1ee50 (patch) | |
tree | 6bb21c9d997d50973f655340f6fc02f1d7f01269 | |
parent | d07fab87302b6cd976a7cf8c8e609c371696717c (diff) |
reading db-config from rd.conf
-rw-r--r-- | README | 2 | ||||
-rwxr-xr-x | authtoken.json | 12 |
2 files changed, 12 insertions, 2 deletions
@@ -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"; |