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

raeburn raeburn at source.lon-capa.org
Wed May 29 15:36:56 EDT 2013


raeburn		Wed May 29 19:36:56 2013 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - For 2.11
    - Backport 1.1225, 1.1226, 1.1227.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1172.2.26 loncom/lonnet/perl/lonnet.pm:1.1172.2.27
--- loncom/lonnet/perl/lonnet.pm:1.1172.2.26	Mon May 27 16:00:15 2013
+++ loncom/lonnet/perl/lonnet.pm	Wed May 29 19:36:56 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1172.2.26 2013/05/27 16:00:15 raeburn Exp $
+# $Id: lonnet.pm,v 1.1172.2.27 2013/05/29 19:36:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5489,7 +5489,7 @@
     if (grep { $_ eq $uhome } &current_machine_ids()) {
         # user is hosted on this machine
         $reply = LONCAPA::Lond::dump_with_regexp(join(':', ($udomain,
-                    $uname, $namespace, $regexp, $range)), $loncaparevs{$uhome});
+                    $uname, $namespace, $regexp, $range)), $perlvar{'lonVersion'});
         return %{&unserialize($reply, $escapedkeys)};
     }
     if ($regexp) {
@@ -12016,6 +12016,39 @@
     return qw(1.1 1.2 1.3 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10);
 }
 
+# ------------------------------------------------------- Read loncaparev table
+{
+    sub load_loncaparevs {
+        if (-e "$perlvar{'lonTabDir'}/loncaparevs.tab") {
+            if (open(my $config,"<$perlvar{'lonTabDir'}/loncaparevs.tab")) {
+                while (my $configline=<$config>) {
+                    chomp($configline);
+                    my ($hostid,$loncaparev)=split(/:/,$configline);
+                    $loncaparevs{$hostid}=$loncaparev;
+                }
+                close($config);
+            }
+        }
+    }
+}
+
+# ----------------------------------------------------- Read serverhostID table
+{
+    sub load_serverhomeIDs {
+        if (-e "$perlvar{'lonTabDir'}/serverhomeIDs.tab") {
+            if (open(my $config,"<$perlvar{'lonTabDir'}/serverhomeIDs.tab")) {
+                while (my $configline=<$config>) {
+                    chomp($configline);
+                    my ($name,$id)=split(/:/,$configline);
+                    $serverhomeIDs{$name}=$id;
+                }
+                close($config);
+            }
+        }
+    }
+}
+
+
 BEGIN {
 
 # ----------------------------------- Read loncapa.conf and loncapa_apache.conf
@@ -12091,34 +12124,15 @@
     close($config);
 }
 
-# ---------------------------------------------------------- Read loncaparev table
-{
-    if (-e "$perlvar{'lonTabDir'}/loncaparevs.tab") {
-        if (open(my $config,"<$perlvar{'lonTabDir'}/loncaparevs.tab")) {
-            while (my $configline=<$config>) {
-                chomp($configline);
-                my ($hostid,$loncaparev)=split(/:/,$configline);
-                $loncaparevs{$hostid}=$loncaparev;
-            }
-            close($config);
-        }
-    }
-}
+# --------------------------------------------------------- Read loncaparev table
 
-# ---------------------------------------------------------- Read serverhostID table
-{
-    if (-e "$perlvar{'lonTabDir'}/serverhomeIDs.tab") {
-        if (open(my $config,"<$perlvar{'lonTabDir'}/serverhomeIDs.tab")) {
-            while (my $configline=<$config>) {
-                chomp($configline);
-                my ($name,$id)=split(/:/,$configline);
-                $serverhomeIDs{$name}=$id;
-            }
-            close($config);
-        }
-    }
-}
+&load_loncaparevs();
+
+# ------------------------------------------------------- Read serverhostID table
+
+&load_serverhomeIDs();
 
+# ---------------------------------------------------------- Read releaseslist XML
 {
     my $file = $Apache::lonnet::perlvar{'lonTabDir'}.'/releaseslist.xml';
     if (-e $file) {
@@ -12328,8 +12342,8 @@
 
 Calling convention:
 
- my %record=&Apache::lonnet::restore($symb,$courseid,$domain,$uname,$home);
- &Apache::lonnet::cstore(\%newrecord,$symb,$courseid,$domain,$uname,$home);
+ my %record=&Apache::lonnet::restore($symb,$courseid,$domain,$uname);
+ &Apache::lonnet::cstore(\%newrecord,$symb,$courseid,$domain,$uname);
 
 For more detailed information, see lonnet specific documentation.
 




More information about the LON-CAPA-cvs mailing list