[interchange-cvs] interchange - racke modified lib/Vend/Interpolate.pm
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Thu May 22 17:18:00 2003
User: racke
Date: 2003-05-22 21:17:02 GMT
Modified: lib/Vend Interpolate.pm
Log:
remove code related to static page building from timed_build
additional sanity check introduced
Revision Changes Path
2.171 +9 -23 interchange/lib/Vend/Interpolate.pm
rev 2.171, prev_rev 2.170
Index: Interpolate.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.170
retrieving revision 2.171
diff -u -r2.170 -r2.171
--- Interpolate.pm 21 May 2003 11:59:34 -0000 2.170
+++ Interpolate.pm 22 May 2003 21:17:02 -0000 2.171
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#
-# $Id: Interpolate.pm,v 2.170 2003/05/21 11:59:34 racke Exp $
+# $Id: Interpolate.pm,v 2.171 2003/05/22 21:17:02 racke Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -27,7 +27,7 @@
require Exporter;
@ISA = qw(Exporter);
-$VERSION = substr(q$Revision: 2.170 $, 10);
+$VERSION = substr(q$Revision: 2.171 $, 10);
@EXPORT = qw (
@@ -5160,17 +5160,20 @@
or ( ! $opt->{force}
and
( ! $Vend::Cookie
- or $Vend::BuildingPages
or ! $opt->{login} && $Vend::Session->{logged_in}
)
);
}
-
+
if($opt->{auto}) {
$opt->{login} = 1 unless defined $opt->{login};
$opt->{minutes} = 60 unless defined $opt->{minutes};
$opt->{login} = 1;
my $dir = "$Vend::Cfg->{ScratchDir}/auto-timed";
+ unless (allowed_file($dir)) {
+ log_file_violation($dir, 'timed_build');
+ return;
+ }
if(! -d $dir) {
require File::Path;
File::Path::mkpath($dir);
@@ -5183,12 +5186,9 @@
}
my $secs;
- my $static;
- my $fullfile;
CHECKDIR: {
last CHECKDIR if $file;
- my $dir = $Vend::Cfg->{StaticDir};
- $dir = ! -d $dir || ! -w _ ? 'timed' : do { $static = 1; $dir };
+ my $dir = 'timed';
$file = $saved_file || $Vend::Flypart || $Global::Variable->{MV_PAGE};
#::logDebug("static=$file");
@@ -5201,8 +5201,7 @@
else {
$saved_file = $file = ($Vend::Flypart || $Global::Variable->{MV_PAGE});
}
- $file .= $Vend::Cfg->{StaticSuffix};
- $fullfile = $file;
+ $file .= $Vend::Cfg->{HTMLsuffix};
$dir .= "/$1"
if $file =~ s:(.*)/::;
if(! -d $dir) {
@@ -5231,19 +5230,6 @@
my $out = Vend::Interpolate::interpolate_html(shift);
$opt->{umask} = '22' unless defined $opt->{umask};
Vend::Util::writefile(">$file", $out, $opt );
-# STATICPAGE
- if ($Vend::Cfg->{StaticDBM} and Vend::Session::tie_static_dbm(1) ) {
- if ($opt->{scan}) {
- $saved_file =~ s!=([^/]+)=!=$1%3d!g;
- $saved_file =~ s!=([^/]+)-!=$1%2d!g;
-#::logDebug("saved_file=$saved_file");
- $Vend::StaticDBM{$saved_file} = $fullfile;
- }
- else {
- $Vend::StaticDBM{$saved_file} = '';
- }
- }
-# END STATICPAGE
$Vend::Session->{scratch} = $save_scratch if $save_scratch;
return $out;
}