--- loncom/publisher/lonpublisher.pm 2007/03/02 23:18:19 1.221 +++ loncom/publisher/lonpublisher.pm 2007/06/18 20:30:32 1.225 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.221 2007/03/02 23:18:19 albertel Exp $ +# $Id: lonpublisher.pm,v 1.225 2007/06/18 20:30:32 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -409,16 +409,14 @@ sub urlfixup { if ($url =~ /^mailto:/i) { return $url; } #internal document links need no fixing if ($url =~ /^\#/) { return $url; } - my ($host)=($url=~/(?:(?:http|https|ftp)\:\/\/)*([^\/]+)/); - my %all_hostnames = &Apache::lonnet::all_hostnames(); - foreach my $hostname (values(%all_hostnames)) { - if ($hostname eq $host) { - $url=~s/^(?:http|https|ftp)\:\/\///; - $url=~s/^\Q$host\E//; - } + my ($host)=($url=~m{(?:(?:http|https|ftp)://)*([^/]+)}); + my @lonids = &Apache::lonnet::machine_ids($host); + if (@lonids) { + $url=~s{^(?:http|https|ftp)://}{}; + $url=~s/^\Q$host\E//; } - if ($url=~/^(?:http|https|ftp)\:\/\//) { return $url; } - $url=~s/\~$cuname/res\/$cudom\/$cuname/; + if ($url=~m{^(?:http|https|ftp)://}) { return $url; } + $url=~s{\Q~$cuname\E}{res/$cudom/$cuname}; return $url; } @@ -496,11 +494,15 @@ sub get_subscribed_hosts { $target=~/(.*)\/([^\/]+)$/; my $srcf=$2; opendir(DIR,$1); + # cycle through listed files, subscriptions used to exist + # as "filename.lonid" while ($filename=readdir(DIR)) { if ($filename=~/\Q$srcf\E\.($match_lonid)$/) { my $subhost=$1; - if (($subhost ne 'meta' && $subhost ne 'subscription' && - $subhost ne 'tmp') && + if (($subhost ne 'meta' + && $subhost ne 'subscription' + && $subhost ne 'meta.subscription' + && $subhost ne 'tmp') && ($subhost ne $Apache::lonnet::perlvar{'lonHostID'})) { push(@subscribed,$subhost); } @@ -846,7 +848,7 @@ sub store_metadata { \%metadata); } if (defined($status) && $status ne '') { - $error='Error occured storing new values in '. + $error='Error occured saving new values in '. 'metadata table in LON-CAPA database'; &Apache::lonnet::logthis($error); &Apache::lonnet::logthis($status); @@ -1106,7 +1108,7 @@ sub publish { } } if ($chparms) { - $scrout.='

'.&mt('New parameters or stored values'). + $scrout.='

'.&mt('New parameters or saved values'). ': '.$chparms.'

'; } @@ -1123,7 +1125,7 @@ sub publish { } } if ($chparms) { - $scrout.='

'.&mt('Obsolete parameters or stored values').': '. + $scrout.='

'.&mt('Obsolete parameters or saved values').': '. $chparms.'

'.&mt('Warning!'). '

'. &mt('If this resource is in active use, student performance data from the previous version may become inaccessible.').'


';