summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2014-09-17 19:32:12 (GMT)
committerChristian Pointner <equinox@helsinki.at>2014-09-17 19:32:12 (GMT)
commitd07fab87302b6cd976a7cf8c8e609c371696717c (patch)
treedfd40b73082b4ff696d6e67bb8b50562ba760db1
parent94b31e0b3b5b31f9156212eecfe8cc5984fddc13 (diff)
perl script is now a little smarter
-rwxr-xr-xauthtoken.json19
1 files changed, 17 insertions, 2 deletions
diff --git a/authtoken.json b/authtoken.json
index 4252d93..971b12e 100755
--- a/authtoken.json
+++ b/authtoken.json
@@ -5,7 +5,22 @@ use warnings;
print "Content-type: application/json\n\n";
+my $status = 'ERROR';
+my $errorstring = 'unknown';
+my $username = '';
+my $token = '';
+if(defined $ENV{REMOTE_USER}) {
+ $status = 'OK';
+ $errorstring = 'success';
+ $username = $ENV{REMOTE_USER};
+ $token = "this is cool!";
+} else {
+ $errorstring = 'no username defined';
+}
+
print "{\n";
-print " 'username': 'test',\n";
-print " 'token': 'SDLIIBqCypa3bIRQEv9GMAPF4GHqelBD'\n";
+print " 'status': '" . $status . "',\n";
+print " 'errorstring': '" . $errorstring . "',\n";
+print " 'username': '" . $username . "',\n";
+print " 'token': '" . $token . "'\n";
print "}\n";