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


PHP AuthLdap::getUserByDn方法代碼示例

本文整理匯總了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>";
 }
開發者ID:geldarr,項目名稱:hack-space,代碼行數:34,代碼來源:user.class.php

示例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] . "&nbsp;:</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] . "&nbsp;:</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>";
 }
開發者ID:ryukansent,項目名稱:Thesis-SideB,代碼行數:35,代碼來源:user.class.php


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