From ee030234017debba64d0ad0f822728e0dcab6cad Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 5 Jul 2012 07:24:59 +0000 Subject: [PATCH] allow to use default host, but give a dn and pw --- phpgwapi/inc/class.ldap.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.ldap.inc.php b/phpgwapi/inc/class.ldap.inc.php index 6ba80dacb4..e35495b3b5 100644 --- a/phpgwapi/inc/class.ldap.inc.php +++ b/phpgwapi/inc/class.ldap.inc.php @@ -91,8 +91,8 @@ class ldap * only once per session. * * @param $host='' ldap host, default $GLOBALS['egw_info']['server']['ldap_host'] - * @param $dn='' ldap dn, default $GLOBALS['egw_info']['server']['ldap_root_dn'] (only if $host default is used!) - * @param $passwd='' ldap pw, default $GLOBALS['egw_info']['server']['ldap_root_pw'] (only if $host default is used!) + * @param $dn='' ldap dn, default $GLOBALS['egw_info']['server']['ldap_root_dn'] + * @param $passwd='' ldap pw, default $GLOBALS['egw_info']['server']['ldap_root_pw'] * @return resource|boolean resource from ldap_connect() or false on error * @throws egw_exception_assertion_failed 'LDAP support unavailable!' (no ldap extension) */ @@ -114,6 +114,9 @@ class ldap if (empty($host)) { $host = $GLOBALS['egw_info']['server']['ldap_host']; + } + if (empty($dn)) + { $dn = $GLOBALS['egw_info']['server']['ldap_root_dn']; $passwd = $GLOBALS['egw_info']['server']['ldap_root_pw']; }