Fixed: Redmine.pm considers all projects private when login_required is enabled (#9566).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7834 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-11-18 17:28:40 +00:00
parent a1bb968e8d
commit 6be2e99bb6
1 changed files with 8 additions and 7 deletions

View File

@ -149,15 +149,16 @@ sub RedmineDSN {
$self->{RedmineDSN} = $arg; $self->{RedmineDSN} = $arg;
my $query = "SELECT my $query = "SELECT
hashed_password, salt, auth_source_id, permissions hashed_password, salt, auth_source_id, permissions
FROM members, projects, users, roles, member_roles FROM projects, users, roles
WHERE WHERE
projects.id=members.project_id users.login=?
AND member_roles.member_id=members.id AND projects.identifier=?
AND users.id=members.user_id
AND roles.id=member_roles.role_id
AND users.status=1 AND users.status=1
AND login=? AND (
AND identifier=? "; roles.id IN (SELECT member_roles.role_id FROM members, member_roles WHERE members.user_id = users.id AND members.project_id = projects.id AND members.id = member_roles.member_id)
OR
(roles.builtin=1 AND cast(projects.is_public as CHAR) IN ('t', '1'))
) ";
$self->{RedmineQuery} = trim($query); $self->{RedmineQuery} = trim($query);
} }