From: ebullient Date: Thu, 12 Aug 2004 01:16:28 +0000 (+0000) Subject: add ldap test if ldap is in use X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7562c55bc66c6bc766145051dde1faf8a504fbbb;p=squirrelmail.git add ldap test if ldap is in use git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7887 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/configtest.php b/src/configtest.php index a0ff7de4..0990f320 100644 --- a/src/configtest.php +++ b/src/configtest.php @@ -334,6 +334,47 @@ if($addrbook_dsn || $prefs_dsn || $addrbook_global_dsn) { } else { echo $IND."not using database functionality.
\n"; } + +// LDAP DB tests +echo "Checking LDAP functions...
\n"; +if( empty($ldap_server) ) { + echo $IND."not using LDAP functionality.
\n"; +} else { + if ( !function_exists(ldap_connect) ) { + do_err('Required LDAP support is not available.'); + } else { + echo "$IND LDAP support present.
\n"; + foreach ( $ldap_server as $param ) { + + $linkid = ldap_connect($param['host'], (empty($param['port']) ? 389 : $param['port']) ); + + if ( $linkid ) { + echo "$IND LDAP connect to ".$param['host']." successful: ".$linkid."
\n"; + + if ( !empty($param['protocol']) && + !ldap_set_option($linkid, LDAP_OPT_PROTOCOL_VERSION, $param['protocol']) ) { + do_err('Unable to set LDAP protocol'); + } + + if ( empty($param['binddn']) ) { + $bind = ldap_bind($linkid); + } else { + $bind = ldap_bind($param['binddn'], $param['bindpw']); + } + + if ( $bind ) { + echo "$IND LDAP Bind Successful
"; + } else { + do_err('Unable to Bind to LDAP Server'); + } + + ldap_close($linkid); + } else { + do_err('Connection to LDAP failed'); + } + } + } +} ?>

Congratulations, your SquirrelMail setup looks fine to me!