summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-09-04 22:21:20 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-09-04 22:21:59 (GMT)
commit3b4e8ab4a63d369261c0febd95d93c3f2a4fe662 (patch)
treef7795e7f9265d61c6fca73b6f2accb0dcfc430af
parent2b1a99121c7f040705ee19e6978a16fdde4e9f3a (diff)
add fullname to authtoken.json
-rwxr-xr-xrh-bin/authtoken.json8
1 files changed, 6 insertions, 2 deletions
diff --git a/rh-bin/authtoken.json b/rh-bin/authtoken.json
index be799d1..e56daa9 100755
--- a/rh-bin/authtoken.json
+++ b/rh-bin/authtoken.json
@@ -31,13 +31,16 @@ while (my $q = CGI::Fast->new) {
my $errorstring = 'unknown';
my $username = '';
my $token = '';
+ my $fullname = '';
if(defined $ENV{REMOTE_USER}) {
my $dbh;
($dbh, $status, $errorstring) = RHRD::rddb::opendb();
if(defined $dbh) {
- ($token, $status, $errorstring) = RHRD::rddb::get_token($dbh, $ENV{REMOTE_USER});
- $token = '' unless($token);
$username = $ENV{REMOTE_USER};
+ ($token, $status, $errorstring) = RHRD::rddb::get_token($dbh, $username);
+ $token = '' unless($token);
+ ($fullname, $status, $errorstring) = RHRD::rddb::get_fullname($dbh, $username);
+ $fullname = '' unless($fullname);
RHRD::rddb::closedb($dbh);
}
} else {
@@ -48,6 +51,7 @@ while (my $q = CGI::Fast->new) {
$answer{'status'} = $status;
$answer{'errorstring'} = $errorstring;
$answer{'username'} = $username;
+ $answer{'fullname'} = $fullname;
$answer{'token'} = $token;
print "Content-type: application/json; charset=UTF-8\n\n";