本文整理匯總了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();
}
示例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;
}
}