version 1.83, 2007/04/26 21:17:16
|
version 1.86, 2007/07/25 19:56:57
|
Line 226 sub empty_directory {
|
Line 226 sub empty_directory {
|
|
|
=over 4 |
=over 4 |
|
|
=item $user - string [in] - Name of the user for which to check. |
=item $user - string [in] - Name of the user for which to check. |
|
|
=item $domain - string [in] - Name of the domain in which the resource |
=item $domain - string [in] - Name of the domain in which the resource |
might have been published. |
might have been published. |
|
|
=item $file - string [in] - Name of the file. |
=item $file - string [in] - Name of the file. |
|
|
|
=item $creating - string [in] - optional, type of object being created, |
|
either 'directory' or 'file'. Defaults to |
|
'file' if unspecified. |
|
|
=back |
=back |
|
|
Line 251 Returns:
|
Line 255 Returns:
|
=cut |
=cut |
|
|
sub exists { |
sub exists { |
my ($user, $domain, $construct) = @_; |
my ($user, $domain, $construct, $creating) = @_; |
|
$creating ||= 'file'; |
|
|
my $published=$construct; |
my $published=$construct; |
$published=~ |
$published=~ |
s{^/home/$user/public_html/}{/home/httpd/html/res/$domain/$user/}; |
s{^/home/$user/public_html/}{/home/httpd/html/res/$domain/$user/}; |
Line 266 sub exists {
|
Line 272 sub exists {
|
$type = 'warning'; |
$type = 'warning'; |
$result.='<p><span class="LC_warning">'.&mt('Warning: target file exists, and has been published!').'</span></p>'; |
$result.='<p><span class="LC_warning">'.&mt('Warning: target file exists, and has been published!').'</span></p>'; |
} else { |
} else { |
$type = 'warning'; |
my $published_type = (-d $published) ? 'directory' : 'file'; |
$result.='<p><span class="LC_warning">'.&mt('Warning: a published file of this names exists.').'</span></p>'; |
|
|
if ($published_type eq $creating) { |
|
$type = 'warning'; |
|
$result.='<p><span class="LC_warning">'.&mt("Warning: a published $published_type of this name exists.").'</span></p>'; |
|
} else { |
|
$type = 'error'; |
|
$result.='<p><span class="LC_error">'.&mt("Error: a published $published_type of this name exists.").'</span></p>'; |
|
} |
} |
} |
} elsif ( -e $construct) { |
} elsif ( -e $construct) { |
$type = 'warning'; |
$type = 'warning'; |
Line 340 sub cleanDest {
|
Line 353 sub cleanDest {
|
$dest=~s|.*/||; |
$dest=~s|.*/||; |
} |
} |
} |
} |
|
if ($dest =~ /\.(\d+)\.(\w+)$/){ |
|
$request->print('<span class="LC_error">' |
|
.&mt('Bad filename [_1].<br /> <tt>(name).(number).(extension)</tt> not allowed. <br /> Removing the <tt>.number.</tt> from requested filename.',$dest) |
|
.'</span>'); |
|
$dest =~ s/\.(\d+)(\.\w+)$/$2/; |
|
} |
if ($foundbad) { |
if ($foundbad) { |
$request->print("<p><span class=\"LC_error\">".&mt('Invalid characters in requested name have been removed.')."</span></p>"); |
$request->print("<p><span class=\"LC_error\">".&mt('Invalid characters in requested name have been removed.')."</span></p>"); |
} |
} |
Line 674 causes the newdir operation to transitio
|
Line 693 causes the newdir operation to transitio
|
sub NewDir1 { |
sub NewDir1 { |
my ($request, $username, $domain, $fn, $newfilename, $mode) = @_; |
my ($request, $username, $domain, $fn, $newfilename, $mode) = @_; |
|
|
my ($type, $result)=&exists($username,$domain,$newfilename); |
my ($type, $result)=&exists($username,$domain,$newfilename,'directory'); |
$request->print($result); |
$request->print($result); |
if ($result) { |
if ($type eq 'error') { |
$request->print('</form>'); |
$request->print('</form>'); |
} else { |
} else { |
if ($mode eq 'testbank') { |
if ($mode eq 'testbank') { |
Line 852 sub phaseone {
|
Line 871 sub phaseone {
|
$env{'form.action'} eq 'newsequencefile' || |
$env{'form.action'} eq 'newsequencefile' || |
$env{'form.action'} eq 'newrightsfile' || |
$env{'form.action'} eq 'newrightsfile' || |
$env{'form.action'} eq 'newstyfile' || |
$env{'form.action'} eq 'newstyfile' || |
|
$env{'form.action'} eq 'newtaskfile' || |
$env{'form.action'} eq 'newlibraryfile' || |
$env{'form.action'} eq 'newlibraryfile' || |
$env{'form.action'} eq 'Select Action') { |
$env{'form.action'} eq 'Select Action') { |
my $empty=&mt('Type Name Here'); |
my $empty=&mt('Type Name Here'); |
Line 1351 function writeDone() {
|
Line 1371 function writeDone() {
|
$env{'form.action'} eq 'newsequencefile' || |
$env{'form.action'} eq 'newsequencefile' || |
$env{'form.action'} eq 'newrightsfile' || |
$env{'form.action'} eq 'newrightsfile' || |
$env{'form.action'} eq 'newstyfile' || |
$env{'form.action'} eq 'newstyfile' || |
|
$env{'form.action'} eq 'newtaskfile' || |
$env{'form.action'} eq 'newlibraryfile' || |
$env{'form.action'} eq 'newlibraryfile' || |
$env{'form.action'} eq 'Select Action' ) { |
$env{'form.action'} eq 'Select Action' ) { |
$r->print('<h3>'.&mt('New Resource').'</h3>'); |
$r->print('<h3>'.&mt('New Resource').'</h3>'); |