version 1.6, 2001/04/17 21:07:38
|
version 1.7, 2001/05/01 17:30:18
|
Line 26 sub moreinfo {
|
Line 26 sub moreinfo {
|
} |
} |
|
|
|
|
#FIXME - needs to be much smarter |
#FIXME - needs to handle multiple matches |
sub finduser { |
sub finduser { |
my ($name) = @_; |
my ($name) = @_; |
|
my $domain = ''; |
|
|
if ( $Apache::grades::viewgrades eq 'F' ) { |
if ( $Apache::grades::viewgrades eq 'F' ) { |
return ($name,$ENV{'user.domain'}); |
#get classlist |
|
my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'}); |
|
my $chome=$ENV{"course.$ENV{'request.course.id'}.home"}; |
|
#print "Found $cdom:$cnum:$chome<br />"; |
|
my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0'); |
|
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
|
my ($posname,$posdomain) = split(/:/,$student); |
|
if ($posname =~ $name) { $name=$posname; $domain=$posdomain; last; } |
|
} |
|
return ($name,$domain); |
} else { |
} else { |
return ($ENV{'user.name'},$ENV{'user.domain'}); |
return ($ENV{'user.name'},$ENV{'user.domain'}); |
} |
} |