Changeset 6332 for cowsclient


Ignore:
Timestamp:
19/01/10 10:00:54 (9 years ago)
Author:
domlowe
Message:

Removing code that was causing bug: 21470. This code is no longer needed now that security is not part of the cows client wsgi pipeline.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cowsclient/trunk/cowsclient/controllers/wmsviz.py

    r6119 r6332  
    106106        initialSetup = self._buildInitialSetup(self.inputs.get('ENDPOINT')) 
    107107         
    108         #TODO: WORK OUT HOW TO COUPLE THIS TO BROWSE 
    109         # otherwise, we can get here by two routes: 
    110         # i) either by clicking on the WMC icon in the details view - if so, get passed endpoint and add to 
    111         #    selected items; 
    112         # ii) or from the selections tab - which will already have set up the correct selected items 
    113              
    114         # if ENDPOINT specified, we've reached the page via the WMC icon 
    115          
    116         #This will ensure that NDG security is triggered if a secured dataset is in Endpoint 
    117         if 'ENDPOINT' in self.inputs: 
    118         #clear out old endpoints NOTE. this means only one endpoint at a time can be viewed. May want to 
    119         #rethink this to enable 'shopping cart' type selection. 
    120 #        self.removeAllViewItems() 
    121             for endpoint in initialSetup: 
    122                 urlstring=endpoint['url']+'?request=GetCapabilities&Service=WMS' 
    123                 urlstring = parseEndpointString(endpoint['url'],  
    124                                 {'REQUEST':'GetCapabilities', 'SERVICE':'WMS'}) 
    125                 #urlstring=str(self.inputs['ENDPOINT']) 
    126                 req = urllib2.Request(urlstring) 
    127                 req.add_header('Cookie', request.headers.get('Cookie', '')) 
    128                 try: 
    129                     filehandle = openURL(req) 
    130                     filehandle.close() 
    131                 except urllib2.HTTPError, e:             
    132                     log.exception("exception occurred") 
    133                     if e.code == 401: 
    134                         log.info ('401 unauthorized error in cowsclient') 
    135                         return abort(401) #triggers ndg security framework 
    136                     elif e.code == 403:  #TODO: 403 response is UNTESTED. 
    137                         # User is authenticated but doesn't have the required permissions 
    138                         # or an error occurred in the authorization process 
    139                         # Read response                    
    140                         xresponse = e.read() 
    141                         # Send response to user 
    142                         self.start_response("%d %s" % (e.code, e.msg), e.headers.dict.items()) 
    143                           
    144                         return xresponse 
    145                  
    146          
    147         # avoid page crashing if we come here without view items defined 
    148 #        if 'viewItems' not in session: 
    149 #            h.redirect_to(h.url_for(controller='discovery')) 
    150108 
    151109        session.save()   
    152110        log.info('SAVED SESSION') 
    153          
    154         # check if page has been visited before; if not display tab 
    155 #        if (Utilities.isTabRequired(c.pageTabs, 'View')): 
    156 #            c.pageTabs.append(('View', h.url_for(controller='viewItems',action='index'))) 
    157111 
    158112        c.initialSetupJSON = utils.toJSON(initialSetup)  
Note: See TracChangeset for help on using the changeset viewer.