source: TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/login.py @ 2675

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/login.py@2675
Revision 2675, 1.4 KB checked in by lawrence, 12 years ago (diff)

Interim commit in support of browse and discovery.

Line 
1from ows_server.lib.base import *
2from paste.request import parse_querystring
3
4class LoginController(BaseController):
5    ''' Provides the pylons controller for local login '''
6   
7    def __setup(self):
8        #where are we going back to?
9        self.inputs=dict(parse_querystring(request.environ))
10        if 'r' in self.inputs:
11            c.returnTo=self.inputs['r']
12        else:
13            c.returnTo=''
14   
15    def index(self):
16        ''' Ok, you really want to login here '''
17        self.__setup()
18       
19        # fudge for now
20        session['ndgSec']={'h':'badc.nerc.ac.uk','u':'lawrence','r':['all']}
21        session['panelView']='History'
22        session.save()
23       
24        # and now go back to whence we had come
25        if c.returnTo!='':
26            try:
27                h.redirect_to(c.returnTo)
28            except:
29                pass
30        c.xml='<p> Login Successful </p>'
31        return render_response(content)
32           
33    def wayf(self):
34        ''' NDG equivalent to Shibboleth WAYF '''
35       
36        self.__setup()
37       
38        #currently fudge this
39        c.providers={'badc.nerc.ac.uk':g.server+'/login',
40                          'bodc.nerc.a.cuk':'NotImplemented'}
41        if 'roleNeeded' in self.inputs:
42           
43            # should ask the attribute authority what hosts to put up for login
44            # but meanwhile we'll fudge it
45            pass
46       
47        return render_response('wayf')
48       
Note: See TracBrowser for help on using the repository browser.