--- loncom/lonsql 2007/09/12 03:40:29 1.88 +++ loncom/lonsql 2007/09/12 20:29:13 1.89 @@ -3,7 +3,7 @@ # The LearningOnline Network # lonsql - LON TCP-MySQL-Server Daemon for handling database requests. # -# $Id: lonsql,v 1.88 2007/09/12 03:40:29 raeburn Exp $ +# $Id: lonsql,v 1.89 2007/09/12 20:29:13 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -456,6 +456,8 @@ sub make_new_child { $srchtype,$srchterm); } elsif ($query eq 'instdirsearch') { $result = &do_inst_dir_search($searchdomain,$arg1,$arg2,$arg3); + } elsif ($query eq 'getinstuser') { + $result = &get_inst_user($searchdomain,$arg1,$arg2); } elsif ($query eq 'prepare activity log') { my ($cid,$domain) = map {&unescape($_);} ($arg1,$arg2); &logthis('preparing activity log tables for '.$cid); @@ -588,6 +590,30 @@ sub do_inst_dir_search { } } $response=~s/\&$//; + } else { + $response = 'unavailable'; + } + return $response; +} + +sub get_inst_user { + my ($domain,$uname,$id) = @_; + $uname = &unescape($uname); + $id = &unescape($id); + my (%instusers,%instids,$result,$response); + eval { + local($SIG{__DIE__})='DEFAULT'; + $result=&localenroll::get_userinfo($domain,$uname,$id,\%instusers, + \%instids); + }; + if ($result eq 'ok') { + if (keys(%instusers) > 0) { + foreach my $key (keys(%instusers)) { + my $usrstr = &Apache::lonnet::freeze_escape($instusers{$key}); + $response .= &escape(&escape($key).'='.$usrstr).'&'; + } + } + $response=~s/\&$//; } else { $response = 'unavailable'; } 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.