当前位置: 首页>>代码示例>>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;未经允许,请勿转载。