--- loncom/lonnet/perl/lonnet.pm 2008/02/24 22:59:17 1.943 +++ loncom/lonnet/perl/lonnet.pm 2008/03/09 16:57:26 1.946 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.943 2008/02/24 22:59:17 raeburn Exp $ +# $Id: lonnet.pm,v 1.946 2008/03/09 16:57:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1064,8 +1064,8 @@ sub inst_rulecheck { $response=&unescape(&reply('instidrulecheck:'.&escape($udom). ':'.&escape($id).':'.$rulestr, $homeserver)); - } elsif ($item eq 'selfenroll') { - $response=&unescape(&reply('instselfenrollcheck:'. + } elsif ($item eq 'selfcreate') { + $response=&unescape(&reply('instselfcreatecheck:'. &escape($udom).':'.&escape($uname). ':'.$rulestr,$homeserver)); } @@ -1692,15 +1692,17 @@ sub absolute_url { # fn Possibly encrypted resource name/id. # form Hash that describes how the rendering should be done # and other things. -# r Optional reference that will be given the response. -# This is mostly provided so that the caller can implement -# error detection, recovery and retry policies. +# Returns: +# Scalar context: The content of the reply. +# Array context: 2 element list of the content and the full response variable. # # Returns: # The content of the response. sub ssi { - my ($fn,%form, $r)=@_; + my ($fn,%form)=@_; + my $count = scalar(@_); + my $ua=new LWP::UserAgent; @@ -1717,12 +1719,13 @@ sub ssi { $request->header(Cookie => $ENV{'HTTP_COOKIE'}); my $response=$ua->request($request); + my $status = $response->code; - if ($r) { - $$r = $response; + if (wantarray) { + return ($response->content, $response); + } else { + return $response->content; } - - return $response->content; } sub externalssi { @@ -5718,7 +5721,7 @@ ENDINITMAP sub is_course { my ($cdom,$cnum) = @_; my %courses = &courseiddump($cdom,'.',1,'.','.',$cnum,undef, - undef,'.',undef,1); + undef,'.'); if (exists($courses{$cdom.'_'.$cnum})) { return 1; }