]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: Allow search to be disabled from the config file.
[Gitweb] / gitweb.perl
index 67549b8ed0bd1fda1374466e42b85a983e16440474bda8fa67f23d948c4b073e..b90bc277d497fc29f98b2371afbe8bdbcd29f77336298c9087aa3deaf97fd08a 100755 (executable)
@@ -129,6 +129,12 @@ our %feature = (
                #         => [content-encoding, suffix, program]
                'default' => ['x-gzip', 'gz', 'gzip']},
 
                #         => [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.
        # 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";
                        print " / $action";
                }
                print "\n";
+       }
+       my ($have_search) = gitweb_check_feature('search');
+       if ((defined $project) && ($have_search)) {
                if (!defined $searchtext) {
                        $searchtext = "";
                }
                if (!defined $searchtext) {
                        $searchtext = "";
                }
@@ -4152,6 +4161,10 @@ sub git_history {
 }
 
 sub git_search {
 }
 
 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");
        }
        if (!defined $searchtext) {
                die_error(undef, "Text field empty");
        }
This page took 0.188987 seconds and 4 git commands to generate.