Defect #5383 » redmine.pm.patch
| Redmine.pm 2010-04-26 17:55:09.601338421 +0400 | ||
|---|---|---|
|
}
|
||
|
my $method = $r->method;
|
||
|
return OK unless defined $read_only_methods{$method};
|
||
|
my $project_id = get_project_identifier($r);
|
||
|
$r->set_handlers(PerlAuthenHandler => [\&OK])
|
||
|
if is_public_project($project_id, $r);
|
||
|
return OK
|
||
|
if (is_public_project($project_id, $r) && defined $read_only_methods{$method}) {
|
||
|
$r->set_handlers(PerlAuthenHandler => [\&OK]);
|
||
|
}
|
||
|
return OK;
|
||
|
}
|
||
|
sub authen_handler {
|
||
| ... | ... | |
|
bindpw => $rowldap[4] ? $rowldap[4] : "",
|
||
|
filter => "(".$rowldap[6]."=%s)"
|
||
|
);
|
||
|
$ret = 1 if ($ldap->authenticate($redmine_user, $redmine_pass));
|
||
|
$ret = 1 if ($ldap->authenticate($redmine_user, $redmine_pass) && ((defined $read_only_methods{$method} && $permissions =~ /:browse_repository/) || $permissions =~ /:commit_access/) );
|
||
|
}
|
||
|
$sthldap->finish();
|
||
|
undef $sthldap;
|
||