Commits

Anonymous committed 3371323

Follow-up to [3050] to fix authentication for tracd with a base path. Thanks to Rui Lopes for the patch. Closes #2932.

Comments (0)

Files changed (2)

  * Ian Leader                     ian.leader@line.co.uk
  * Christopher Lenz               cmlenz@gmx.de
  * Ivo Looser                     ivo.looser@gmail.com
+ * Rui Lopes                      rgl ruilopes com
  * Angel Marin                    anmar@gmx.net
  * Keir Mierle                    keir@cs.utoronto.ca
  * James Moger                    jamesm@transonic.com

trac/web/standalone.py

         environ = self.setup_environ()
         path_info = environ.get('PATH_INFO', '')
         path_parts = filter(None, path_info.split('/'))
-        if len(path_parts) > 1 and path_parts[1] == 'login':
-            env_name = path_parts[0]
+        base_path = environ['trac.base_path']
+        if len(path_parts) > len(base_path)+1 and path_parts[len(base_path)+1] == 'login':
+            env_name = path_parts[len(base_path)]
             if env_name:
                 auth = self.server.auths.get(env_name,
                                              self.server.auths.get('*'))