Project

General

Profile

Patch #14438 ยป redmine_project_id.diff

Tiffany C, 2013-07-12 07:10

View differences:

Redmine.pm (working copy)
req_override => OR_AUTHCFG,
args_how => TAKE1,
},
{
name => 'RedmineProjectId',
req_override => OR_AUTHCFG,
args_how => TAKE1,
},
);
sub RedmineDSN {
......
}
}
sub RedmineProjectId { set_val('RedmineProjectId', @_); }
sub trim {
my $string = shift;
$string =~ s/\s{2,}/ /g;
......
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 {
    (1-1/1)