'.
+ &mt('Copyright/distribution option "Private" is no longer supported. Select another option from below. Consider "Custom Rights" for maximum control over the usage of your resource.').'
';
}
# ------------------------------------------------------- Now have all metadata
@@ -1287,6 +1300,9 @@ END
$metadatafields{'copyright'}='default';
$metadatafields{'sourceavail'}='open';
}
+ if ($metadatafields{'copyright'} eq 'priv') {
+ $metadatafields{'copyright'}='domain';
+ }
# ------------------------------------------------ Dial in reasonable defaults
my $defaultoption=$metadatafields{'copyright'};
unless ($defaultoption) { $defaultoption='default'; }
@@ -1303,12 +1319,12 @@ END
$intr_scrout.=&selectbox('Copyright/Distribution','copyright',
$defaultoption,
\&Apache::loncommon::copyrightdescription,
- (grep !/^public$/,(&Apache::loncommon::copyrightids)));
+ (grep !/^(public|priv)$/,(&Apache::loncommon::copyrightids)));
} else {
$intr_scrout.=&selectbox('Copyright/Distribution','copyright',
$defaultoption,
\&Apache::loncommon::copyrightdescription,
- (&Apache::loncommon::copyrightids));
+ (grep !/^priv$/,(&Apache::loncommon::copyrightids)));
}
my $copyright_help =
Apache::loncommon::help_open_topic('Publishing_Copyright');
@@ -1412,17 +1428,17 @@ sub phasetwo {
#
unless ($env{'form.obsolete'}) {
if ($target=~/(\_\_\_|\&\&\&|\:\:\:)/) {
- $r->print(
- ''.&mt('Unsupported character combination').
- ' "'.$1.'" '.&mt('in filename, FAIL').'');
+ $r->print(''.
+ &mt('Unsupported character combination [_1] in filename, FAIL.',"'.$1.'").
+ '');
return 0;
}
unless ($target=~/\.(\w+)$/) {
- $r->print(''.&mt('No valid extension found in filename, FAIL').'');
+ $r->print(''.&mt('No valid extension found in filename, FAIL').'');
return 0;
}
if ($target=~/\.(\d+)\.(\w+)$/) {
- $r->print(''.&mt('Cannot publish versioned resource, FAIL').'');
+ $r->print(''.&mt('Cannot publish versioned resource, FAIL').'');
return 0;
}
}
@@ -1434,10 +1450,15 @@ sub phasetwo {
my $logfile;
unless ($logfile=Apache::File->new('>>'.$source.'.log')) {
$r->print(
- ''.
- &mt('No write permission to user directory, FAIL').'');
+ ''.
+ &mt('No write permission to user directory, FAIL').'');
return 0;
}
+
+ if ($source =~ /\.rights$/) {
+ $r->print('
'.&mt('Warning: It can take up to 1 hour for rights changes to fully propagate.').'
');
+ }
+
print $logfile
"\n================= Publish ".localtime()." Phase Two ================\n".$env{'user.name'}.':'.$env{'user.domain'}."\n";
@@ -1470,6 +1491,7 @@ sub phasetwo {
$metadatafields{'modifyinguser'}=$env{'user.name'}.':'.
$env{'user.domain'};
$metadatafields{'authorspace'}=$cuname.':'.$cudom;
+ $metadatafields{'domain'}=$cudom;
my $allkeywords=$env{'form.addkey'};
if (exists($env{'form.keywords'})) {
@@ -1491,8 +1513,8 @@ sub phasetwo {
my $file=$metadatafields{'customdistributionfile'};
unless ($file=~/\.rights$/) {
$r->print(
- ''.&mt('No valid custom distribution rights file specified, FAIL').
- '');
+ ''.&mt('No valid custom distribution rights file specified, FAIL').
+ '');
return 0;
}
}
@@ -1501,8 +1523,8 @@ sub phasetwo {
my $mfh;
unless ($mfh=Apache::File->new('>'.$source.'.meta')) {
$r->print(
- ''.&mt('Could not write metadata, FAIL').
- '');
+ ''.&mt('Could not write metadata, FAIL').
+ '');
return 0;
}
foreach (sort keys %metadatafields) {
@@ -1555,7 +1577,7 @@ sub phasetwo {
unless ($srcd=~/^\/home\/httpd\/html\/res/) {
print $logfile "\nPANIC: Target dir is ".$srcd;
$r->print(
- "Invalid target directory, FAIL");
+ "Invalid target directory, FAIL");
return 0;
}
opendir(DIR,$srcd);
@@ -1581,8 +1603,8 @@ sub phasetwo {
$r->print('
'.&mt('Copied old target file').'
');
} else {
print $logfile "Unable to write ".$copyfile.':'.$!."\n";
- $r->print("".&mt('Failed to copy old target').
- ", $!, ".&mt('FAIL')."");
+ $r->print("".&mt('Failed to copy old target').
+ ", $!, ".&mt('FAIL')."");
return 0;
}
@@ -1597,8 +1619,8 @@ sub phasetwo {
print $logfile "Unable to write metadata ".$copyfile.':'.$!."\n";
if (-e $target.'.meta') {
$r->print(
- "".
-&mt('Failed to write old metadata copy').", $!, ".&mt('FAIL')."");
+ "".
+&mt('Failed to write old metadata copy').", $!, ".&mt('FAIL')."");
return 0;
}
}
@@ -1630,8 +1652,8 @@ sub phasetwo {
$r->print('
'.&mt('Copied source file').'
');
} else {
print $logfile "\nUnable to write ".$copyfile.':'.$!."\n";
- $r->print("".
- &mt('Failed to copy source').", $!, ".&mt('FAIL')."");
+ $r->print("".
+ &mt('Failed to copy source').", $!, ".&mt('FAIL')."");
return 0;
}
@@ -1645,7 +1667,7 @@ sub phasetwo {
} else {
print $logfile "\nUnable to write metadata ".$copyfile.':'.$!."\n";
$r->print(
- "".&mt('Failed to write metadata copy').", $!, ".&mt('FAIL')."");
+ "".&mt('Failed to write metadata copy').", $!, ".&mt('FAIL')."");
return 0;
}
$r->rflush;
@@ -1668,7 +1690,7 @@ sub phasetwo {
unless ($batch) {
my $thissrc=$source;
- $thissrc=~s/^\/home\/(\w+)\/public_html/\/priv\/$1/;
+ $thissrc=~s{^/home/($match_username)/public_html}{/priv/$1};
my $thissrcdir=$thissrc;
$thissrcdir=~s/\/[^\/]+$/\//;
@@ -1878,8 +1900,8 @@ sub defaultmetapublish {
if (copy($fn,$copyfile)) {
$r->print('