ldap 모듈 인증을 위한 prefix 정보를 입력받도록 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5190 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-12-26 08:51:31 +00:00
parent 2caa8b02ac
commit 4056eff5f6
8 changed files with 23 additions and 10 deletions

View file

@ -31,8 +31,7 @@
/**
* @brief LDAP 연동하여 정보를 return하는 method
**/
function ldap_conn($user_id, $password, $ldap_userdn_suffix, $base_dn, $ldap_server, $ldap_port = 389) {
function ldap_conn($user_id, $password, $ldap_userdn_prefix, $ldap_userdn_suffix, $base_dn, $ldap_server, $ldap_port = 389) {
if(!function_exists('ldap_connect')) return new Object(-1,'ldap module is not exists');
$ds = @ldap_connect($ldap_server, $ldap_port);
@ -40,8 +39,7 @@
if(!ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) return new Object(-1,'fail to set option');
$userdn = $user_id.$ldap_userdn_suffix;
$userdn = $ldap_userdn_prefix.$user_id.$ldap_userdn_suffix;
if(!@ldap_bind($ds, $userdn, $password)) return new Object(-1,'fail to bind');
$ldap_sr = @ldap_search($ds, $base_dn, '(cn='.$user_id.')', array ('*'));