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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 09 Dec 2005 23:20:29 -0000


albertel		Fri Dec  9 18:20:29 2005 EDT

  Modified files:              (Branch: version_2_1_X)
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - backport 1.685
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.683.2.1 loncom/lonnet/perl/lonnet.pm:1.683.2.2
--- loncom/lonnet/perl/lonnet.pm:1.683.2.1	Mon Dec  5 23:00:56 2005
+++ loncom/lonnet/perl/lonnet.pm	Fri Dec  9 18:20:26 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.683.2.1 2005/12/06 04:00:56 albertel Exp $
+# $Id: lonnet.pm,v 1.683.2.2 2005/12/09 23:20:26 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -40,8 +40,8 @@
    %courselogs %accesshash %userrolehash %domainrolehash $processmarker $dumpcount 
    %coursedombuf %coursenumbuf %coursehombuf %coursedescrbuf %courseinstcodebuf %courseownerbuf
    %domaindescription %domain_auth_def %domain_auth_arg_def 
-   %domain_lang_def %domain_city %domain_longi %domain_lati $tmpdir $_64bit
-   %env);
+   %domain_lang_def %domain_city %domain_longi %domain_lati %domain_primary
+   $tmpdir $_64bit %env);
 
 use IO::Socket;
 use GDBM_File;
@@ -1853,28 +1853,25 @@
 # ---------------------------------------------------------- DC e-mail
 
 sub dcmailput {
-    my ($domain,$msgid,$contents,$server)=@_;
+    my ($domain,$msgid,$message,$server)=@_;
     my $status = &Apache::lonnet::critical(
        'dcmailput:'.$domain.':'.&Apache::lonnet::escape($msgid).'='.
-       &Apache::lonnet::escape($$contents{$server}),$server);
+       &Apache::lonnet::escape($message),$server);
     return $status;
 }
 
 sub dcmaildump {
     my ($dom,$startdate,$enddate,$senders) = @_;
-    my %returnhash=(); 
-    foreach my $tryserver (keys(%libserv)) {
-        if ($hostdom{$tryserver} eq $dom) {
-            %{$returnhash{$tryserver}}=();
-	    my $cmd='dcmaildump:'.$dom.':'.
-		&escape($startdate).':'.&escape($enddate).':';
-	    my @esc_senders=map { &escape($_)} @$senders;
-	    $cmd.=&escape(join('&',@esc_senders));
-	    foreach (split(/\&/,&reply($cmd,$tryserver))) {
-                my ($key,$value) = split(/\=/,$_);
-                if (($key) && ($value)) {
-                    $returnhash{$tryserver}{&unescape($key)} = &unescape($value);
-                }
+    my %returnhash=();
+    if (exists($domain_primary{$dom})) {
+        my $cmd='dcmaildump:'.$dom.':'.&escape($startdate).':'.
+                                                         &escape($enddate).':';
+	my @esc_senders=map { &escape($_)} @$senders;
+	$cmd.=&escape(join('&',@esc_senders));
+	foreach (split(/\&/,&reply($cmd,$domain_primary{$dom}))) {
+            my ($key,$value) = split(/\=/,$_);
+            if (($key) && ($value)) {
+                $returnhash{&unescape($key)} = &unescape($value);
             }
         }
     }
@@ -6185,7 +6182,7 @@
 #           next if /^\#/;
            chomp;
            my ($domain, $domain_description, $def_auth, $def_auth_arg,
-	       $def_lang, $city, $longi, $lati) = split(/:/,$_);
+	       $def_lang, $city, $longi, $lati, $primary) = split(/:/,$_);
 	   $domain_auth_def{$domain}=$def_auth;
            $domain_auth_arg_def{$domain}=$def_auth_arg;
 	   $domaindescription{$domain}=$domain_description;
@@ -6193,6 +6190,7 @@
 	   $domain_city{$domain}=$city;
 	   $domain_longi{$domain}=$longi;
 	   $domain_lati{$domain}=$lati;
+           $domain_primary{$domain}=$primary;
 
  #         &logthis("Domain.tab: $domain, $domain_auth_def{$domain}, $domain_auth_arg_def{$domain},$domaindescription{$domain}");
 #          &logthis("Domain.tab: $domain ".$domaindescription{$domain} );