diff --git a/core/constant_inc.php b/core/constant_inc.php index 95481367e8..23ea533bc8 100644 --- a/core/constant_inc.php +++ b/core/constant_inc.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: constant_inc.php,v 1.67 2007-07-11 03:18:13 vboctor Exp $ + # $Id: constant_inc.php,v 1.68 2007-07-21 13:38:26 prichards Exp $ # -------------------------------------------------------- ### CONSTANTS ### @@ -256,7 +256,8 @@ define( 'ERROR_LDAP_SERVER_CONNECT_FAILED', 1401 ); define( 'ERROR_LDAP_UPDATE_FAILED', 1402 ); define( 'ERROR_LDAP_USER_NOT_FOUND', 1403 ); - + define( 'ERROR_LDAP_EXTENSION_NOT_LOADED', 1404 ); + # ERROR_CATEGORY_* define( 'ERROR_CATEGORY_DUPLICATE', 1500 ); define( 'ERROR_CATEGORY_NO_ACTION', 1501 ); diff --git a/core/ldap_api.php b/core/ldap_api.php index cc63b06038..d5e400a47d 100644 --- a/core/ldap_api.php +++ b/core/ldap_api.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: ldap_api.php,v 1.19 2006-04-22 01:52:14 vboctor Exp $ + # $Id: ldap_api.php,v 1.20 2007-07-21 13:38:26 prichards Exp $ # -------------------------------------------------------- ########################################################################### @@ -19,6 +19,10 @@ function ldap_connect_bind( $p_binddn = '', $p_password = '' ) { $t_ldap_server = config_get( 'ldap_server' ); $t_ldap_port = config_get( 'ldap_port' ); + if (!extension_loaded('ldap')) { + trigger_error(ERROR_LDAP_EXTENSION_NOT_LOADED,ERROR); + } + $t_ds = @ldap_connect ( $t_ldap_server, $t_ldap_port ); if ( $t_ds > 0 ) { $t_protocol_version = config_get( 'ldap_protocol_version' ); diff --git a/lang/strings_english.txt b/lang/strings_english.txt index 9e33497487..2ce9bcc93f 100644 --- a/lang/strings_english.txt +++ b/lang/strings_english.txt @@ -11,11 +11,11 @@ ########################################################################### # English strings for Mantis (source language for translations) # ------------------------------------------------- - # $Revision: 1.303 $ - # $Author: giallu $ - # $Date: 2007-07-16 08:23:42 $ + # $Revision: 1.304 $ + # $Author: prichards $ + # $Date: 2007-07-21 13:38:30 $ # - # $Id: strings_english.txt,v 1.303 2007-07-16 08:23:42 giallu Exp $ + # $Id: strings_english.txt,v 1.304 2007-07-21 13:38:30 prichards Exp $ ########################################################################### ?> @@ -240,6 +240,7 @@ $MANTIS_ERROR[ERROR_LDAP_AUTH_FAILED] = 'LDAP Authentication Failed'; $MANTIS_ERROR[ERROR_LDAP_SERVER_CONNECT_FAILED] = 'LDAP Server Connection Failed'; $MANTIS_ERROR[ERROR_LDAP_UPDATE_FAILED] = 'LDAP Record Update has failed.'; $MANTIS_ERROR[ERROR_LDAP_USER_NOT_FOUND] = 'LDAP User Record Not Found.'; +$MANTIS_ERROR[ERROR_LDAP_EXTENSION_NOT_LOADED] = 'LDAP Extension Not Loaded.'; $MANTIS_ERROR[ERROR_DB_CONNECT_FAILED] = 'Database connection failed. Error received from database was #%d: %s'; $MANTIS_ERROR[ERROR_DB_QUERY_FAILED] = 'Database query failed. Error received from database was #%d: %s for the query: %s'; $MANTIS_ERROR[ERROR_DB_SELECT_FAILED] = 'Database selection failed. Error received from database was #%d: %s';