Patch #14527 ยป repo-id-auth.patch
| extra/svn/Redmine.pm | ||
|---|---|---|
|
my $location = $r->location;
|
||
|
$location =~ s/\.git$// if (defined $cfg->{RedmineGitSmartHttp} and $cfg->{RedmineGitSmartHttp});
|
||
|
my ($identifier) = $r->uri =~ m{$location/*([^/.]+)};
|
||
|
my $dbh = connect_database($r);
|
||
|
my $sth = $dbh->prepare("SELECT id FROM projects WHERE identifier = ?;");
|
||
|
$sth->execute($identifier);
|
||
|
if (!$sth->fetchrow_array) {
|
||
|
$sth = $dbh->prepare("SELECT p.identifier FROM projects p, repositories r WHERE p.id = r.project_id AND r.identifier = ?;");
|
||
|
$sth->execute($identifier);
|
||
|
if (my @row = $sth->fetchrow_array) {
|
||
|
$identifier = $row[0];
|
||
|
}
|
||
|
}
|
||
|
$sth->finish();
|
||
|
undef $sth;
|
||
|
$dbh->disconnect();
|
||
|
undef $dbh;
|
||
|
$identifier;
|
||
|
}
|
||