]> source.dussan.org Git - redmine.git/commitdiff
Fixed: Redmine.pm considers all projects private when login_required is enabled ...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 18 Nov 2011 17:28:40 +0000 (17:28 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 18 Nov 2011 17:28:40 +0000 (17:28 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7834 e93f8b46-1217-0410-a6f0-8f06a7374b81

extra/svn/Redmine.pm

index 1de891fcb24d42632000b233afbe47bef74c04f9..fd019b402b09d7d9fde330bffcd95041b83b4a9d 100644 (file)
@@ -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);
 }