source: TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/controllers/home.py @ 5466

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/controllers/home.py@5466
Revision 5466, 1.2 KB checked in by cbyrom, 12 years ago (diff)

Add to code to allow the OAI editor to be used with the new openid
based security system. Add the policy file and secured ini file +
adjust handling of users - enforcing page access via URL content

  • basically either by provider ID or via 'admin=1' parameter for

admin users. For the latter, provider security_redirector module to
allow admin users to use same point of entry as normal users.

  • Property svn:executable set to *
Line 
1'''
2 Class representing pylons controller to create the home page for the OAI Info Editor
3 
4 @author: C Byrom, Tessella Apr 2009
5'''
6import logging, urllib
7from oai_info_editor.lib.base import *
8from oai_info_editor.lib.constants import *
9from oai_info_editor.controllers.master import MasterController
10from oai_info_editor.controllers.master import ADMIN_PARAMETER
11
12class HomeController(MasterController):
13
14    def index(self):
15        logging.debug("Rendering editor home page")
16        c.title = EDITOR_HOME_TITLE
17        self._setUpController()
18       
19        if session.get(POP_UP_MESSAGE_SESSION_KEY):
20            c.popupMessage = session.get(POP_UP_MESSAGE_SESSION_KEY)
21            del session[POP_UP_MESSAGE_SESSION_KEY]
22            session.save()
23
24        if c.user.isAdmin:
25            c.createLink = h.url_for('createProviderInfo') + ADMIN_PARAMETER
26       
27        return self._renderTemplate('genshi', 'home')
28
29   
30   
31    def showHelpPage(self):
32        '''
33        Show the help page
34        '''
35        logging.info("Rendering help page")
36        self._setUpController()
37        c.title = HELP_PAGE_TITLE
38        return self._renderTemplate('genshi', 'oai_info_editor_help')
Note: See TracBrowser for help on using the repository browser.