Edgewall Software

Ticket #540: t540-timeline_rss_login-r10174.diff

File t540-timeline_rss_login-r10174.diff, 1.1 KB (added by osimons, 20 months ago)

Fix for Timeline RSS for authenticated users (force login).

  • trac/timeline/web_ui.py

    # HG changeset patch
    # Parent 53c8b050b7f6aa63af8cec3569c5bd8dc89af224
    diff --git a/trac/timeline/web_ui.py b/trac/timeline/web_ui.py
    a b  
    8383    # IRequestHandler methods 
    8484 
    8585    def match_request(self, req): 
    86         return req.path_info == '/timeline' 
     86        if req.path_info == '/timeline': 
     87            return True 
     88        elif req.path_info == '/login/timeline' \ 
     89                                and req.args.get('format', '') == 'rss': 
     90            return True 
    8791 
    8892    def process_request(self, req): 
    8993        req.perm.assert_permission('TIMELINE_VIEW') 
     
    208212            data['context'] = html_context 
    209213 
    210214        add_stylesheet(req, 'common/css/timeline.css') 
    211         rss_href = req.href.timeline([(f, 'on') for f in filters], 
     215        rss_href = req.href(req.authname != 'anonymous' and 'login' or None, 
     216                                     'timeline', [(f, 'on') for f in filters], 
    212217                                     daysback=90, max=50, authors=authors, 
    213218                                     format='rss') 
    214219        add_link(req, 'alternate', rss_href, _('RSS Feed'),