Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.11.1 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

Connection LDAP failed !!

Bonjour,

J'essaye de me connecter avec mes utilisateurs de mon AD sur l'interface web OCS.

Tout d'abord, le ping passe entre mon serveur AD et mon serveur OCS.

je modifie le fichier AUTH/auth.php comme ceci :

 $affich_method='HTML';
 //$list_methode=array(0=>"local.php");
 $list_methode=array(0=>"ldap.php");

Ensuite je modifie le fichier identity/identity.php comme ceci :


//$list_methode=array(0=>"local.php");
$list_methode=array(0=>"ldap.php");


Enfin voici mes paramètres dans l'interface web d'OCS "Configuration LDAP" :

CONEX_LDAP_SERVEUR : serveurAD.paris.rc.fr
CONEX_ROOT_DN : (rien)
CONEX_ROOT_PW : (rien)
CONEX_LDAP_PORT : 389
CONEX_DN_BASE_LDAP : OU=Informatique et Multimedia,OU=Ville,OU=Paris,DC=paris,DC=rc,DC=fr
CONEX_LOGIN_FIELD : sAMAccountName
CONEX_LDAP_PROTOCOL_VERSION : 3 (je ne sais pas trop quoi mettre)
CONEX_LDAP_CHECK_FIELD1_NAME : Departement
CONEX_LDAP_CHECK_FIELD1_VALUE : Section/Réseaux et Internet
CONEX_LDAP_CHECK_FIELD1_ROLE : SuperAdmin

Voici le code d'erreur que j'obtient dans /etc/httpd/ logs/error_log :

[Wed May 06 11:11:51 2015] [error] [client 10.1.201.140] PHP Warning:  ldap_search(): Search: Operations error in /usr/share/ocsinventory-reports/ocsreports/backend/AUTH/methode/ldap.php on line 71, referer: http://ocs.paris.rc.fr/ocsreports/
[Wed May 06 11:11:51 2015] [error] [client 10.1.201.140] PHP Warning:  ldap_count_entries() expects parameter 2 to be resource, boolean given in /usr/share/ocsinventory-reports/ocsreports/backend/AUTH/methode/ldap.php on line 72, referer: http://ocs.paris.rc.fr/ocsreports/
[Wed May 06 11:11:51 2015] [error] [client 10.1.201.140] PHP Warning:  ldap_get_entries() expects parameter 2 to be resource, boolean given in /usr/share/ocsinventory-reports/ocsreports/backend/AUTH/methode/ldap.php on line 73, referer: http://ocs.paris.rc.fr/ocsreports/


Je vais donc dans le fichier en question, AUTH/methode/ldap.php :

 

69 $ds = ldap_connection ();

70 $filtre = "(".LOGIN_FIELD."={$login})";

71 $sr = ldap_search($ds,DN_BASE_LDAP,$filtre,$attributs);

72 $lce = ldap_count_entries($ds,$sr);

73 $info = ldap_get_entries($ds,$sr);

74 ldap_close($ds);

75 $info["nbResultats"] = $lce;

Mes erreurs se situaient aux lignes 71,72,73 ...
Comment vérifier les paramètres $ds, $ds,DN_BASE_LDAP,$filtre,$attributs ??

Merci

 

in OCS Inventory NG server for Unix by (2k points)
edited by

2 Answers

0 votes
ton active directory est bien accessible en annonymous ?

tu as essayé de créer un user ocs avec un mot de passe et configurer les lignes CONEX_ROOT_DN et CONEX_ROOT_PW ?

pour voir si ça marche mieux
by (160 points)
0 votes
en faite il fallait mettre le port : 3268
by (2k points)
 
Powered by Question2Answer
...