From 6be2e99bb60ef828e258345bd43593c93ad680bf Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 18 Nov 2011 17:28:40 +0000 Subject: [PATCH] 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 --- extra/svn/Redmine.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/extra/svn/Redmine.pm b/extra/svn/Redmine.pm index 1de891fcb..fd019b402 100644 --- a/extra/svn/Redmine.pm +++ b/extra/svn/Redmine.pm @@ -149,15 +149,16 @@ sub RedmineDSN { $self->{RedmineDSN} = $arg; my $query = "SELECT hashed_password, salt, auth_source_id, permissions - FROM members, projects, users, roles, member_roles + FROM projects, users, roles WHERE - projects.id=members.project_id - AND member_roles.member_id=members.id - AND users.id=members.user_id - AND roles.id=member_roles.role_id + users.login=? + AND projects.identifier=? AND users.status=1 - AND login=? - AND identifier=? "; + AND ( + 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); } -- 2.39.5