version 1.23, 2002/09/30 20:35:38
|
version 1.26, 2003/04/03 21:32:23
|
Line 31
|
Line 31
|
# YEAR=2001 |
# YEAR=2001 |
# 01/06,01/11,6/1,9/25,9/28,11/22,12/25,12/26, |
# 01/06,01/11,6/1,9/25,9/28,11/22,12/25,12/26, |
# 01/06/01,05/04,05/05,05/09 Gerd Kortemeyer |
# 01/06/01,05/04,05/05,05/09 Gerd Kortemeyer |
# 12/21 Scott Harrison |
|
# YEAR=2002 |
# YEAR=2002 |
# 1/4 Gerd Kortemeyer |
# 1/4 Gerd Kortemeyer |
### |
### |
Line 39
|
Line 38
|
package Apache::loncacc; |
package Apache::loncacc; |
|
|
use strict; |
use strict; |
use Apache::Constants qw(:common :http :methods); |
use Apache::Constants qw(:common :http :methods REDIRECT); |
use Apache::File; |
use Apache::File; |
use CGI::Cookie(); |
use CGI::Cookie(); |
use Fcntl qw(:flock); |
use Fcntl qw(:flock); |
Line 48 sub constructaccess {
|
Line 47 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. |
|
if ($url=~/\.(\d+)\.(\w+)$/) { return ''; } |
if (($ownername eq $ENV{'user.name'}) && |
if (($ownername eq $ENV{'user.name'}) && |
($ownerdomain eq $ENV{'user.domain'})) { |
($ownerdomain eq $ENV{'user.domain'})) { |
return ($ownername,$ownerdomain); |
return ($ownername,$ownerdomain); |
Line 99 sub handler {
|
Line 99 sub handler {
|
$r->log_reason("Unauthorized $requrl", $r->filename); |
$r->log_reason("Unauthorized $requrl", $r->filename); |
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
|
# Construction space needs Remote to work |
|
if ($ENV{'environment.remote'} eq 'off') { |
|
$r->content_type('text/html'); |
|
$r->header_out(Location => |
|
'http://'.$r->server->server_hostname. |
|
'/adm/remote?action=launch&url='. |
|
&Apache::lonnet::escape($requrl)); |
|
return REDIRECT; |
|
} |
|
|
# -------------------------------------------------------- Load POST parameters |
# -------------------------------------------------------- Load POST parameters |
|
|