当前位置: 首页>>代码示例>>PHP>>正文


PHP Ldap::Search方法代码示例

本文整理汇总了PHP中Ldap::Search方法的典型用法代码示例。如果您正苦于以下问题:PHP Ldap::Search方法的具体用法?PHP Ldap::Search怎么用?PHP Ldap::Search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ldap的用法示例。


在下文中一共展示了Ldap::Search方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cacti_ldap_search_dn

function cacti_ldap_search_dn($username, $dn = "", $host = "", $port = "", $port_ssl = "", $version = "", $encryption = "", $referrals = "", $mode = "", $search_base = "", $search_filter = "", $specific_dn = "", $specific_password = "")
{
    $ldap = new Ldap();
    if (!empty($username)) {
        $ldap->username = $username;
    }
    if (!empty($dn)) {
        $ldap->dn = $dn;
    }
    if (!empty($host)) {
        $ldap->host = $host;
    }
    if (!empty($port)) {
        $ldap->port = $port;
    }
    if (!empty($port_ssl)) {
        $ldap->port_ssl = $port_ssl;
    }
    if (!empty($version)) {
        $ldap->version = $version;
    }
    if (!empty($encryption)) {
        $ldap->encryption = $encryption;
    }
    if (!empty($referrals)) {
        $ldap->referrals = $referrals;
    }
    if (!empty($mode)) {
        $ldap->mode = $mode;
    }
    if (!empty($search_base)) {
        $ldap->search_base = $search_base;
    }
    if (!empty($search_filter)) {
        $ldap->search_filter = $search_filter;
    }
    if (!empty($specific_dn)) {
        $ldap->specific_dn = $specific_dn;
    }
    if (!empty($specific_password)) {
        $ldap->specific_password = $specific_password;
    }
    return $ldap->Search();
}
开发者ID:teddywen,项目名称:cacti,代码行数:44,代码来源:ldap.php

示例2: domains_ldap_search_dn

function domains_ldap_search_dn($username, $realm)
{
    $ldap = new Ldap();
    if (!empty($username)) {
        $ldap->username = $username;
    }
    $ld = db_fetch_row_prepared('SELECT * FROM user_domains_ldap WHERE domain_id = ?', array($realm - 1000));
    if (sizeof($ld)) {
        if (!empty($ld['dn'])) {
            $ldap->dn = $ld['dn'];
        }
        if (!empty($ld['server'])) {
            $ldap->host = $ld['server'];
        }
        if (!empty($ld['port'])) {
            $ldap->port = $ld['port'];
        }
        if (!empty($ld['port_ssl'])) {
            $ldap->port_ssl = $ld['port_ssl'];
        }
        if (!empty($ld['proto_version'])) {
            $ldap->version = $ld['proto_version'];
        }
        if (!empty($ld['encryption'])) {
            $ldap->encryption = $ld['encryption'];
        }
        if (!empty($ld['referrals'])) {
            $ldap->referrals = $ld['referrals'];
        }
        if (!empty($ld['mode'])) {
            $ldap->group_require = $ld['mode'];
        }
        if (!empty($ld['search_base'])) {
            $ldap->group_dn = $ld['search_base'];
        }
        if (!empty($ld['search_filter'])) {
            $ldap->group_attrib = $ld['search_filter'];
        }
        if (!empty($ld['specific_dn'])) {
            $ldap->group_member_type = $ld['specific_dn'];
        }
        if (!empty($ld['specific_password'])) {
            $ldap->group_member_type = $ld['specific_password'];
        }
        return $ldap->Search();
    } else {
        return false;
    }
}
开发者ID:MrWnn,项目名称:cacti,代码行数:49,代码来源:auth_login.php


注:本文中的Ldap::Search方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。