Amlioration gestion du LDAP

This commit is contained in:
Laurent Destailleur 2006-03-31 19:44:13 +00:00
parent e363b1697a
commit 4ecf372650
3 changed files with 14 additions and 4 deletions

View File

@ -406,7 +406,7 @@ DNAdmin=Administrator DN
LDAPPassword=administrator password
DNUser=Dolibarr users' DN
DNGroup=Dolibarr groups' DN
LDAPServerExample=Server address (ex: localhost, 127.0.0.1, 192.168.0.2)
LDAPServerExample=Server address (ex: localhost, 192.168.0.2, ldaps://ldap.example.com/)
#LDAPSuffixExample=Complete DN (ex: dc=company,dc=com)
DNAdminExample=Complete DN (ex: cn=adminldap,dc=society,dc=com)
LDAPPasswordExample=Admin password

View File

@ -406,7 +406,7 @@ DNAdmin=DN de l'administrateur
LDAPPassword=Mot de passe de l'administrateur
DNUser=DN des utilisateurs Dolibarr
DNGroup=DN des groupes Dolibarr
LDAPServerExample=Adresse du serveur (ex: localhost, 127.0.0.1, 192.168.0.2)
LDAPServerExample=Adresse du serveur (ex: localhost, 192.168.0.2, ldaps://ldap.example.com/)
#LDAPSuffixExample=DN complet (ex: dc=societe,dc=com)
DNAdminExample=DN complet (ex: cn=adminldap,dc=societe,dc=com)
LDAPPasswordExample=Mot de passe de l'administrateur

View File

@ -42,7 +42,17 @@ function dolibarr_ldap_connect()
{
global $conf;
$ldapconnect = ldap_connect($conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT);
if (ereg('^ldap',$conf->global->LDAP_SERVER_HOST))
{
// ex url: ldaps://ldap.example.com/
$ldapconnect = ldap_connect($conf->global->LDAP_SERVER_HOST);
}
else
{
// ex serveur: localhost
// ex port: 329
$ldapconnect = ldap_connect($conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT);
}
if ($ldapconnect)
{
@ -54,7 +64,7 @@ function dolibarr_ldap_connect()
/**
\brief bind au serveur ldap.
\brief Se connecte au serveur LDAP avec user et mot de passe
\param ds
\return bool
*/