Patch #6475 » Redmine.pm-Get_project_id_from_apache.diff
redmine-1.0.1/extra/svn/Redmine.pm 2010-09-23 13:43:51.833082020 +0200 | ||
---|---|---|
142 | 142 |
args_how => TAKE1, |
143 | 143 |
errmsg => 'RedmineCacheCredsMax must be decimal number', |
144 | 144 |
}, |
145 |
{ |
|
146 |
name => 'RedmineProjectId', |
|
147 |
req_override => OR_AUTHCFG, |
|
148 |
args_how => TAKE1, |
|
149 |
}, |
|
145 | 150 |
); |
146 | 151 | |
147 | 152 |
sub RedmineDSN { |
... | ... | |
178 | 183 |
} |
179 | 184 |
} |
180 | 185 | |
186 |
sub RedmineProjectId { set_val('RedmineProjectId', @_); } |
|
187 | ||
181 | 188 |
sub trim { |
182 | 189 |
my $string = shift; |
183 | 190 |
$string =~ s/\s{2,}/ /g; |
... | ... | |
371 | 378 |
sub get_project_identifier { |
372 | 379 |
my $r = shift; |
373 | 380 |
|
381 |
my $cfg = Apache2::Module::get_config(__PACKAGE__, $r->server, $r->per_dir_config); |
|
382 |
my $projectid = $cfg->{RedmineProjectId}; |
|
383 |
if ($projectid) { return $projectid; } |
|
384 | ||
374 | 385 |
my $location = $r->location; |
375 | 386 |
my ($identifier) = $r->uri =~ m{$location/*([^/]+)}; |
376 | 387 |
$identifier; |