Last change
on this file since 2609 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
|
Rev | Line | |
---|
[2609] | 1 | import logging |
---|
| 2 | |
---|
| 3 | from zope.component import getSiteManager |
---|
| 4 | from Products.CMFCore.utils import getToolByName |
---|
| 5 | |
---|
| 6 | from quintagroup.gauth.utility import GAuthUtility |
---|
| 7 | from quintagroup.gauth.interfaces import IGAuthUtility |
---|
| 8 | |
---|
| 9 | logger = logging.getLogger('quintagroup.gauth') |
---|
| 10 | |
---|
| 11 | def 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.