Back to index

plone3  3.1.7
Functions
plone.app.openid.setuphandlers Namespace Reference

Functions

def hasOpenIdPlugin
def createOpenIdPlugin
def activatePlugin
def addLoginPortlet
def importVarious

Function Documentation

def plone.app.openid.setuphandlers.activatePlugin (   portal,
  out,
  plugin 
)

Definition at line 23 of file setuphandlers.py.

00023 
00024 def activatePlugin(portal, out, plugin):
00025     acl=getToolByName(portal, "acl_users")
00026     plugin=getattr(acl, plugin)
00027     interfaces=plugin.listInterfaces()
00028 
00029     activate=[]
00030 
00031     for info in acl.plugins.listPluginTypeInfo():
00032         interface=info["interface"]
00033         interface_name=info["id"]
00034         if plugin.testImplements(interface):
00035             activate.append(interface_name)
00036             print >>out, "Activating interface %s for plugin %s" % \
00037                     (interface_name, info["title"])
00038 
00039     plugin.manage_activateInterfaces(activate)
00040 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 41 of file setuphandlers.py.

00041 
00042 def addLoginPortlet(portal, out):
00043     leftColumn = getUtility(IPortletManager, name=u'plone.leftcolumn', context=portal)
00044     left = getMultiAdapter((portal, leftColumn,), IPortletAssignmentMapping, context=portal)
00045     if u'openid-login' not in left:
00046         print >>out, "Adding OpenID login portlet to the left column"
00047         left[u'openid-login'] = LoginAssignment()
00048 

Here is the caller graph for this function:

Definition at line 16 of file setuphandlers.py.

00016 
00017 def createOpenIdPlugin(portal, out):
00018     print >>out, "Adding an OpenId plugin"
00019     acl=getToolByName(portal, "acl_users")
00020     acl.manage_addProduct["plone.openid"].addOpenIdPlugin(
00021             id="openid", title="OpenId authentication plugin")
00022 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 11 of file setuphandlers.py.

00011 
00012 def hasOpenIdPlugin(portal):
00013     pas_info=PASInfoView(portal, None)
00014     return pas_info.hasOpenIDdExtractor()
00015 

Here is the caller graph for this function:

Definition at line 49 of file setuphandlers.py.

00049 
00050 def importVarious(context):
00051     # Only run step if a flag file is present (e.g. not an extension profile)
00052     if context.readDataFile('openid-pas.txt') is None:
00053         return
00054 
00055     site = context.getSite()
00056     out = StringIO()
00057     if not hasOpenIdPlugin(site):
00058         createOpenIdPlugin(site, out)
00059         activatePlugin(site, out, "openid")
00060 
00061     addLoginPortlet(site, out)
00062 

Here is the call graph for this function: