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


PHP adLDAP::get_last_error方法代碼示例

本文整理匯總了PHP中adLDAP::get_last_error方法的典型用法代碼示例。如果您正苦於以下問題:PHP adLDAP::get_last_error方法的具體用法?PHP adLDAP::get_last_error怎麽用?PHP adLDAP::get_last_error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在adLDAP的用法示例。


在下文中一共展示了adLDAP::get_last_error方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: selectUserFromLdap

 function selectUserFromLdap($username, $password)
 {
     try {
         $adldap = new adLDAP();
         $adldap->set_account_suffix('@vejleidraetsefterskole.local');
         $adldap->set_domain_controllers(array('mail.vih.dk'));
     } catch (adLDAPException $e) {
         echo $e;
         exit;
     }
     $authUser = $adldap->authenticate($username, $password);
     if ($authUser === true) {
         return new k_AuthenticatedUser($username);
     } else {
         throw new Exception('User authentication unsuccessful. ' . $adldap->get_last_error());
     }
 }
開發者ID:vih,項目名稱:intranet.vih.dk,代碼行數:17,代碼來源:Login.php

示例2: NestedTree

 $ldap_connection = false;
 //Build tree of folders
 $tree = new NestedTree($pre . 'nested_tree', 'id', 'parent_id', 'title');
 /* LDAP connection */
 if ($debug_ldap == 1) {
     $dbg_ldap = fopen("../files/ldap.debug.txt", "w");
     //create temp file
 }
 if (isset($_SESSION['settings']['ldap_mode']) && $_SESSION['settings']['ldap_mode'] == 1 && $username != "admin") {
     if ($debug_ldap == 1) {
         fputs($dbg_ldap, "Get all ldap params : \n" . 'base_dn : ' . $_SESSION['settings']['ldap_domain_dn'] . "\n" . 'account_suffix : ' . $_SESSION['settings']['ldap_suffix'] . "\n" . 'domain_controllers : ' . $_SESSION['settings']['ldap_domain_controler'] . "\n" . 'use_ssl : ' . $_SESSION['settings']['ldap_ssl'] . "\n" . 'use_tls : ' . $_SESSION['settings']['ldap_tls'] . "\n*********\n\n");
     }
     require_once "../includes/libraries/adLDAP/adLDAP.php";
     $adldap = new adLDAP(array('base_dn' => $_SESSION['settings']['ldap_domain_dn'], 'account_suffix' => $_SESSION['settings']['ldap_suffix'], 'domain_controllers' => array($_SESSION['settings']['ldap_domain_controler']), 'use_ssl' => $_SESSION['settings']['ldap_ssl'], 'use_tls' => $_SESSION['settings']['ldap_tls']));
     if ($debug_ldap == 1) {
         fputs($dbg_ldap, "Create new adldap object : " . $adldap->get_last_error() . "\n\n\n");
         //Debug
     }
     //authenticate the user
     if ($adldap->authenticate($username, $password_clear)) {
         $ldap_connection = true;
     } else {
         $ldap_connection = false;
     }
     if ($debug_ldap == 1) {
         fputs($dbg_ldap, "After authenticate : " . $adldap->get_last_error() . "\n\n\n" . "ldap status : " . $ldap_connection . "\n\n\n");
         //Debug
     }
 }
 //Check if user exists in cpassman
 $sql = "SELECT * FROM " . $pre . "users WHERE login = '" . $username . "'";
開發者ID:sleepy909,項目名稱:cpassman,代碼行數:31,代碼來源:main.queries.php


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