[LON-CAPA-cvs] cvs: modules /gerd/loncapa_lernmodule/loncapa studip.pm
www
www at source.lon-capa.org
Thu Aug 30 07:57:03 EDT 2012
www Thu Aug 30 11:57:03 2012 EDT
Modified files:
/modules/gerd/loncapa_lernmodule/loncapa studip.pm
Log:
Getting first and last name from StudIP
Index: modules/gerd/loncapa_lernmodule/loncapa/studip.pm
diff -u modules/gerd/loncapa_lernmodule/loncapa/studip.pm:1.3 modules/gerd/loncapa_lernmodule/loncapa/studip.pm:1.4
--- modules/gerd/loncapa_lernmodule/loncapa/studip.pm:1.3 Thu Aug 30 09:54:26 2012
+++ modules/gerd/loncapa_lernmodule/loncapa/studip.pm Thu Aug 30 11:57:03 2012
@@ -7,7 +7,7 @@
#
# Landing point for incoming StudIP requests
#
-# $Id: studip.pm,v 1.3 2012/08/30 09:54:26 www Exp $
+# $Id: studip.pm,v 1.4 2012/08/30 11:57:03 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -173,15 +173,15 @@
return OK;
}
- my $user = $returned->value;
+ my $rawuser = $returned->value;
- if(!$user){
- &Apache::lonauth::failed($r, 'Couldn\'t verifiy token.', undef);
+ if(!$rawuser){
+ &Apache::lonauth::failed($r, 'Couldn\'t verify token.', undef);
return OK;
#return &error_msg($r, HTTP_UNAUTHORIZED);
}
- $user = &LONCAPA::clean_username($user);
+ my $user = &LONCAPA::clean_username($rawuser);
my %form = (
'uname' => $user,
@@ -344,6 +344,14 @@
}
+# Gets user information from StudIP
+sub get_userinfo {
+ my ($username)=@_;
+ my ($error,$response)=&make_studip_call('find_user_by_user_name',$username);
+ if ($error) { return(); }
+ return ($response->value->{'first_name'},
+ $response->value->{'last_name'});
+}
# XML-RPC request to studip
sub make_studip_call{
More information about the LON-CAPA-cvs
mailing list