Changeset 15065
- Timestamp:
- Nov 19, 2015, 3:34:39 AM (5 years ago)
- Location:
- sharedcookieauthplugin/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sharedcookieauthplugin/trunk/setup.py
r12348 r15065 1 1 from setuptools import find_packages, setup 2 2 3 version='0.1.4'4 5 3 setup(name='SharedCookieAuth', 6 version= version,4 version='0.1.4', 7 5 description="share cookies between trac projects in the same directory", 8 6 author='Jeff Hammel', … … 15 13 packages=find_packages(exclude=['ez_setup', 'examples', 'tests*']), 16 14 include_package_data=True, 17 package_data={ 'sharedcookieauth': ['templates/*', 'htdocs/*']},15 package_data={'sharedcookieauth': ['templates/*', 'htdocs/*']}, 18 16 zip_safe=False, 19 entry_points ="""17 entry_points=""" 20 18 [trac.plugins] 21 sharedcookieauth = sharedcookieauth 19 sharedcookieauth = sharedcookieauth.SharedCookieAuth 22 20 """, 23 21 ) 24 -
sharedcookieauthplugin/trunk/sharedcookieauth/__init__.py
r12348 r15065 1 #2 from sharedcookieauth import * -
sharedcookieauthplugin/trunk/sharedcookieauth/sharedcookieauth.py
r15064 r15065 8 8 9 9 from trac.core import * 10 from trac.env import open_environment 10 11 from trac.web.api import IAuthenticator 11 12 from trac.web.main import RequestDispatcher 12 from trac.env import open_environment13 13 14 14 15 15 class SharedCookieAuth(Component): 16 16 17 ### class-level data18 17 implements(IAuthenticator) 19 18 20 # ## method for IAuthenticator19 # IAuthenticator methods 21 20 22 21 def authenticate(self, req): … … 29 28 else: 30 29 req.environ['shared_cookie_auth'] = None 31 if req.incookie.has_key('trac_auth'):30 if 'trac_auth' in req.incookie: 32 31 for project, dispatcher in self.dispatchers().items(): 33 32 agent = dispatcher.authenticate(req) … … 39 38 return None 40 39 41 # ## internal methods40 # Internal methods 42 41 43 42 def dispatchers(self): 44 43 if not hasattr(self, '_dispatchers'): 45 46 44 dispatchers = {} 47 45 base_path, project = os.path.split(self.env.path) 48 projects = [ i for i in os.listdir(base_path) 49 if i != project ] 46 projects = [i for i in os.listdir(base_path) if i != project] 50 47 51 48 for project in projects:
Note: See TracChangeset
for help on using the changeset viewer.