Diff for /loncom/lond between versions 1.161 and 1.163

version 1.161, 2003/11/11 12:39:14 version 1.163, 2003/11/17 09:32:17
Line 205  sub ReadManagerTable { Line 205  sub ReadManagerTable {
 sub ValidManager {  sub ValidManager {
     my $certificate = shift;       my $certificate = shift; 
   
     ReadManagerTable;      return isManager;
   
     my $hostname   = $hostid{$certificate};  
   
   
     if ($hostname ne undef) {  
  if($managers{$hostname} ne undef) {  
     &logthis('<font color="yellow">Authenticating manager'.  
      " $hostname</font>");  
     return 1;  
  } else {  
     &logthis('<font color="red" failed manager authentication '.  
      $hostname." is not a valid manager host</font>");  
     return 0;  
  }  
     } else {  
  &logthis('<font color="red"> Failed manager authentication '.  
  "$certificate </font>");  
  return 0;  
     }  
 }  }
 #  #
 #  CopyFile:  Called as part of the process of installing a   #  CopyFile:  Called as part of the process of installing a 
Line 1690  sub make_new_child { Line 1671  sub make_new_child {
  }   }
  if (untie(%hash)) {   if (untie(%hash)) {
     print $client "ok\n";      print $client "ok\n";
    } else {
       print $client "error: ".($!+0)
    ." untie(GDBM) failed ".
    "while attempting put\n";
    }
       } else {
    print $client "error: ".($!)
       ." tie(GDBM) Failed ".
       "while attempting put\n";
       }
    } else {
       print $client "refused\n";
    }
       } else {
    Reply($client, "refused\n", $userinput);
   
       }
   # ------------------------------------------------------------------- inc
    } elsif ($userinput =~ /^inc:/) {
       if(isClient) {
    my ($cmd,$udom,$uname,$namespace,$what)
       =split(/:/,$userinput);
    $namespace=~s/\//\_/g;
    $namespace=~s/\W//g;
    if ($namespace ne 'roles') {
       chomp($what);
       my $proname=propath($udom,$uname);
       my $now=time;
       unless ($namespace=~/^nohist\_/) {
    my $hfh;
    if (
       $hfh=IO::File->new(">>$proname/$namespace.hist")
       ) { print $hfh "P:$now:$what\n"; }
       }
       my @pairs=split(/\&/,$what);
       my %hash;
       if (tie(%hash,'GDBM_File',
       "$proname/$namespace.db",
       &GDBM_WRCREAT(),0640)) {
    foreach my $pair (@pairs) {
       my ($key,$value)=split(/=/,$pair);
                                       # We could check that we have a number...
                                       if (! defined($value) || $value eq '') {
                                           $value = 1;
                                       }
       $hash{$key}+=$value;
    }
    if (untie(%hash)) {
       print $client "ok\n";
  } else {   } else {
     print $client "error: ".($!+0)      print $client "error: ".($!+0)
  ." untie(GDBM) failed ".   ." untie(GDBM) failed ".

Removed from v.1.161  
changed lines
  Added in v.1.163


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