[interchange-cvs] interchange - heins modified 2 files

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Sun Sep 1 10:48:00 2002


User:      heins
Date:      2002-09-01 14:47:21 GMT
Modified:  lib/Vend Config.pm Page.pm
Log:
* Add the oft-requested DirectoryIndex feature.

Revision  Changes    Path
2.69      +3 -2      interchange/lib/Vend/Config.pm


rev 2.69, prev_rev 2.68
Index: Config.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.68
retrieving revision 2.69
diff -u -r2.68 -r2.69
--- Config.pm	1 Sep 2002 13:13:43 -0000	2.68
+++ Config.pm	1 Sep 2002 14:47:19 -0000	2.69
@@ -1,6 +1,6 @@
 # Vend::Config - Configure Interchange
 #
-# $Id: Config.pm,v 2.68 2002/09/01 13:13:43 mheins Exp $
+# $Id: Config.pm,v 2.69 2002/09/01 14:47:19 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -44,7 +44,7 @@
 use Vend::Parse;
 use Vend::Util;
=20
-$VERSION =3D substr(q$Revision: 2.68 $, 10);
+$VERSION =3D substr(q$Revision: 2.69 $, 10);
=20
 my %CDname;
=20
@@ -361,6 +361,7 @@
 	['DisplayErrors',    'yesno',            'No'],
 	['ParseVariables',	 'yesno',     	     'No'],
 	['SpecialPage',		 'special', 'order ord/basket results results search res=
ults flypage flypage'],
+	['DirectoryIndex',	 undef,				 ''],
 	['Sub',				 'subroutine',       ''],
 	['VendURL',          'url',              undef],
 	['SecureURL',        'url',              undef],



2.7       +11 -6     interchange/lib/Vend/Page.pm


rev 2.7, prev_rev 2.6
Index: Page.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Page.pm,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -r2.6 -r2.7
--- Page.pm	27 Jun 2002 22:24:10 -0000	2.6
+++ Page.pm	1 Sep 2002 14:47:19 -0000	2.7
@@ -1,6 +1,6 @@
 # Vend::Page - Handle Interchange page routing
 #=20
-# $Id: Page.pm,v 2.6 2002/06/27 22:24:10 jon Exp $
+# $Id: Page.pm,v 2.7 2002/09/01 14:47:19 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -45,7 +45,7 @@
=20
 use vars qw/$VERSION/;
=20
-$VERSION =3D substr(q$Revision: 2.6 $, 10);
+$VERSION =3D substr(q$Revision: 2.7 $, 10);
=20
 my $wantref =3D 1;
=20
@@ -64,12 +64,10 @@
=20
 	$subject =3D $subject || 'unspecified error';
=20=09
-#::logDebug("looking for special_page=3D$name");
 	$page =3D readfile($name, $Global::NoAbsolute, 1) || readin($name);
=20
 	die ::get_locale_message(412, "Missing special page: %s\n", $name)
 		unless defined $page;
-#::logDebug("displaying special_page=3D$name");
 	$page =3D~ s#\[subject\]#$subject#ig;
 	return ::response(::interpolate_html($page, 1));
 }
@@ -93,7 +91,7 @@
 		};
=20
 	$name =3D $CGI::values{mv_nextpage} unless $name;
-#::logDebug("display_page: $name");
+
 	if($Vend::Cfg->{ExtraSecure} and
 		$Vend::Cfg->{AlwaysSecure}->{$name}
 		and !$CGI::secure) {
@@ -114,6 +112,13 @@
 			and $opt->{onfly} =3D 1;
 	}
=20
+	# Try one last time for page with index
+	if(! defined $page and $Vend::Cfg->{DirectoryIndex}) {
+		my $try =3D $name;
+		$try =3D~ s!/*$!/$Vend::Cfg->{DirectoryIndex}!;
+		$page =3D readin($try);
+	}
+
 	if (defined $page) {
 		::response(::interpolate_html($page, 1, $opt));
 		return 1;
@@ -136,7 +141,7 @@
 sub do_search {
 	my($c) =3D \%CGI::values;
 	::update_user();
-#::logDebug($more);
+
 	if ($c->{mv_more_matches}) {
 		$Vend::Session->{last_search} =3D "scan/MM=3D$c->{mv_more_matches}";
 		$c->{mv_more_matches} =3D~ m/([a-zA-Z0-9])+/;