From 364cc862cb1de447b85396fed616477c4f85f755 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 17 Sep 2014 21:04:40 +0000 Subject: fixed json syntax error diff --git a/authtoken.json b/authtoken.json index 6d55799..a8cd31a 100755 --- a/authtoken.json +++ b/authtoken.json @@ -30,7 +30,7 @@ sub get_token my ($token) = $sth->fetchrow_array; return ('OK', 'success', $token) if(defined $token); - return ('ERROR', 'user "' . $username . '" not known', '') + return ('ERROR', "user '" . $username . "' not known", '') } my $status = 'ERROR'; @@ -47,8 +47,8 @@ if(defined $ENV{REMOTE_USER}) { print "Content-type: application/json\n\n"; print "{\n"; -print " 'status': '" . $status . "',\n"; -print " 'errorstring': '" . $errorstring . "',\n"; -print " 'username': '" . $username . "',\n"; -print " 'token': '" . $token . "'\n"; +print ' "status": "' . $status . '"'. ",\n"; +print ' "errorstring": "' . $errorstring . '"'. ",\n"; +print ' "username": "' . $username . '"' . ",\n"; +print ' "token": "' . $token . '"' . "\n"; print "}\n"; diff --git a/index.html b/index.html index a07f16d..e7c7cd9 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,11 @@