From: Robert Fitzsimons Date: Sat, 23 Dec 2006 03:35:16 +0000 (+0000) Subject: gitweb: Allow search to be disabled from the config file. X-Git-Tag: v1.5.0-rc0~20 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6be935115b4a3bfa9062875a569d4a018ac372e2;p=git.git gitweb: Allow search to be disabled from the config file. Signed-off-by: Robert Fitzsimons Signed-off-by: Junio C Hamano --- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 9061c4a75..9a4f3b484 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -128,6 +128,12 @@ our %feature = ( # => [content-encoding, suffix, program] 'default' => ['x-gzip', 'gz', 'gzip']}, + # Enable text search, which will list the commits which match author, + # committer or commit text to a given string. Enabled by default. + 'search' => { + 'override' => 0, + 'default' => [1]}, + # Enable the pickaxe search, which will list the commits that modified # a given string in a file. This can be practical and quite faster # alternative to 'blame', but still potentially CPU-intensive. @@ -1730,6 +1736,9 @@ EOF print " / $action"; } print "\n"; + } + my ($have_search) = gitweb_check_feature('search'); + if ((defined $project) && ($have_search)) { if (!defined $searchtext) { $searchtext = ""; } @@ -4151,6 +4160,10 @@ sub git_history { } sub git_search { + my ($have_search) = gitweb_check_feature('search'); + if (!$have_search) { + die_error('403 Permission denied', "Permission denied"); + } if (!defined $searchtext) { die_error(undef, "Text field empty"); }