Python IManagedLDAPPlugin Example

Introduction

The python imanagedldapplugin example is extracted from the most popular open source projects, you can refer to the following example for usage.

Programming language: Python

Namespace/package name: ploneappldapploneldapinterfaces

Example#1
File: util.pyProject: radekj/plone.app.ldap

def getLDAPPlugin():
    pas = getPAS()
    for plugin in pas.objectValues([PloneActiveDirectoryMultiPlugin.meta_type, PloneLDAPMultiPlugin.meta_type]):
        if IManagedLDAPPlugin.providedBy(plugin):
            return plugin

    raise KeyError

Example#2
File: util.pyProject: eleddy/plone.app.ldap

def lookupLDAPPlugin():
    """
    Return the ldap plugin, or None if it does not exist
    """
    pas=getPAS()
    for plugin in pas.objectValues([PloneActiveDirectoryMultiPlugin.meta_type,
                                    PloneLDAPMultiPlugin.meta_type]):
        if IManagedLDAPPlugin.providedBy(plugin):
            return plugin

    return None