Diff for /loncom/publisher/lonpubdir.pm between versions 1.97 and 1.98

version 1.97, 2006/11/22 20:50:44 version 1.98, 2006/12/06 22:22:39
Line 41  use Apache::lonlocal; Line 41  use Apache::lonlocal;
 use Apache::lonmsg;  use Apache::lonmsg;
 use Apache::lonmenu;  use Apache::lonmenu;
 use Apache::lonnet;  use Apache::lonnet;
   use LONCAPA;
   
 sub handler {  sub handler {
   
Line 157  sub getEffectiveUrl { Line 158  sub getEffectiveUrl {
  #   #
  $fn=~s/^http\:\/\/[^\/]+\///;   $fn=~s/^http\:\/\/[^\/]+\///;
         $fn=~s/^\///;          $fn=~s/^\///;
         $fn=~s/\~(\w+)/\/home\/$1\/public_html/;          $fn=~s{~($LONCAPA::username_re)}{/home/$1/public_html};
   
  #  Remove trailing / strings (?)    #  Remove trailing / strings (?) 
   
Line 170  sub getEffectiveUrl { Line 171  sub getEffectiveUrl {
     #internal authentication, needs fixup.      #internal authentication, needs fixup.
     $fn = $r->uri(); # non users do not get the full path request      $fn = $r->uri(); # non users do not get the full path request
                              # through SCRIPT_FILENAME                               # through SCRIPT_FILENAME
     $fn=~s|^/~(\w+)|/home/$1/public_html|;      $fn=~s{^/~($LONCAPA::username_re)}{/home/$1/public_html};
  }   }
     }      }
     $fn=~s/\/+/\//g;      $fn=~s/\/+/\//g;
Line 514  sub putdirectory { Line 515  sub putdirectory {
  %Apache::lonpublisher::metadatafields=();   %Apache::lonpublisher::metadatafields=();
  %Apache::lonpublisher::metadatakeys=();   %Apache::lonpublisher::metadatakeys=();
  my $construct=$here;   my $construct=$here;
  $construct=~s:^/priv/(\w+)$:/home/$1/public_html:;   $construct=~s{^/priv/($LONCAPA::username_re)$}{/home/$1/public_html};
         my $dirpath = $here;          my $dirpath = $here;
         $dirpath=~s:^/priv/:/~:;          $dirpath=~s{^/priv/}{/~};
  &Apache::lonpublisher::metaeval(&Apache::lonnet::getfile(   &Apache::lonpublisher::metaeval(&Apache::lonnet::getfile(
         $construct.'/'.$dirname.'/default.meta'          $construct.'/'.$dirname.'/default.meta'
  ));   ));

Removed from v.1.97  
changed lines
  Added in v.1.98


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