/** * 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>"; }
/** * 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>"; }