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

raeburn raeburn at source.lon-capa.org
Fri Jan 3 15:01:41 EST 2014


raeburn		Fri Jan  3 20:01:41 2014 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - For 2.11
    - Backport 1.1247, 1.1248.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1172.2.37 loncom/lonnet/perl/lonnet.pm:1.1172.2.38
--- loncom/lonnet/perl/lonnet.pm:1.1172.2.37	Fri Dec 27 23:31:21 2013
+++ loncom/lonnet/perl/lonnet.pm	Fri Jan  3 20:01:40 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1172.2.37 2013/12/27 23:31:21 raeburn Exp $
+# $Id: lonnet.pm,v 1.1172.2.38 2014/01/03 20:01:40 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4170,7 +4170,8 @@
     my ($domfilter,$descfilter,$sincefilter,$instcodefilter,$ownerfilter,
         $coursefilter,$hostidflag,$hostidref,$typefilter,$regexp_ok,
         $selfenrollonly,$catfilter,$showhidden,$caller,$cloner,$cc_clone,
-        $cloneonly,$createdbefore,$createdafter,$creationcontext,$domcloner)=@_;
+        $cloneonly,$createdbefore,$createdafter,$creationcontext,$domcloner,
+        $hasuniquecode)=@_;
     my $as_hash = 1;
     my %returnhash;
     if (!$domfilter) { $domfilter=''; }
@@ -4193,7 +4194,7 @@
                                 &escape($catfilter), $showhidden, $caller,
                                 &escape($cloner), &escape($cc_clone), $cloneonly,
                                 &escape($createdbefore), &escape($createdafter),
-                                &escape($creationcontext), $domcloner)));
+                                &escape($creationcontext), $domcloner, $hasuniquecode)));
                 } else {
                     $rep = &reply('courseiddump:'.&host_domain($tryserver).':'.
                              $sincefilter.':'.&escape($descfilter).':'.
@@ -4204,7 +4205,7 @@
                              $showhidden.':'.$caller.':'.&escape($cloner).':'.
                              &escape($cc_clone).':'.$cloneonly.':'.
                              &escape($createdbefore).':'.&escape($createdafter).':'.
-                             &escape($creationcontext).':'.$domcloner,
+                             &escape($creationcontext).':'.$domcloner.':'.$hasuniquecode,
                              $tryserver);
                 }
 
@@ -7917,6 +7918,33 @@
     return $response;
 }
 
+sub auto_crsreq_update {
+    my ($cdom,$cnum,$crstype,$action,$ownername,$ownerdomain,$fullname,$title,
+        $code,$inbound) = @_;
+    my ($homeserver,%crsreqresponse);
+    if ($cdom =~ /^$match_domain$/) {
+        $homeserver = &domain($cdom,'primary');
+    }
+    unless (($homeserver eq 'no_host') || ($homeserver eq '')) {
+        my $info;
+        if (ref($inbound) eq 'HASH') {
+            $info = &freeze_escape($inbound);
+        }
+        my $response=&reply('autocrsrequpdate:'.$cdom.':'.$cnum.':'.&escape($crstype).
+                            ':'.&escape($action).':'.&escape($ownername).':'.
+                            &escape($ownerdomain).':'.&escape($fullname).':'.
+                            &escape($title).':'.&escape($code).':'.$info,$homeserver);
+        unless ($response =~ /(con_lost|error|no_such_host|refused)/) {
+            my @items = split(/&/,$response);
+            foreach my $item (@items) {
+                my ($key,$value) = split('=',$item);
+                $crsreqresponse{&unescape($key)} = &thaw_unescape($value);
+            }
+        }
+    }
+    return \%crsreqresponse;
+}
+
 # ------------------------------------------------------- Course Group routines
 
 sub get_coursegroups {




More information about the LON-CAPA-cvs mailing list