summaryrefslogtreecommitdiff
path: root/rh-bin
diff options
context:
space:
mode:
Diffstat (limited to 'rh-bin')
-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";