0

我试图用我现有的 Active Directory 服务对 vTiger CRM 6.5 进行身份验证,但它不起作用。看起来这是从我的 AD 服务器得到响应,但没有去任何地方。使用正确的凭据后,页面将刷新,但是一旦您输入了错误的凭据,它就会显示 - “错误的用户名或密码”。我正在使用“ http://adldap.sourceforge.net/ ”进行 AD 身份验证。我的日志说 -

03/28/17 15:24:50,105 [632] DEBUG user - Entering Users() method ...
03/28/17 15:24:50,105 [632] DEBUG VT - Entering getColumnFields(Users) method ...
03/28/17 15:24:50,105 [632] DEBUG VT - in getColumnFields Users
03/28/17 15:24:50,105 [632] DEBUG VT - Prepared sql query being executed : SELECT tabid, name, ownedby FROM vtiger_tab
03/28/17 15:24:50,110 [632] DEBUG VT - Prepared sql query being executed : SELECT tabid, fieldname, fieldid, fieldlabel, columnname, tablename, uitype, typeofdata, presence
        FROM vtiger_field WHERE tabid in (?)
03/28/17 15:24:50,110 [632] DEBUG VT - Prepared sql query parameters : [29]
03/28/17 15:24:50,122 [632] DEBUG VT - Exiting getColumnFields method ...
03/28/17 15:24:50,122 [632] DEBUG user - Exiting Users() method ...
03/28/17 15:24:50,123 [632] DEBUG user - Using Active Directory authentication
03/28/17 15:24:51,361 [632] DEBUG VT - Prepared sql query being executed : SELECT id from vtiger_users where user_name=? AND deleted=0
03/28/17 15:24:51,361 [632] DEBUG VT - Prepared sql query parameters : [pritamkumar]
03/28/17 15:24:51,436 [632] DEBUG VT - Prepared sql query being executed : SELECT * FROM vtiger_tab
03/28/17 15:24:51,448 [632] DEBUG VT - Prepared sql query being executed : SELECT fieldname,modulename,tablename,entityidfield,entityidcolumn from vtiger_entityname
03/28/17 15:24:51,453 [632] DEBUG VT - Prepared sql query being executed : INSERT INTO vtiger_loginhistory (user_name, user_ip, logout_time, login_time, status) VALUES (?,?,?,?,?)
03/28/17 15:24:51,453 [632] DEBUG VT - Prepared sql query parameters : [pritamkumar,::1,0000-00-00 00:00:00,2017-03-28 15:24:51,Signed in]
03/28/17 15:24:51,818 [632] INFO VT - PearDatabase ->ADODB disconnect
03/28/17 15:24:52,438 [632] DEBUG VT - Login is required:#0 E:\xampp\htdocs\vtiger\includes\main\WebUI.php(186): Vtiger_WebUI->checkLogin(Object(Vtiger_Request))
#1 E:\xampp\htdocs\vtiger\index.php(18): Vtiger_WebUI->process(Object(Vtiger_Request))
#2 {main}
03/28/17 15:24:52,653 [632] INFO VT - PearDatabase ->ADODB disconnect
03/28/17 15:24:54,160 [632] INFO VT - PearDatabase ->ADODB disconnect
03/28/17 15:24:55,028 [632] INFO VT - PearDatabase ->ADODB disconnect
4

2 回答 2

1

要测试 adLDAP,请编写一个小的 php 脚本,而不是直接使用 vTiger CRM。只需在 adLDAP.php 所在的同一目录中创建 adldap_test.php 文件,其内容如下:

<?php

require_once(dirname(FILE) . '/adLDAP.php');

try {
    $adldap = new adLDAP();
} catch (adLDAPException $e) {
    echo $e;
    exit();
}
$authUser = $adldap->authenticate('user-to-authenticate', 'users-password');
if ($authUser == true) {
     echo "User authenticated successfully";
} else {
   // getLastError is not needed, but may be helpful for finding out why:
    echo "\n";
    echo $adldap->getLastError();
    echo "\n";

    echo "User authentication unsuccessful";
}

echo "\n";
$result=$adldap->user()->infoCollection('ldap', array("*"));
echo "User:\n";
echo $result->displayName;
echo "Mail:\n";
echo $result->mail;

?>

替换您要测试身份验证的用户的用户名和密码并执行它。它应该成功并输出用户名和邮件地址(如果可用)。希望这可以帮助您解决问题。

于 2017-03-29T10:14:45.743 回答
0

您必须在您的服务器上启用 php-ldap 扩展。请检查 adldap 项目要求 https://github.com/adldap/adLDAP/wiki/Apache-configuration

您可以使用以下链接在您的服务器上安装 ldap

xammp 上的 ldap 配置

在 Centos 6.3 中使用 php-ldap

即使我编辑了 php.ini 并且 php_ldap.dll 在正确的位置,也无法启用 PHP LDAP?

于 2017-04-18T09:24:46.420 回答