Diff for /loncom/lond between versions 1.178.2.20 and 1.178.2.21

version 1.178.2.20, 2004/04/27 11:30:28 version 1.178.2.21, 2004/04/29 10:35:07
Line 1028  sub UpdateResourceHandler { Line 1028  sub UpdateResourceHandler {
         
     my $userinput = "$cmd:$tail";      my $userinput = "$cmd:$tail";
         
     my $fname=split(/:/$tail); # This allows interactive testing      my $fname=split(/:/,$tail); # This allows interactive testing
     chomp($fname); # with telnet.      chomp($fname); # with telnet.
   
     my $ownership=ishome($fname);      my $ownership=ishome($fname);
Line 4388  sub chatadd { Line 4388  sub chatadd {
 sub unsub {  sub unsub {
     my ($fname,$clientip)=@_;      my ($fname,$clientip)=@_;
     my $result;      my $result;
 #    if (unlink("$fname.$clientname")) {      my $unsubs = 0; # Number of successful unsubscribes:
 # $result="ok\n";  
 #    } else {  
 # $result="not_subscribed\n";      # An old way subscriptions were handled was to have a 
 #    }      # subscription marker file:
     unlink("$fname.$clientname");  
       Debug("Attempting unlink of $fname.$clientname");
       if (unlink("$fname.$clientname")) {
    $unsubs++; # Successful unsub via marker file.
       } 
   
       # The more modern way to do it is to have a subscription list
       # file:
   
     if (-e "$fname.subscription") {      if (-e "$fname.subscription") {
  Debug ("Processing subscription file $fname.subscription");  
  my $found=&addline($fname,$clientname,$clientip,'');   my $found=&addline($fname,$clientname,$clientip,'');
  if ($found) {    if ($found) { 
     Debug("Old linek found");      $unsubs++;
     $result="ok\n";   
  } else {  
     $result = "not_subscribed\n";  
  }   }
       } 
   
       #  If either or both of these mechanisms succeeded in unsubscribing a 
       #  resource we can return ok:
   
       if($unsubs) {
    $result = "ok\n";
     } else {      } else {
  Debug("No Subscription file $fname.subscription");   $result = "not_subscribed\n";
  if ($result ne "ok\n") { $result="not_subscribed\n"; }  
     }      }
   
     return $result;      return $result;
 }  }
   

Removed from v.1.178.2.20  
changed lines
  Added in v.1.178.2.21


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>