Index: Redmine.pm =================================================================== --- Redmine.pm (revision 5976) +++ Redmine.pm (working copy) @@ -233,6 +233,11 @@ req_override => OR_AUTHCFG, args_how => TAKE1, }, + { + name => 'RedmineProjectId', + req_override => OR_AUTHCFG, + args_how => TAKE1, + }, ); sub RedmineDSN { @@ -282,6 +287,8 @@ } } +sub RedmineProjectId { set_val('RedmineProjectId', @_); } + sub trim { my $string = shift; $string =~ s/\s{2,}/ /g; @@ -529,9 +536,15 @@ my $cfg = Apache2::Module::get_config(__PACKAGE__, $r->server, $r->per_dir_config); my $location = $r->location; - $location =~ s/\.git$// if (defined $cfg->{RedmineGitSmartHttp} and $cfg->{RedmineGitSmartHttp}); - my ($identifier) = $r->uri =~ m{$location/*([^/.]+)}; - $identifier; + + if($cfg->{RedmineProjectId}) { + my ($identifier) = $cfg->{RedmineProjectId}; + return $identifier; + } else { + $location =~ s/\.git$// if (defined $cfg->{RedmineGitSmartHttp} and $cfg->{RedmineGitSmartHttp}); + my ($identifier) = $r->uri =~ m{$location/*([^/.]+)}; + return $identifier; + } } sub connect_database {