summaryrefslogtreecommitdiff
path: root/authtoken.json
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2014-09-18 14:49:46 (GMT)
committerChristian Pointner <equinox@helsinki.at>2014-09-18 14:49:46 (GMT)
commita6fb1a8e95126a33fd742ff014bc813e9fa20be4 (patch)
tree07dca6b3ac4123a2b2cc6a931813ff95ff45cae3 /authtoken.json
parentd2df76a89f29acd03383da6a76839435c51e8621 (diff)
added check_token routine
Diffstat (limited to 'authtoken.json')
-rwxr-xr-xauthtoken.json9
1 files changed, 7 insertions, 2 deletions
diff --git a/authtoken.json b/authtoken.json
index dbdc64a..c080028 100755
--- a/authtoken.json
+++ b/authtoken.json
@@ -10,8 +10,13 @@ my $errorstring = 'unknown';
my $username = '';
my $token = '';
if(defined $ENV{REMOTE_USER}) {
- ($token, $status, $errorstring) = rddb::get_token($ENV{REMOTE_USER});
- $username = $ENV{REMOTE_USER};
+ my $dbh;
+ ($dbh, $status, $errorstring) = rddb::opendb();
+ if(defined $dbh) {
+ ($token, $status, $errorstring) = rddb::get_token($dbh, $ENV{REMOTE_USER});
+ $username = $ENV{REMOTE_USER};
+ rddb::closedb($dbh);
+ }
} else {
$errorstring = 'no username defined - are you logged in?';
}