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

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

A bit more for DIF ...

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            h.redirect_to(c.returnTo)
27        else:
28            c.xml='<p> Login Successful </p>'
29            return render_response('content')
30           
31    def wayf(self):
32        ''' NDG equivalent to Shibboleth WAYF '''
33       
34        self.__setup()
35       
36        #currently fudge this
37        c.providers={'badc.nerc.ac.uk':g.server+'/login',
38                          'bodc.nerc.a.cuk':'NotImplemented'}
39        if 'roleNeeded' in self.inputs:
40           
41            # should ask the attribute authority what hosts to put up for login
42            # but meanwhile we'll fudge it
43            pass
44       
45        return render_response('wayf')
46       
Note: See TracBrowser for help on using the repository browser.