--- loncom/lonnet/perl/lonnet.pm 2009/08/16 21:49:32 1.1018 +++ loncom/lonnet/perl/lonnet.pm 2009/08/23 03:57:20 1.1022 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1018 2009/08/16 21:49:32 raeburn Exp $ +# $Id: lonnet.pm,v 1.1022 2009/08/23 03:57:20 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5774,6 +5774,13 @@ sub auto_instcode_format { push(@homeservers,$tryserver); } } + } elsif ($caller eq 'requests') { + if ($codedom =~ /^$match_domain$/) { + my $chome = &domain($codedom,'primary'); + unless ($chome eq 'no_host') { + push(@homeservers,$chome); + } + } } else { push(@homeservers,&homeserver($caller,$codedom)); } @@ -5874,13 +5881,37 @@ sub auto_possible_instcodes { sub auto_courserequest_checks { my ($dom) = @_; - my %validations; + my ($homeserver,%validations); + if ($dom =~ /^$match_domain$/) { + $homeserver = &domain($dom,'primary'); + } + unless ($homeserver eq 'no_host') { + my $response=&reply('autocrsreqchecks:'.$dom,$homeserver); + unless ($response =~ /(con_lost|error|no_such_host|refused)/) { + my @items = split(/&/,$response); + foreach my $item (@items) { + my ($key,$value) = split('=',$item); + $validations{&unescape($key)} = &thaw_unescape($value); + } + } + } return %validations; } sub auto_courserequest_validation { - my ($dom,$details,$inststatuses,$message) = @_; - return 'pending'; + my ($dom,$owner,$crstype,$inststatuslist,$instcode,$instseclist) = @_; + my ($homeserver,$response); + if ($dom =~ /^$match_domain$/) { + $homeserver = &domain($dom,'primary'); + } + unless ($homeserver eq 'no_host') { + + $response=&unescape(&reply('autocrsreqvalidation:'.$dom.':'.&escape($owner). + ':'.&escape($crstype).':'.&escape($inststatuslist). + ':'.&escape($instcode).':'.&escape($instseclist), + $homeserver)); + } + return $response; } sub auto_validate_class_sec {