當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Ldap::Authenticate方法代碼示例

本文整理匯總了PHP中Ldap::Authenticate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Ldap::Authenticate方法的具體用法?PHP Ldap::Authenticate怎麽用?PHP Ldap::Authenticate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Ldap的用法示例。


在下文中一共展示了Ldap::Authenticate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: cacti_ldap_auth

function cacti_ldap_auth($username, $password = "", $dn = "", $host = "", $port = "", $port_ssl = "", $version = "", $encryption = "", $referrals = "", $group_require = "", $group_dn = "", $group_attrib = "", $group_member_type = "")
{
    $ldap = new Ldap();
    if (!empty($username)) {
        $ldap->username = $username;
    }
    if (!empty($password)) {
        $ldap->password = $password;
    }
    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($group_require)) {
        $ldap->group_require = $group_require;
    }
    if (!empty($group_dn)) {
        $ldap->group_dn = $group_dn;
    }
    if (!empty($group_attrib)) {
        $ldap->group_attrib = $group_attrib;
    }
    if (!empty($group_member_type)) {
        $ldap->group_member_type = $group_member_type;
    }
    return $ldap->Authenticate();
}
開發者ID:teddywen,項目名稱:cacti,代碼行數:44,代碼來源:ldap.php

示例2: domains_ldap_auth

function domains_ldap_auth($username, $password = '', $dn = '', $realm)
{
    $ldap = new Ldap();
    if (!empty($username)) {
        $ldap->username = $username;
    }
    if (!empty($password)) {
        $ldap->password = $password;
    }
    if (!empty($dn)) {
        $ldap->dn = $dn;
    }
    $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['group_require'])) {
            $ldap->group_require = $ld['group_require'];
        }
        if (!empty($ld['group_dn'])) {
            $ldap->group_dn = $ld['group_dn'];
        }
        if (!empty($ld['group_attrib'])) {
            $ldap->group_attrib = $ld['group_attrib'];
        }
        if (!empty($ld['group_member_type'])) {
            $ldap->group_member_type = $ld['group_member_type'];
        }
        return $ldap->Authenticate();
    } else {
        return false;
    }
}
開發者ID:MrWnn,項目名稱:cacti,代碼行數:52,代碼來源:auth_login.php


注:本文中的Ldap::Authenticate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。