Edgewall Software

Ticket #540: 540-login-mirror-r7423.patch

File 540-login-mirror-r7423.patch, 1.5 KB (added by Remy Blank <remy.blank@…>, 4 years ago)

Patch against 0.11-stable mirroring the whole application below /login

  • trac/timeline/web_ui.py

    diff --git a/trac/timeline/web_ui.py b/trac/timeline/web_ui.py
    a b  
    185185            req.session['timeline.daysback'] = daysback 
    186186 
    187187        add_stylesheet(req, 'common/css/timeline.css') 
    188         rss_href = req.href.timeline([(f, 'on') for f in filters], 
     188        alt_href = req.authname != 'anonymous' and req.auth_href or req.href 
     189        rss_href = alt_href.timeline([(f, 'on') for f in filters], 
    189190                                     daysback=90, max=50, format='rss') 
    190191        add_link(req, 'alternate', rss_href, _('RSS Feed'), 
    191192                 'application/rss+xml', 'rss') 
  • trac/web/api.py

    diff --git a/trac/web/api.py b/trac/web/api.py
    a b  
    159159        self.base_url = self.environ.get('trac.base_url') 
    160160        if not self.base_url: 
    161161            self.base_url = self._reconstruct_url() 
     162         
     163        # Mirror the complete application below /login 
     164        path_info = self.path_info 
     165        base_path = self.base_path 
     166        if path_info.startswith('/login/'): 
     167            environ['PATH_INFO'] = path_info[6:] 
     168            environ['SCRIPT_NAME'] = base_path + '/login' 
     169            self.base_url += "/login" 
     170         
    162171        self.href = Href(self.base_path) 
    163172        self.abs_href = Href(self.base_url) 
     173        self.auth_href = Href(base_path + '/login') 
    164174 
    165175    def __getattr__(self, name): 
    166176        """Performs lazy attribute lookup by delegating to the functions in the