Diff for /loncom/interface/lonmeta.pm between versions 1.189 and 1.190

version 1.189, 2006/11/20 20:58:30 version 1.190, 2006/12/05 02:55:53
Line 39  use Apache::lonpublisher; Line 39  use Apache::lonpublisher;
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonmysql;  use Apache::lonmysql;
 use Apache::lonmsg;  use Apache::lonmsg;
 use lib '/home/httpd/lib/perl/';  use LONCAPA qw(:DEFAULT :match);
 use LONCAPA;  
   
   
 ############################################################  ############################################################
Line 63  use LONCAPA; Line 62  use LONCAPA;
 ############################################################  ############################################################
 sub get_dynamic_metadata_from_sql {  sub get_dynamic_metadata_from_sql {
     my ($url) = shift();      my ($url) = shift();
     my ($authordom,$author)=($url=~m:^/res/(\w+)/(\w+)/:);      my ($authordom,$author)=($url=~m{^/res/($match_domain)/($match_username)/});
     if (! defined($authordom)) {      if (! defined($authordom)) {
         $authordom = shift();          $authordom = shift();
     }      }
Line 112  sub get_dynamic_metadata_from_sql { Line 111  sub get_dynamic_metadata_from_sql {
 sub dynamicmeta {  sub dynamicmeta {
     my $url=&Apache::lonnet::declutter(shift);      my $url=&Apache::lonnet::declutter(shift);
     $url=~s/\.meta$//;      $url=~s/\.meta$//;
     my ($adomain,$aauthor)=($url=~/^(\w+)\/(\w+)\//);      my ($adomain,$aauthor)=($url=~/^($match_domain)\/($match_username)\//);
     my $regexp=$url;      my $regexp=$url;
     $regexp=~s/(\W)/\\$1/g;      $regexp=~s/(\W)/\\$1/g;
     $regexp='___'.$regexp.'___';      $regexp='___'.$regexp.'___';
Line 449  sub prettyprint { Line 448  sub prettyprint {
  ($type eq 'owner') ||   ($type eq 'owner') ||
  ($type eq 'modifyinguser') ||   ($type eq 'modifyinguser') ||
  ($type eq 'authorspace')) {   ($type eq 'authorspace')) {
  $value=~s/(\w+)(\:|\@)(\w+)/&authordisplay($1,$3)/gse;   $value=~s/($match_username)(\:|\@)($match_domain)/&authordisplay($1,$3)/gse;
  return $value;   return $value;
     }      }
     # Gradelevel      # Gradelevel
Line 732  sub handler { Line 731  sub handler {
     $r->send_http_header;      $r->send_http_header;
     return OK if $r->header_only;      return OK if $r->header_only;
     my ($resdomain,$resuser)=      my ($resdomain,$resuser)=
         (&Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//);          (&Apache::lonnet::declutter($uri)=~/^($match_domain)\/($match_username)\//);
     if ($uri=~m:/adm/bombs/(.*)$:) {      if ($uri=~m:/adm/bombs/(.*)$:) {
         $r->print(&Apache::loncommon::start_page('Error Messages'));          $r->print(&Apache::loncommon::start_page('Error Messages'));
         # Looking for all bombs?          # Looking for all bombs?
         &report_bombs($r,$uri);          &report_bombs($r,$uri);
     } elsif ($uri=~m|^/editupload/[^/]+/[^/]+/portfolio/|) {      } elsif ($uri=~m|^/editupload/[^/]+/[^/]+/portfolio/|) {
     ($resdomain,$resuser)=      ($resdomain,$resuser)=
  (&Apache::lonnet::declutter($uri)=~m|^(\w+)/(\w+)/portfolio|);   (&Apache::lonnet::declutter($uri)=~m|^($match_domain)/($match_name)/portfolio|);
         $r->print(&Apache::loncommon::start_page('Edit Portfolio File Catalog Information',          $r->print(&Apache::loncommon::start_page('Edit Portfolio File Catalog Information',
  undef,   undef,
  {'domain' => $resdomain,}));   {'domain' => $resdomain,}));
Line 793  sub report_bombs { Line 792  sub report_bombs {
     $uri =~ s:/adm/bombs/::;      $uri =~ s:/adm/bombs/::;
     $uri = &Apache::lonnet::declutter($uri);      $uri = &Apache::lonnet::declutter($uri);
     $r->print('<h1>'.&Apache::lonnet::clutter($uri).'</h1>');      $r->print('<h1>'.&Apache::lonnet::clutter($uri).'</h1>');
     my ($domain,$author)=($uri=~/^(\w+)\/(\w+)\//);      my ($domain,$author)=($uri=~/^($match_domain)\/($match_username)\//);
     if (&Apache::loncacc::constructaccess('/~'.$author.'/',$domain)) {      if (&Apache::loncacc::constructaccess('/~'.$author.'/',$domain)) {
  if ($env{'form.clearbombs'}) {   if ($env{'form.clearbombs'}) {
     &Apache::lonmsg::clear_author_res_msg($uri);      &Apache::lonmsg::clear_author_res_msg($uri);
Line 1060  sub print_dynamic_metadata { Line 1059  sub print_dynamic_metadata {
     } else {      } else {
         $r->print('<h4>'.&mt('No Evaluation Data is available for this resource.').'</h4>');          $r->print('<h4>'.&mt('No Evaluation Data is available for this resource.').'</h4>');
     }      }
     $uri=~/^\/res\/(\w+)\/(\w+)\//;       $uri=~/^\/res\/($match_domain)\/($match_username)\//; 
     if ((($env{'user.domain'} eq $1) && ($env{'user.name'} eq $2))      if ((($env{'user.domain'} eq $1) && ($env{'user.name'} eq $2))
         || ($env{'user.role.ca./'.$1.'/'.$2})) {          || ($env{'user.role.ca./'.$1.'/'.$2})) {
         if (exists($dynmeta{'comments'})) {          if (exists($dynmeta{'comments'})) {
Line 1337  ENDEDIT Line 1336  ENDEDIT
     }      }
     if ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles|) {      if ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles|) {
         my ($path, $new_fn);          my ($path, $new_fn);
         if ($fn =~ m|\w+/groups/\w+/portfolio/|) {          if ($fn =~ m|$match_name/groups/\w+/portfolio/|) {
                     ($path, $new_fn) = ($fn =~ m|/(groups/\w+/portfolio.*)/([^/]*)$|);                      ($path, $new_fn) = ($fn =~ m|/(groups/\w+/portfolio.*)/([^/]*)$|);
         } else {          } else {
     ($path, $new_fn) = ($fn =~ m|/(portfolio.*)/([^/]*)$|);      ($path, $new_fn) = ($fn =~ m|/(portfolio.*)/([^/]*)$|);

Removed from v.1.189  
changed lines
  Added in v.1.190


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