version 1.4, 2015/05/29 18:42:01
|
version 1.5, 2015/05/29 20:00:49
|
Line 47 and is used to control access for the fo
|
Line 47 and is used to control access for the fo
|
<LocationMatch "^/+webdav/[\w\-.]+/\w[\w.\-\@]+/"> |
<LocationMatch "^/+webdav/[\w\-.]+/\w[\w.\-\@]+/"> |
|
|
This module is only called following successful authentication. |
This module is only called following successful authentication. |
Unless lonOtherAuthen has been set, so Single Sign On can be used, |
Successful authentication will have created a session file and |
successful authentication will have created a session file and |
|
transferred the contents to the user's environment. |
transferred the contents to the user's environment. |
|
|
In the case of SSO, there is no existing user environment, but |
Note: because Apache Basic Auth is used for authentication |
$r->user will have been set to the user's username, following |
|
successful authentication. For SSO, the webDAV session file |
|
and environment are set up by a call to |
|
Apache::lonwebdavauth::init_webdav_env(). |
|
|
|
Note: because Apache Basic Auth is used for authentication (unless SSO) |
|
webDAV access is only available for servers running Apache with SSL. |
webDAV access is only available for servers running Apache with SSL. |
|
|
This is part of the LearningOnline Network with CAPA project |
This is part of the LearningOnline Network with CAPA project |
Line 75 Checks if $env{'user.environment'} is de
|
Line 68 Checks if $env{'user.environment'} is de
|
|
|
=item * |
=item * |
|
|
If no %env, this was SSO authentication so call to &sso_login() to |
If no %env, calls Apache::lonnet::check_for_valid_session() |
create session, and return cookie. |
to retrieve a valid sessionID (webDAV client needs to support |
|
cookies for session retrieval to be successful). If a session is |
|
found Apache::lonnet::transfer_profile_to_env() is called |
|
to populate %env. |
|
|
=item * |
=item * |
|
|
Checks if requested URL (of form /webdav/authordomain/authorname) is valid |
Checks if requested URL (of form /webdav/authordomain/authorname) is valid |
and whether authenticated user has an active author or co-author |
and whether authenticated user has an active author or co-author |
role in the corresonding Author Space. |
role in the corresponding Authoring Space. |
|
|
=back |
=back |
|
|
Line 96 role in the corresonding Author Space.
|
Line 92 role in the corresonding Author Space.
|
|
|
=item * |
=item * |
|
|
Called if no user.environment exists in %env. |
Not currently used. |
|
|
=item * |
=item * |
|
|
Line 137 sub handler {
|
Line 133 sub handler {
|
my $author = "$aname:$adom"; |
my $author = "$aname:$adom"; |
unless ($env{'user.environment'}) { |
unless ($env{'user.environment'}) { |
my $handle = &Apache::lonnet::check_for_valid_session($r,'lonDAV'); |
my $handle = &Apache::lonnet::check_for_valid_session($r,'lonDAV'); |
if ($handle eq '') { |
if ($handle ne '') { |
$handle = &sso_login($r,$sessiondir,$now,$timetolive,$author); |
|
if ($handle eq '') { |
|
return FORBIDDEN; |
|
} |
|
} else { |
|
&Apache::lonnet::transfer_profile_to_env($sessiondir,$handle); |
&Apache::lonnet::transfer_profile_to_env($sessiondir,$handle); |
|
} else { |
|
return FORBIDDEN; |
} |
} |
} |
} |
my $uhome=&Apache::lonnet::homeserver($env{'user.name'},$env{'user.domain'}); |
my $uhome=&Apache::lonnet::homeserver($env{'user.name'},$env{'user.domain'}); |