[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Fri, 21 Dec 2007 04:32:49 -0000


raeburn		Thu Dec 20 23:32:49 2007 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  &auto_run() checks validity of $cnum and $cdom arguments passed to it.
  If called from domainprefs.pm, $cnum is undef, so homeserver to check is 
  domain's primary homeserver.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.933 loncom/lonnet/perl/lonnet.pm:1.934
--- loncom/lonnet/perl/lonnet.pm:1.933	Thu Dec 20 23:22:53 2007
+++ loncom/lonnet/perl/lonnet.pm	Thu Dec 20 23:32:49 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.933 2007/12/21 04:22:53 raeburn Exp $
+# $Id: lonnet.pm,v 1.934 2007/12/21 04:32:49 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4848,8 +4848,15 @@
             $response = 1;
         }
     } else {
-        my $homeserver = &homeserver($cnum,$cdom);
-        $response = &reply('autorun:'.$cdom,$homeserver);
+        my $homeserver;
+        if (&is_course($cdom,$cnum)) {
+            $homeserver = &homeserver($cnum,$cdom);
+        } else {
+            $homeserver = &domain($cdom,'primary');
+        }
+        if ($homeserver ne 'no_host') {
+            $response = &reply('autorun:'.$cdom,$homeserver);
+        }
     }
     return $response;
 }
@@ -8868,7 +8875,7 @@
 (optionally) if $withsec is true, a fourth colon-separated item - $section.
 For each key, value is set to colon-separated start and end times for
 the role.  If no username and domain are specified, will default to
-currnt user/domain. Types, roles, and roledoms are references to arrays
+current user/domain. Types, roles, and roledoms are references to arrays
 of role statuses (active, future or previous), roles 
 (e.g., cc,in, st etc.) and domains of the roles which can be used
 to restrict the list of roles reported. If no array ref is