'.
+ &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 +1301,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 +1320,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 +1429,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 +1451,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 +1492,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 +1514,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 +1524,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 +1578,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 +1604,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 +1620,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 +1653,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 +1668,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 +1691,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/\/[^\/]+$/\//;
@@ -1820,10 +1843,16 @@ sub publishdirectory {
# previously published, modified now
$publishthis=1;
}
+ my $meta_cmtime = (stat($fn.'/'.$filename.'.meta'))[9];
+ my $meta_rmtime = (stat($resdir.'/'.$filename.'.meta'))[9];
+ if ( $meta_rmtime<$meta_cmtime ) {
+ $publishthis=1;
+ }
} else {
# never published
$publishthis=1;
}
+
if ($publishthis) {
&batchpublish($r,$fn.'/'.$filename,$resdir.'/'.$filename);
} else {
@@ -1872,8 +1901,8 @@ sub defaultmetapublish {
if (copy($fn,$copyfile)) {
$r->print('