示例#1
0
def display(inst, basedn, log, args):

    users = nsUserAccounts(inst, basedn)
    groups = Groups(inst, basedn)

    schema_type = "rfc2307"
    try:
        mo_plugin = MemberOfPlugin(inst)
        if mo_plugin.status():
            schema_type = "rfc2307bis"
    except:
        schema_type = "unknown - likely access denied to memberof plugin config"

    # Get required information
    print(
        DISPLAY_TEMPLATE.format(
            ldap_uri=inst.ldapuri,
            ldap_dns_uri=basedn_to_ldap_dns_uri(basedn),
            basedn=basedn,
            schema_type=schema_type,
            user_basedn=users._basedn,
            user_filter=users._get_objectclass_filter(),
            user_id_filter=users._get_selector_filter('<PARAM>'),
            group_basedn=groups._basedn,
            group_filter=groups._get_objectclass_filter(),
            group_id_filter=groups._get_selector_filter('<PARAM>'),
            uuid_attr='nsUniqueId',
            user_rdn=users._filterattrs[0],
            group_rdn=groups._filterattrs[0],
            group_member='member',
        ))

    # Print required information to log for test purpose
    log.debug(
        DISPLAY_TEMPLATE.format(
            ldap_uri=inst.ldapuri,
            ldap_dns_uri=basedn_to_ldap_dns_uri(basedn),
            basedn=basedn,
            schema_type=schema_type,
            user_basedn=users._basedn,
            user_filter=users._get_objectclass_filter(),
            user_id_filter=users._get_selector_filter('<PARAM>'),
            group_basedn=groups._basedn,
            group_filter=groups._get_objectclass_filter(),
            group_id_filter=groups._get_selector_filter('<PARAM>'),
            uuid_attr='nsUniqueId',
            user_rdn=users._filterattrs[0],
            group_rdn=groups._filterattrs[0],
            group_member='member',
        ))
示例#2
0
def ldap_conf(inst, basedn, log, args):
    # Print a customised ldap.conf or ldaprc
    print(
        LDAP_CONF_TEMPLATE.format(
            basedn=basedn,
            ldap_uri=inst.ldapuri,
            ldap_dns_uri=basedn_to_ldap_dns_uri(basedn),
        ))

    # Print a customised ldap.conf to log for test purpose
    log.debug(
        LDAP_CONF_TEMPLATE.format(
            basedn=basedn,
            ldap_uri=inst.ldapuri,
            ldap_dns_uri=basedn_to_ldap_dns_uri(basedn),
        ))