X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/29df2595733d045a38a2d5e881806ccd7d94c66d84749069943e49ccdfa5ee8f..01243a50328ba47405d3307dc6c097d00ea149905018a4b6ca65666a1d1193ea:/gitweb.perl?ds=inline diff --git a/gitweb.perl b/gitweb.perl index fefa8f9..144d7ee 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -96,6 +96,11 @@ our $default_projects_order = "project"; # (only effective if this variable evaluates to true) our $export_ok = "++GITWEB_EXPORT_OK++"; +# show repository only if this subroutine returns true +# when given the path to the project, for example: +# sub { return -e "$_[0]/git-daemon-export-ok"; } +our $export_auth_hook = undef; + # only allow viewing of repositories also shown on the overview page our $strict_export = "++GITWEB_STRICT_EXPORT++"; @@ -401,7 +406,8 @@ sub check_head_link { sub check_export_ok { my ($dir) = @_; return (check_head_link($dir) && - (!$export_ok || -e "$dir/$export_ok")); + (!$export_ok || -e "$dir/$export_ok") && + (!$export_auth_hook || $export_auth_hook->($dir))); } # process alternate names for backward compatibility