Diff for /loncom/publisher/lonupload.pm between versions 1.26 and 1.27

version 1.26, 2004/03/31 05:24:00 version 1.27, 2004/05/14 14:53:31
Line 180  sub phasetwo { Line 180  sub phasetwo {
   '<input type="submit" name="override" value="'.&mt('Yes').'" /></form>');    '<input type="submit" name="override" value="'.&mt('Yes').'" /></form>');
     } else {      } else {
  my $source=$r->dir_config('lonDaemons').'/tmp/'.$datatoken.'.tmp';   my $source=$r->dir_config('lonDaemons').'/tmp/'.$datatoken.'.tmp';
    my $dirpath=$path.'/';
    $dirpath=~s/\/+/\//g;
  # Check for bad extension and disallow upload   # Check for bad extension and disallow upload
  if ($fn=~/\.(\w+)$/ &&    if ($fn=~/\.(\w+)$/ && 
     (&Apache::loncommon::fileembstyle($1) eq 'hdn')) {      (&Apache::loncommon::fileembstyle($1) eq 'hdn')) {
Line 188  sub phasetwo { Line 190  sub phasetwo {
       '<font color="red">'.        '<font color="red">'.
       &mt('The extension on this file is reserved internally by LON-CAPA.').        &mt('The extension on this file is reserved internally by LON-CAPA.').
       '</font>');        '</font>');
     $r->print('<br /><font size=+2><a href="'.$path.'">'.      $r->print('<br /><font size=+2><a href="'.$dirpath.'">'.
       &mt('Back to Directory').'</a></font>');        &mt('Back to Directory').'</a></font>');
  } elsif ($fn=~/\.(\w+)$/ &&    } elsif ($fn=~/\.(\w+)$/ && 
  !defined(&Apache::loncommon::fileembstyle($1))) {   !defined(&Apache::loncommon::fileembstyle($1))) {
Line 197  sub phasetwo { Line 199  sub phasetwo {
       '<font color="red">'.        '<font color="red">'.
       &mt('The extension on this file is not recognized by LON-CAPA.').        &mt('The extension on this file is not recognized by LON-CAPA.').
       '</font>');        '</font>');
     $r->print('<br /><font size="+2"><a href="'.$path.'">'.      $r->print('<br /><font size="+2"><a href="'.$dirpath.'">'.
       &mt('Back to Directory').'</a></font>');        &mt('Back to Directory').'</a></font>');
  } elsif (-d $target) {   } elsif (-d $target) {
     $r->print('File <tt>'.$fn.'</tt> could not be copied.<br />'.      $r->print('File <tt>'.$fn.'</tt> could not be copied.<br />'.
       '<font color="red">'.        '<font color="red">'.
       &mt('The target is an existing directory.').        &mt('The target is an existing directory.').
       '</font><br />');        '</font><br />');
     $r->print('<font size="+2"><a href="'.$path.'">'.      $r->print('<font size="+2"><a href="'.$dirpath.'">'.
       &mt('Back to Directory').'</a></font>');        &mt('Back to Directory').'</a></font>');
  } elsif (copy($source,$target)) {   } elsif (copy($source,$target)) {
     chmod(0660, $target); # Set permissions to rw-rw---.      chmod(0660, $target); # Set permissions to rw-rw---.
Line 215  sub phasetwo { Line 217  sub phasetwo {
                         $r->print(&mt('File copied.'));                          $r->print(&mt('File copied.'));
         $r->print('<br /><font size="+2"><a href="'.$url.'">'.          $r->print('<br /><font size="+2"><a href="'.$url.'">'.
       &mt('View file').'</a></font>');        &mt('View file').'</a></font>');
         $r->print('<br /><font size="+2"><a href="'.$path.'">'.          $r->print('<br /><font size="+2"><a href="'.$dirpath.'">'.
       &mt('Back to Directory').'</a></font><br />');        &mt('Back to Directory').'</a></font><br />');
                     }                      }
  } else {   } else {

Removed from v.1.26  
changed lines
  Added in v.1.27


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