Diff for /loncom/auth/loncacc.pm between versions 1.30 and 1.33

version 1.30, 2003/09/16 18:15:43 version 1.33, 2004/01/27 22:54:59
Line 43  use Apache::File; Line 43  use Apache::File;
 use CGI::Cookie();  use CGI::Cookie();
 use Fcntl qw(:flock);  use Fcntl qw(:flock);
 use Apache::lonlocal;  use Apache::lonlocal;
   use Apache::lonnet();
   
   
 sub constructaccess {  sub constructaccess {
     my ($url,$ownerdomain)=@_;      my ($url,$ownerdomain)=@_;
     my ($ownername)=($url=~/\/(?:\~|priv\/|home\/)(\w+)/);      my ($ownername)=($url=~/\/(?:\~|priv\/|home\/)(\w+)\//);
     unless (($ownername) && ($ownerdomain)) { return ''; }      unless (($ownername) && ($ownerdomain)) { return ''; }
     # We do not allow editing of previous versions of files.      # We do not allow editing of previous versions of files.
     if ($url=~/\.(\d+)\.(\w+)$/) { return ''; }      if ($url=~/\.(\d+)\.(\w+)$/) { return ''; }
     if (($ownername eq $ENV{'user.name'}) &&      my @possibledomains = &Apache::lonnet::current_machine_domains();
         ($ownerdomain eq $ENV{'user.domain'})) {      &Apache::lonnet::logthis("got domains of ".join(':',@possibledomains));
  return ($ownername,$ownerdomain);      if ($ownername eq $ENV{'user.name'}) {
    foreach my $domain (@possibledomains) {
       if ($domain eq $ENV{'user.domain'}) {
    return ($ownername,$domain);
       }
    }
     }      }
       
   
     my $capriv='user.priv.ca./'.      foreach my $domain (@possibledomains) {
                $ownerdomain.'/'.$ownername.'./';   my $capriv='user.priv.ca./'.$domain.'/'.$ownername.'./';
     foreach (keys %ENV) {   foreach (keys %ENV) {
         if ($_ eq $capriv) {      if ($_ eq $capriv) {
            return ($ownername,$ownerdomain);   return ($ownername,$domain);
         }      }
    }
     }      }
     return '';      return '';
 }  }
Line 84  sub handler { Line 93  sub handler {
   
 # --------------------------------------------------------- Initialize Language  # --------------------------------------------------------- Initialize Language
     
      &Apache::lonlocal::get_language_handle();       &Apache::lonlocal::get_language_handle($r);
   
 # -------------------------------------------------------------- Resource State  # -------------------------------------------------------------- Resource State
   

Removed from v.1.30  
changed lines
  Added in v.1.33


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