version 1.31, 2003/09/20 17:44:22
|
version 1.31.2.1, 2004/01/27 23:06:22
|
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)=@_; |
Line 50 sub constructaccess {
|
Line 52 sub constructaccess {
|
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 ''; |
} |
} |