version 1.3, 2015/05/29 18:42:01
|
version 1.8, 2020/12/18 15:23:03
|
Line 57 The perlvar "lonDAVsessDir" in /etc/http
|
Line 57 The perlvar "lonDAVsessDir" in /etc/http
|
provides the directory location: /home/httpd/webdav/sessionIDs. |
provides the directory location: /home/httpd/webdav/sessionIDs. |
|
|
If the session is stale, or the cookie is missing or invalid, |
If the session is stale, or the cookie is missing or invalid, |
the user is re-challenged for login information. If the perlvar |
the user is re-challenged for login information, by sending |
lonOtherAuthen has been set, Single Sign On will be used, otherwise |
an Apache Basic Auth request to the client. |
an Apache Basic Auth request will be sent to the client. |
|
|
|
If Apache Basic Auth is used, successful authentication will |
If Apache Basic Auth is successful authentication will |
result in creation of a webDAV session file containing a |
result in creation of a webDAV session file containing a |
minimal set of information about the user which will also be |
minimal set of information about the user which will also be |
loaded into the user's environment. The environment persists |
loaded into the user's environment. The environment persists |
Line 87 Check for valid webDAV session
|
Line 86 Check for valid webDAV session
|
|
|
=item * |
=item * |
|
|
No session? - if SSO enabled: return DECLINED |
No session? return AUTH_REQUIRED which will prompt |
|
webDAV client to authenticate user (via Apache Basic Auth). |
=item * |
|
|
|
No session? - if SSO not enabled: return AUTH_REQUIRED |
|
which will prompt webDAV client to authenticate user |
|
(via Apache Basic Auth). |
|
|
|
=item * |
=item * |
|
|
Line 170 sub handler {
|
Line 164 sub handler {
|
if (&Apache::lonnet::homeserver($uname,$udom) eq $uhome) { |
if (&Apache::lonnet::homeserver($uname,$udom) eq $uhome) { |
&Apache::lonnet::transfer_profile_to_env($sessiondir,$handle); |
&Apache::lonnet::transfer_profile_to_env($sessiondir,$handle); |
if (&Apache::lonnet::usertools_access($uname,$udom,'webdav')) { |
if (&Apache::lonnet::usertools_access($uname,$udom,'webdav')) { |
|
if ($r->user() eq '') { |
|
if ($env{'user.domain'} eq $r->dir_config('lonDefDomain')) { |
|
$r->user($env{'user.name'}); |
|
} else { |
|
$r->user($env{'user.name'}.':'.$env{'user.domain'}); |
|
} |
|
} |
return OK; |
return OK; |
} else { |
} else { |
return FORBIDDEN; |
return FORBIDDEN; |
Line 179 sub handler {
|
Line 180 sub handler {
|
} |
} |
} |
} |
|
|
if ($r->dir_config('lonOtherAuthen') eq 'yes') { |
|
if (defined($r->dir_config('lonOtherAuthenType'))) { |
|
$r->auth_type($r->dir_config('lonOtherAuthenType')); |
|
} |
|
return DECLINED; |
|
} |
|
|
|
my ($status,$upass) = $r->get_basic_auth_pw; |
my ($status,$upass) = $r->get_basic_auth_pw; |
return $status unless ($status == 0 || $status == OK); |
return $status unless ($status == 0 || $status == OK); |
|
|
if ($r->user =~ /,/) { |
if ($r->user =~ /,/) { |
($uname,$udom) = split(/,/,$r->user); |
($uname,$udom) = split(/,/,$r->user); |
|
$uname =~ s/^\s+//; |
|
$uname =~ s/\s+$//; |
|
$udom =~ s/^\s+//; |
|
$udom =~ s/\s+$//; |
unless (($uname =~ /^$match_username$/) && ($udom =~ /^$match_domain$/)) { |
unless (($uname =~ /^$match_username$/) && ($udom =~ /^$match_domain$/)) { |
$r->note_basic_auth_failure; |
$r->note_basic_auth_failure; |
return AUTH_REQUIRED; |
return AUTH_REQUIRED; |
} |
} |
} else { |
} else { |
$uname = $r->user; |
$uname = $r->user; |
|
$uname =~ s/^\s+//; |
|
$uname =~ s/\s+$//; |
($udom) = ($r->uri =~ m{^/webdav/($match_domain)/}); |
($udom) = ($r->uri =~ m{^/webdav/($match_domain)/}); |
unless (($udom ne '' ) && ($uname =~ /^$match_username$/)) { |
unless (($udom ne '' ) && ($uname =~ /^$match_username$/) && ($upass ne '')) { |
$r->note_basic_auth_failure; |
$r->note_basic_auth_failure; |
return AUTH_REQUIRED; |
return AUTH_REQUIRED; |
} |
} |
Line 298 sub init_webdav_env {
|
Line 298 sub init_webdav_env {
|
\%userenv,\%domdef,\%is_adv); |
\%userenv,\%domdef,\%is_adv); |
@env{keys(%disk_env)} = @disk_env{keys(%disk_env)}; |
@env{keys(%disk_env)} = @disk_env{keys(%disk_env)}; |
untie(%disk_env); |
untie(%disk_env); |
my $ip; |
my $ip = &Apache::lonnet::get_requestor_ip($r); |
my $c = $r->connection; |
|
if (ref($c)) { |
|
$ip = $c->remote_ip; |
|
} |
|
&Apache::lonnet::log($udom,$uname,$uhome, |
&Apache::lonnet::log($udom,$uname,$uhome, |
"Login webdav/$author $ip"); |
"Login webdav/$author $ip"); |
} |
} |