source: products/quintagroup.gauth/trunk/quintagroup/gauth/setuphandlers.py @ 2613

Last change on this file since 2613 was 2609, checked in by mylan, 14 years ago

Register IGAuthUtility to LocalSiteManager? on installation and bound to configlet; some refactoring and updates

  • Property svn:eol-style set to native
File size: 691 bytes
Line 
1import logging
2
3from zope.component import getSiteManager
4from Products.CMFCore.utils import getToolByName
5
6from quintagroup.gauth.utility import GAuthUtility
7from quintagroup.gauth.interfaces import IGAuthUtility
8
9logger = logging.getLogger('quintagroup.gauth')
10
11def registerGAuthUtility(context):
12    """ Register Google Authentication utility
13    """
14    if context.readDataFile('quintagrouop_gauth.txt') is None:
15        return
16
17    site = context.getSite() 
18    sm = getSiteManager(site)
19    gauth = GAuthUtility(site)
20    sm.registerUtility(component=gauth,
21                       provided=IGAuthUtility)
22    logger.log(logging.INFO, "Registered IGAuthUtility, bound it to the site.")
Note: See TracBrowser for help on using the repository browser.