本文整理汇总了PHP中AuthLdap::getUserByDn方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthLdap::getUserByDn方法的具体用法?PHP AuthLdap::getUserByDn怎么用?PHP AuthLdap::getUserByDn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuthLdap
的用法示例。
在下文中一共展示了AuthLdap::getUserByDn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showLdapDebug
/**
* Display information from LDAP server for user
**/
private function showLdapDebug()
{
if ($this->fields['authtype'] != Auth::LDAP) {
return false;
}
echo "<div class='spaced'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='4'>" . __('LDAP directory') . "</th></tr>";
echo "<tr class='tab_bg_2'><td>" . __('User DN') . "</td>";
echo "<td>" . $this->fields['user_dn'] . "</td></tr>\n";
if ($this->fields['user_dn']) {
echo "<tr class='tab_bg_2'><td>" . __('User information') . "</td><td>";
$config_ldap = new AuthLDAP();
$ds = false;
if ($config_ldap->getFromDB($this->fields['auths_id'])) {
$ds = $config_ldap->connect();
}
if ($ds) {
$info = AuthLdap::getUserByDn($ds, $this->fields['user_dn'], array('*', 'createTimeStamp', 'modifyTimestamp'));
if (is_array($info)) {
Html::printCleanArray($info);
} else {
_e('No item to display');
}
} else {
_e('Connection failed');
}
echo "</td></tr>\n";
}
echo "</table></div>";
}
示例2: showLdapDebug
/**
* Display information from LDAP server for user
**/
private function showLdapDebug()
{
global $LANG;
if ($this->fields['authtype'] != Auth::LDAP) {
return false;
}
echo "<div class='spaced'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='4'>" . $LANG['setup'][137] . ' - ' . $LANG['login'][2] . "</th></tr>";
echo "<tr class='tab_bg_2'><td>" . $LANG['ldap'][26] . " :</td>";
echo "<td>" . $this->fields['user_dn'] . "</td></tr>\n";
if ($this->fields['user_dn']) {
echo "<tr class='tab_bg_2'><td>" . $LANG['title'][13] . " :</td><td>";
$config_ldap = new AuthLDAP();
$ds = false;
if ($config_ldap->getFromDB($this->fields['auths_id'])) {
$ds = $config_ldap->connect();
}
if ($ds) {
$info = AuthLdap::getUserByDn($ds, $this->fields['user_dn'], array('*', 'createTimeStamp', 'modifyTimestamp'));
if (is_array($info)) {
printCleanArray($info);
} else {
echo $LANG['stats'][2];
}
} else {
echo $LANG['log'][41];
}
echo "</td></tr>\n";
}
echo "</table></div>";
}