本文整理汇总了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;
}
}