Changeset 3589
- Timestamp:
- 05/04/08 18:46:24 (7 months ago)
- Files:
-
- traccasplugin/0.11/setup.py (modified) (1 diff)
- traccasplugin/0.11/traccas/traccas.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
traccasplugin/0.11/setup.py
r3416 r3589 6 6 setup( 7 7 name = 'TracCAS', 8 version = ' 1.0',8 version = '2.0', 9 9 packages = ['traccas'], 10 10 11 author = "Noah Kantrowitz", 12 author_email = "noah@coderanger.net", 13 description = "A modified authentication plugin to use the Yale CAS system.", 14 license = "BSD", 15 keywords = "trac cas authentication plugin", 16 url = "http://trac-hacks.org/wiki/TracCASPlugin", 11 author = 'Noah Kantrowitz', 12 author_email = 'noah@coderanger.net', 13 description = 'A modified authentication plugin to use the Yale CAS system.', 14 license = 'BSD', 15 keywords = 'trac plugin cas authentication', 16 url = 'http://trac-hacks.org/wiki/TracCASPlugin', 17 18 install_requires = ['Trac'], 17 19 18 20 entry_points = { traccasplugin/0.11/traccas/traccas.py
r3587 r3589 7 7 from trac.util import escape, hex_entropy, Markup 8 8 from trac.web.auth import LoginModule 9 from genshi.builder import tag 10 9 11 from pycas import PyCAS 10 12 … … 19 21 validate_path = Option('cas', 'validate_path', default='/validate', 20 22 doc='Path component for the validation system') 21 22 def __init__(self):23 paths = {24 'login_path': self.login_path,25 'logout_path': self.logout_path,26 'validate_path': self.validate_path,27 }28 self.cas = PyCAS(self.server, **paths)29 23 30 24 # IAuthenticatorMethods … … 41 35 def get_navigation_items(self, req): 42 36 if req.authname and req.authname != 'anonymous': 43 yield ('metanav', 'login', 'logged in as %s' % req.authname)44 yield ('metanav', 'logout', Markup('<a href="%s">Logout</a>' % escape(req.href.logout())))37 yield 'metanav', 'login', 'logged in as %s' % req.authname 38 yield 'metanav', 'logout', tag.a('Logout', href=req.href.logout()) 45 39 else: 46 yield ('metanav', 'login', Markup('<a href="%s">Login</a>' % escape(self.cas.login_url(req.abs_href.login())))) 47 40 yield 'metanav', 'login', tag.a('Login', href=self.cas.login_url(req.abs_href.login())) 48 41 49 42 # Internal methods … … 59 52 else: 60 53 req.redirect(req.abs_href()) 54 55 def cas(self): 56 paths = { 57 'login_path': self.login_path, 58 'logout_path': self.logout_path, 59 'validate_path': self.validate_path, 60 } 61 return PyCAS(self.server, **paths) 62 cas = property(cas)
