Diff for /loncom/auth/lonwebdavauth.pm between versions 1.2 and 1.3

version 1.2, 2012/06/01 11:39:29 version 1.3, 2015/05/29 18:42:01
Line 32  Apache::lonwebdavauth - webDAV Authentic Line 32  Apache::lonwebdavauth - webDAV Authentic
   
 =head1 SYNOPSIS  =head1 SYNOPSIS
   
 Invoked for /+webdav/[\w\-]+/[\w\-]+/ by   Invoked for ^/+webdav/[\w\-.]+/\w[\w.\-\@]+/ by 
 /etc/httpd/conf/loncapa_apache.conf:  /etc/httpd/conf/loncapa_apache.conf:
   
 PerlAuthenHandler Apache::lonwebdavauth  PerlAuthenHandler Apache::lonwebdavauth
Line 208  sub handler { Line 208  sub handler {
             my $uhome = &Apache::lonnet::authenticate($uname,$upass,$udom);              my $uhome = &Apache::lonnet::authenticate($uname,$upass,$udom);
             if (($uhome ne 'no_host') &&               if (($uhome ne 'no_host') && 
                 (&Apache::lonnet::hostname($uhome) ne '')) {                  (&Apache::lonnet::hostname($uhome) ne '')) {
                 $handle = &init_webdav_env($sessiondir,$uname,$udom,                  my ($author) = ($r->uri =~ m{^/webdav/($match_domain/$match_username)/});
                                            $uhome,$now,$timetolive);                  $handle = &init_webdav_env($r,$sessiondir,$uname,$udom,
                                              $uhome,$now,$timetolive,$author);
                 if ($handle ne '') {                  if ($handle ne '') {
                     if (&Apache::lonnet::usertools_access($uname,$udom,'webdav')) {                      if (&Apache::lonnet::usertools_access($uname,$udom,'webdav')) {
                         my $cookie = "lonDAV=$handle; path=/webdav/; secure; HttpOnly;";                          my $cookie = "lonDAV=$handle; path=/webdav/; secure; HttpOnly;";
Line 228  sub handler { Line 229  sub handler {
 }  }
   
 sub init_webdav_env {  sub init_webdav_env {
     my ($sessiondir,$uname,$udom,$uhome,$now,$timetolive) = @_;      my ($r,$sessiondir,$uname,$udom,$uhome,$now,$timetolive,$author) = @_;
     my $handle;      my $handle;
     my $currnewest = 0;      my $currnewest = 0;
     if ($sessiondir ne '') {      if ($sessiondir ne '') {
Line 297  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 $c = $r->connection;
               if (ref($c)) {
                   $ip = $c->remote_ip;
               }
               &Apache::lonnet::log($udom,$uname,$uhome,
                                    "Login webdav/$author $ip");
         }          }
         return $handle;          return $handle;
     }      }

Removed from v.1.2  
changed lines
  Added in v.1.3


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