Changeset 324

Show
Ignore:
Timestamp:
01/12/06 11:54:14 (3 years ago)
Author:
coderanger
Message:

AuthFormPlugin:

Forgot a few things.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • authformplugin/0.9/authform/web_ui.py

    r322 r324  
    2323from trac.core import * 
    2424from trac.web.api import IAuthenticator, IRequestHandler 
    25 from trac.web.chrome import INavigationContributor 
    26 from trac.util import escape, hex_entropy, TRUE 
     25from trac.web.chrome import INavigationContributor, ITemplateProvider 
     26from trac.util import escape, hex_entropy, TRUE, Markup 
    2727 
    2828 
     
    4444    """ 
    4545 
    46     implements(IAuthenticator, INavigationContributor, IRequestHandler
     46    implements(IAuthenticator, INavigationContributor, IRequestHandler, ITemplateProvider
    4747 
    4848    # IAuthenticator methods 
     
    7070        if req.authname and req.authname != 'anonymous': 
    7171            yield 'metanav', 'login', 'logged in as %s' % escape(req.authname) 
    72             yield 'metanav', 'logout', '<a href="%s">Logout</a>' \ 
    73                   % escape(self.env.href.logout()) 
     72            yield 'metanav', 'logout', Markup('<a href="%s">Logout</a>' \ 
     73                  % escape(self.env.href.logout())) 
    7474        else: 
    75             yield 'metanav', 'login', '<a href="%s">Login</a>' \ 
    76                   % escape(self.env.href.login()) 
     75            yield 'metanav', 'login', Markup('<a href="%s">Login</a>' \ 
     76                  % escape(self.env.href.login())) 
    7777 
    7878    # IRequestHandler methods 
     
    8888            self._do_logout(req) 
    8989        self._redirect_back(req) 
     90 
     91    # ITemplateProvider methods 
     92    def get_templates_dirs(self): 
     93        """ 
     94        Return the absolute path of the directory containing the provided 
     95        ClearSilver templates. 
     96        """ 
     97        from pkg_resources import resource_filename 
     98        return [resource_filename(__name__, 'templates')] 
     99 
     100    def get_htdocs_dirs(self): 
     101        """ 
     102        Return a list of directories with static resources (such as style 
     103        sheets, images, etc.) 
     104 
     105        Each item in the list must be a `(prefix, abspath)` tuple. The 
     106        `prefix` part defines the path in the URL that requests to these 
     107        resources are prefixed with. 
     108         
     109        The `abspath` is the absolute path to the directory containing the 
     110        resources on the local file system. 
     111        """ 
     112    return [] 
    90113 
    91114    # Internal methods