--- loncom/publisher/loncfile.pm 2004/03/02 16:48:27 1.52
+++ loncom/publisher/loncfile.pm 2004/05/26 22:15:19 1.54
@@ -9,7 +9,7 @@
# and displays a page showing the results of the action.
#
#
-# $Id: loncfile.pm,v 1.52 2004/03/02 16:48:27 albertel Exp $
+# $Id: loncfile.pm,v 1.54 2004/05/26 22:15:19 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -426,6 +426,14 @@ sub Rename1 {
#renaming a dir, delete the trailing /
#remove second to last element for current dir
if (-d $fn) {
+ $newfilename=~/\.(\w+)$/;
+ if (&Apache::loncommon::fileembstyle($1) eq 'ssi') {
+ $request->print('
'.
+ &mt('Cannot change MIME type of a directory').
+ ''.
+ '
'.&mt('Cancel').'');
+ return;
+ }
$newfilename=~s/\/[^\/]+\/([^\/]+)$/\/$1/;
}
$newfilename=~s://+:/:g; # remove duplicate /
@@ -1072,11 +1080,11 @@ sub phasetwo {
if ($fn=~m:(.*)/([^/]+):) {
$dir=$1; # Directory path
$main=$2; # Filename.
- }
- if($main=~m:\.(\w+)$:){ # Fixes problems with filenames with no extensions
- $main=$`; #This is what is before the match (.) so it's just the main filename, yea it's nasty
- $suffix=$1; #This is the actually filename extension if it exists
- }
+ }
+ if($main=~m:\.(\w+)$:){ # Fixes problems with filenames with no extensions
+ $main=$`; #This is what is before the match (.) so it's just the main filename, yea it's nasty
+ $suffix=$1; #This is the actually filename extension if it exists
+ }
my $dest; # On success this is where we'll go.
&Debug($r,