Page 1 of 1

LDAP configuration help

Posted: 20 Jun 2022, 09:52
by timcat0931
I try to setup LDAP,but encountered an error, How to fix this?? Any help is greatly appreciated.

Site Information
MantisBT Version 2.25.4
Schema Version 211
PHP Version 8.1.6
Database Driver mysqli
Database Version, Description 10.4.24, 10.4.24-MariaDB
Windows Server Actice Directory 2012 R2
Mantis Language Chinese_traditional

config_inc.php

Code: Select all

$g_login_method = LDAP;
$g_ldap_server = 'ldap://dxg.local';
$g_ldap_use_starttls = OFF;
$g_ldap_tls_protocol_min = OFF;
$g_ldap_root_dn = 'dc=dxg,dc=local';
$g_ldap_organization = '';
$g_ldap_protocol_version = 3;
$g_ldap_network_timeout = 0;
$g_ldap_follow_referrals = OFF;
$g_ldap_bind_dn = 'CN=administrator,CN=Users,DC=dxg,DC=local';
$g_ldap_bind_passwd = 'password';
$g_ldap_realname_field = 'cn';
$g_use_ldap_realname = ON;
$g_use_ldap_email = ON;
$g_ldap_simulation_file_path = '';
php_error_log

Code: Select all

[20-Jun-2022 15:50:56 Asia/Taipei] Call to undefined function ldap_cache_user_data()
D:\xampp\htdocs\mantis\core\ldap_api.php: 204: - - - - ldap_get_field_from_username( <string>'timli', <string>'cn' )
D:\xampp\htdocs\mantis\core\ldap_api.php: 359: - - - - ldap_realname_from_username( <string>'timli' )
D:\xampp\htdocs\mantis\core\ldap_api.php: 277: - - - - ldap_authenticate_by_username( <string>'timli', <string>'password' )
D:\xampp\htdocs\mantis\core\authentication_api.php: 762: - - - - ldap_authenticate( <integer>35, <string>'password' )
D:\xampp\htdocs\mantis\core\authentication_api.php: 514: - - - - auth_does_password_match( <integer>35, <string>'password' )
D:\xampp\htdocs\mantis\login.php: 66: - - - - auth_attempt_login( <string>'timli', <string>'password', <boolean>false )
LDAP_Log

Code: Select all

2022-06-20 17:25 CST LDAP ldap_api.php:306 ldap_authenticate_by_username() Binding to LDAP server
2022-06-20 17:25 CST LDAP ldap_api.php:67 ldap_connect_bind() Checking syntax of LDAP server URI 'ldap://dxg.local'.
2022-06-20 17:25 CST LDAP ldap_api.php:76 ldap_connect_bind() LDAP server URI syntax check succeeded
2022-06-20 17:25 CST LDAP ldap_api.php:89 ldap_connect_bind() Setting LDAP protocol version to 3
2022-06-20 17:25 CST LDAP ldap_api.php:142 ldap_connect_bind() Attempting bind to ldap server as 'CN=administrator,CN=Users,DC=dxg,DC=local'
2022-06-20 17:25 CST LDAP ldap_api.php:155 ldap_connect_bind() Bind to ldap server successful
2022-06-20 17:25 CST LDAP ldap_api.php:310 ldap_authenticate_by_username() Searching for (&(sAMAccountName=timli))
2022-06-20 17:25 CST LDAP ldap_api.php:332 ldap_authenticate_by_username() Checking CN=李竹鑫,OU=3.資訊部-資訊組,OU=3.資訊部,OU=C.行政中心,OU=HQ,OU=DXG,DC=dxg,DC=local
2022-06-20 17:25 CST LDAP ldap_api.php:344 ldap_authenticate_by_username() Unbinding from LDAP server
2022-06-20 17:25 CST LDAP ldap_api.php:368 ldap_authenticate_by_username() User 'timli' authenticated
2022-06-20 17:25 CST LDAP ldap_api.php:306 ldap_authenticate_by_username() Binding to LDAP server
2022-06-20 17:25 CST LDAP ldap_api.php:67 ldap_connect_bind() Checking syntax of LDAP server URI 'ldap://dxg.local'.
2022-06-20 17:25 CST LDAP ldap_api.php:76 ldap_connect_bind() LDAP server URI syntax check succeeded
2022-06-20 17:25 CST LDAP ldap_api.php:89 ldap_connect_bind() Setting LDAP protocol version to 3
2022-06-20 17:25 CST LDAP ldap_api.php:142 ldap_connect_bind() Attempting bind to ldap server as 'CN=administrator,CN=Users,DC=dxg,DC=local'
2022-06-20 17:25 CST LDAP ldap_api.php:155 ldap_connect_bind() Bind to ldap server successful
2022-06-20 17:25 CST LDAP ldap_api.php:310 ldap_authenticate_by_username() Searching for (&(sAMAccountName=timli))
2022-06-20 17:25 CST LDAP ldap_api.php:332 ldap_authenticate_by_username() Checking CN=李竹鑫,OU=3.資訊部-資訊組,OU=3.資訊部,OU=C.行政中心,OU=HQ,OU=DXG,DC=dxg,DC=local
2022-06-20 17:25 CST LDAP ldap_api.php:344 ldap_authenticate_by_username() Unbinding from LDAP server
2022-06-20 17:25 CST LDAP ldap_api.php:249 ldap_get_field_from_username() Retrieving field 'cn' for 'timli'
Web Errorhttps://drive.google.com/file/d/1CgmGgN ... QmaIL/view

But there is an error in the above picture, change $g_login_method = MD5, an account will be automatically generated, and the timli account can be logged in normally
https://drive.google.com/file/d/1hCNHCt ... sp=sharing