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-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/caf931b11c07a008412bb726da5547e5efb9d3b0835050c0b98bd57cfc817140 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.perl b/gitweb.perl index 67549b8..b90bc27 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -129,6 +129,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. @@ -1731,6 +1737,9 @@ EOF print " / $action"; } print "\n"; + } + my ($have_search) = gitweb_check_feature('search'); + if ((defined $project) && ($have_search)) { if (!defined $searchtext) { $searchtext = ""; } @@ -4152,6 +4161,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"); }