Connexion active directory
je veux connecter a l'active directory avec windows 10
pour collecter les informations sur les personnels connectées mais je ne connais pas comment je fais cette connexion
29 réponses
La question porte sur la connexion à un Active Directory avec Windows 10 afin de collecter des informations sur les personnels connectés, via LDAP et des requêtes vers l’annuaire. Plusieurs réponses suggèrent d’utiliser des scripts ou du code PHP pour établir une liaison LDAP (ldap_connect, ldap_bind) et interroger le domaine (base DN, filtres, résultats sous forme de tableau). En parallèle, certains préconisent de se former avant d’exécuter des scripts sensibles et de consulter des ressources explicatives sur le fonctionnement LDAP et Active Directory. En outre, certaines interventions posent la question d’alternatives ou de méthodes sans LDAP, sans parvenir à une recommandation unique valable pour tous les environnements actuels.
-
page3:
<?php //LDAP Bind paramters, need to be a normal AD User account. $ldap_password = 'Stage2020'; $ldap_username = '***@***'; $ldap_connection = ldap_connect("onas.local"); if (FALSE === $ldap_connection){ // Uh-oh, something is wrong... echo 'Unable to connect to the ldap server'; } // We have to set this option for the version of Active Directory we are using. ldap_set_option($ldap_connection, LDAP_OPT_PROTOCOL_VERSION, 3) or die('Unable to set LDAP protocol version'); ldap_set_option($ldap_connection, LDAP_OPT_REFERRALS, 0); // We need this for doing an LDAP search. if (TRUE === ldap_bind($ldap_connection, $ldap_username, $ldap_password)){ //Your domains DN to query $ldap_base_dn = 'DC=onas,DC=local'; //Get standard users and contacts $search_filter ='CN=3363'; //Connect to LDAP $result = ldap_search($ldap_connection, $ldap_base_dn, $search_filter); if (FALSE !== $result){ $entries = ldap_get_entries($ldap_connection, $result); // Uncomment the below if you want to write all entries to debug somethingthing //var_dump($entries); //Create a table to display the output echo '<h2>AD User Results</h2></br>'; echo '<table border = "1"><tr bgcolor="#cccccc"><td>Username</td><td>Last Name</td><td>First Name</td><td>Company</td><td>Department</td><td>Office Phone</td><td>Fax</td><td>Mobile</td><td>DDI</td><td>E-Mail Address</td><td>Home Phone</td></tr>'; //For each account returned by the search for ($x=0; $x<$entries['count']; $x++){ // //Retrieve values from Active Directory // //Windows Usernaame $LDAP_samaccountname = ""; if (!empty($entries[$x]['samaccountname'][0])) { $LDAP_samaccountname = $entries[$x]['samaccountname'][0]; if ($LDAP_samaccountname == "NULL"){ $LDAP_samaccountname= ""; } } else { //#There is no samaccountname s0 assume this is an AD contact record so generate a unique username $LDAP_uSNCreated = $entries[$x]['usncreated'][0]; $LDAP_samaccountname= "CONTACT_" . $LDAP_uSNCreated; } //Last Name $LDAP_LastName = ""; if (!empty($entries[$x]['sn'][0])) { $LDAP_LastName = $entries[$x]['sn'][0]; if ($LDAP_LastName == "NULL"){ $LDAP_LastName = ""; } } //First Name $LDAP_FirstName = ""; if (!empty($entries[$x]['givenname'][0])) { $LDAP_FirstName = $entries[$x]['givenname'][0]; if ($LDAP_FirstName == "NULL"){ $LDAP_FirstName = ""; } } //Company $LDAP_CompanyName = ""; if (!empty($entries[$x]['company'][0])) { $LDAP_CompanyName = $entries[$x]['company'][0]; if ($LDAP_CompanyName == "NULL"){ $LDAP_CompanyName = ""; } } //Department $LDAP_Department = ""; if (!empty($entries[$x]['department'][0])) { $LDAP_Department = $entries[$x]['department'][0]; if ($LDAP_Department == "NULL"){ $LDAP_Department = ""; } } //Job Title $LDAP_JobTitle = ""; if (!empty($entries[$x]['title'][0])) { $LDAP_JobTitle = $entries[$x]['title'][0]; if ($LDAP_JobTitle == "NULL"){ $LDAP_JobTitle = ""; } } //IPPhone $LDAP_OfficePhone = ""; if (!empty($entries[$x]['ipphone'][0])) { $LDAP_OfficePhone = $entries[$x]['ipphone'][0]; if ($LDAP_OfficePhone == "NULL"){ $LDAP_OfficePhone = ""; } } //FAX Number $LDAP_OfficeFax = ""; if (!empty($entries[$x]['facsimiletelephonenumber'][0])) { $LDAP_OfficeFax = $entries[$x]['facsimiletelephonenumber'][0]; if ($LDAP_OfficeFax == "NULL"){ $LDAP_OfficeFax = ""; } } //Mobile Number $LDAP_CellPhone = ""; if (!empty($entries[$x]['mobile'][0])) { $LDAP_CellPhone = $entries[$x]['mobile'][0]; if ($LDAP_CellPhone == "NULL"){ $LDAP_CellPhone = ""; } } //Telephone Number $LDAP_DDI = ""; if (!empty($entries[$x]['telephonenumber'][0])) { $LDAP_DDI = $entries[$x]['telephonenumber'][0]; if ($LDAP_DDI == "NULL"){ $LDAP_DDI = ""; } } //Email address $LDAP_InternetAddress = ""; if (!empty($entries[$x]['mail'][0])) { $LDAP_InternetAddress = $entries[$x]['mail'][0]; if ($LDAP_InternetAddress == "NULL"){ $LDAP_InternetAddress = ""; } } //Home phone $LDAP_HomePhone = ""; if (!empty($entries[$x]['homephone'][0])) { $LDAP_HomePhone = $entries[$x]['homephone'][0]; if ($LDAP_HomePhone == "NULL"){ $LDAP_HomePhone = ""; } } echo "<tr><td><strong>" . $LDAP_samaccountname ."</strong></td><td>" .$LDAP_LastName."</td><td>".$LDAP_FirstName."</td><td>".$LDAP_CompanyName."</td><td>".$LDAP_Department."</td><td>".$LDAP_OfficePhone."</td><td>".$LDAP_OfficeFax."</td><td>".$LDAP_CellPhone."</td><td>".$LDAP_DDI."</td><td>".$LDAP_InternetAddress."</td><td>".$LDAP_HomePhone."</td></tr>"; } //END for loop } //END FALSE !== $result ldap_unbind($ldap_connection); // Clean up after ourselves. echo("</table>"); //close the table } //END ldap_bind ?> -
page2:
<?php $user = !empty($_POST['user']) ? $_POST['user'] : NULL; ?> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> * { box-sizing: border-box; } body { margin: 0; } /* Style the header */ .header { background-color:white; padding: 50px; text-align: center; } /* Style the top navigation bar */ .topnav { overflow: hidden; background-color: white; } /* Create three unequal columns that floats next to each other */ .column { float: left; padding: 70px; } /* Left and right column */ .column.side { width: 25%; } /* Middle column */ .column.middle { width: 50%; background-color:rgb(0, 100, 255); } /* Clear floats after the columns */ .row:after { content: ""; display: table; clear: both; } /* Style the footer */ .footer { background-color: white; padding: 40px; text-align: center; } /* Responsive layout - makes the three columns stack on top of each other instead of next to each other */ @media screen and (max-width: 600px) { .column.side, .column.middle { width: 100%; } } </style> </head> <body> <div class="header"> </div> <div class="topnav"> </div> <div class="row"> <div class="column side"> </div> <div class="column middle"> <center> <br> <form action="" method="POST"> <strong><im><h3><label for="username" >Username: </label><input id="username" type="text" name="user" Size="20" /> <br><br><br><?php echo"  ";echo"  ";echo"  ";echo"  ";echo"  ";echo"  ";echo"  "; echo"  ";echo"  ";?> <input type="submit" name="submit" value="Submit" /> </form> </div> <div class="column side"> </div> </div> <div class="footer"> </div> </body> </html> -
page1:
<?php //Affichage erreurs php error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); // Constantes et autres variables define('USER','******'); define('PASSWORD','******'); $message=''; $url_page2 = "page2.php"; // variable à modifier selon tes besoins // récupération propre des variables (POST/GET/SESSION...) AVANT de les utiliser $user = !empty($_POST['user']) ? trim($_POST['user']) : NULL; $password = !empty($_POST['password']) ? trim($_POST['password']) : NULL; //traitement du submit if(isset($_POST['submit'])){ if(!$user || !$password){ $message='veuillez indiquer vos identifiants !'; }elseif($user != USER || $password != PASSWORD ){ $message='Vos identifiants sont faux. Merci de les vérifier'; }elseif($user == USER || $password = PASSWORD){ // tout est ok... donc : header('location:'.$url_page2); exit; // toujours mettre un exit après une redirection } } ?> <!DOCTYPE html> <html lang="fr"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> * { box-sizing: border-box; } body { margin: 0; } /* Style the header */ .header { background-color:white; padding: 50px; text-align: center; } /* Style the top navigation bar */ .topnav { overflow: hidden; background-color: white; } /* Create three unequal columns that floats next to each other */ .column { float: left; padding: 70px; } /* Left and right column */ .column.side { width: 25%; } /* Middle column */ .column.middle { width: 50%; background-color:rgb(0, 100, 255); } /* Clear floats after the columns */ .row:after { content: ""; display: table; clear: both; } /* Style the footer */ .footer { background-color: white; padding: 40px; text-align: center; } /* Responsive layout - makes the three columns stack on top of each other instead of next to each other */ @media screen and (max-width: 600px) { .column.side, .column.middle { width: 100%; } } #btn_submit{ padding-left:60px; } #div_error{ margin-left:80px; } </style> </head> <body> <div class="header"> </div> <div class="topnav"> </div> <div class="row"> <div class="column side"> </div> <div class="column middle"> <center> <h1 style="border:3px solid #ff6347;">welcome</h1> <br> <form action="" method="post"> <strong><im><h3> <label for="username" >Username: </label> <input id="user" type="text" name="user" Size="20" value="<?php echo htmlspecialchars($user);?>"/> <br><br> <label for="password" >Password: </label> <input id="user" type="text" name="password" Size="20" value="<?php echo htmlspecialchars($password);?>"/> <br><br> <input type="submit" id="btn_submit" name="submit" value="Submit" /> </form> <?php if(!empty($message)){ echo '<div id="div_error">'; echo '<p style="color:red;">'.$message.'</p>'; echo '</div>'; } ?> </div> <div class="column side"> </div> <div class="footer"> </div> </div> </body> </html> -
ca marche merci
-
je veux faire la liaison entre les 3 pages je veux :
dans la page 2
losque j'entre Username la page 3 permet d'afficher les informations sur cet Username -
page3:
<?php //LDAP Bind paramters, need to be a normal AD User account. $ldap_password = '*****'; $ldap_username = '******l'; $ldap_connection = ldap_connect("******"); if (FALSE === $ldap_connection){ // Uh-oh, something is wrong... echo 'Unable to connect to the ldap server'; } // We have to set this option for the version of Active Directory we are using. ldap_set_option($ldap_connection, LDAP_OPT_PROTOCOL_VERSION, 3) or die('Unable to set LDAP protocol version'); ldap_set_option($ldap_connection, LDAP_OPT_REFERRALS, 0); // We need this for doing an LDAP search. if (TRUE === ldap_bind($ldap_connection, $ldap_username, $ldap_password)){ //Your domains DN to query $ldap_base_dn = 'DC=*****,DC=******'; //Get standard users and contacts $search_filter ='CN=3363'; //Connect to LDAP $result = ldap_search($ldap_connection, $ldap_base_dn, $search_filter); if (FALSE !== $result){ $entries = ldap_get_entries($ldap_connection, $result); // Uncomment the below if you want to write all entries to debug somethingthing //var_dump($entries); //Create a table to display the output echo '<h2>AD User Results</h2></br>'; echo '<table border = "1"><tr bgcolor="#cccccc"><td>Username</td><td>Last Name</td><td>First Name</td><td>Company</td><td>Department</td><td>Office Phone</td><td>Fax</td><td>Mobile</td><td>DDI</td><td>E-Mail Address</td><td>Home Phone</td></tr>'; //For each account returned by the search for ($x=0; $x<$entries['count']; $x++){ // //Retrieve values from Active Directory // //Windows Usernaame $LDAP_samaccountname = ""; if (!empty($entries[$x]['samaccountname'][0])) { $LDAP_samaccountname = $entries[$x]['samaccountname'][0]; if ($LDAP_samaccountname == "NULL"){ $LDAP_samaccountname= ""; } } else { //#There is no samaccountname s0 assume this is an AD contact record so generate a unique username $LDAP_uSNCreated = $entries[$x]['usncreated'][0]; $LDAP_samaccountname= "CONTACT_" . $LDAP_uSNCreated; } //Last Name $LDAP_LastName = ""; if (!empty($entries[$x]['sn'][0])) { $LDAP_LastName = $entries[$x]['sn'][0]; if ($LDAP_LastName == "NULL"){ $LDAP_LastName = ""; } } //First Name $LDAP_FirstName = ""; if (!empty($entries[$x]['givenname'][0])) { $LDAP_FirstName = $entries[$x]['givenname'][0]; if ($LDAP_FirstName == "NULL"){ $LDAP_FirstName = ""; } } //Company $LDAP_CompanyName = ""; if (!empty($entries[$x]['company'][0])) { $LDAP_CompanyName = $entries[$x]['company'][0]; if ($LDAP_CompanyName == "NULL"){ $LDAP_CompanyName = ""; } } //Department $LDAP_Department = ""; if (!empty($entries[$x]['department'][0])) { $LDAP_Department = $entries[$x]['department'][0]; if ($LDAP_Department == "NULL"){ $LDAP_Department = ""; } } //Job Title $LDAP_JobTitle = ""; if (!empty($entries[$x]['title'][0])) { $LDAP_JobTitle = $entries[$x]['title'][0]; if ($LDAP_JobTitle == "NULL"){ $LDAP_JobTitle = ""; } } //IPPhone $LDAP_OfficePhone = ""; if (!empty($entries[$x]['ipphone'][0])) { $LDAP_OfficePhone = $entries[$x]['ipphone'][0]; if ($LDAP_OfficePhone == "NULL"){ $LDAP_OfficePhone = ""; } } //FAX Number $LDAP_OfficeFax = ""; if (!empty($entries[$x]['facsimiletelephonenumber'][0])) { $LDAP_OfficeFax = $entries[$x]['facsimiletelephonenumber'][0]; if ($LDAP_OfficeFax == "NULL"){ $LDAP_OfficeFax = ""; } } //Mobile Number $LDAP_CellPhone = ""; if (!empty($entries[$x]['mobile'][0])) { $LDAP_CellPhone = $entries[$x]['mobile'][0]; if ($LDAP_CellPhone == "NULL"){ $LDAP_CellPhone = ""; } } //Telephone Number $LDAP_DDI = ""; if (!empty($entries[$x]['telephonenumber'][0])) { $LDAP_DDI = $entries[$x]['telephonenumber'][0]; if ($LDAP_DDI == "NULL"){ $LDAP_DDI = ""; } } //Email address $LDAP_InternetAddress = ""; if (!empty($entries[$x]['mail'][0])) { $LDAP_InternetAddress = $entries[$x]['mail'][0]; if ($LDAP_InternetAddress == "NULL"){ $LDAP_InternetAddress = ""; } } //Home phone $LDAP_HomePhone = ""; if (!empty($entries[$x]['homephone'][0])) { $LDAP_HomePhone = $entries[$x]['homephone'][0]; if ($LDAP_HomePhone == "NULL"){ $LDAP_HomePhone = ""; } } echo "<tr><td><strong>" . $LDAP_samaccountname ."</strong></td><td>" .$LDAP_LastName."</td><td>".$LDAP_FirstName."</td><td>".$LDAP_CompanyName."</td><td>".$LDAP_Department."</td><td>".$LDAP_OfficePhone."</td><td>".$LDAP_OfficeFax."</td><td>".$LDAP_CellPhone."</td><td>".$LDAP_DDI."</td><td>".$LDAP_InternetAddress."</td><td>".$LDAP_HomePhone."</td></tr>"; } //END for loop } //END FALSE !== $result ldap_unbind($ldap_connection); // Clean up after ourselves. echo("</table>"); //close the table } //END ldap_bind ?> -
page2:
<?php $user = !empty($_POST['user']) ? $_POST['user'] : NULL; ?> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> * { box-sizing: border-box; } body { margin: 0; } /* Style the header */ .header { background-color:white; padding: 50px; text-align: center; } /* Style the top navigation bar */ .topnav { overflow: hidden; background-color: white; } /* Create three unequal columns that floats next to each other */ .column { float: left; padding: 70px; } /* Left and right column */ .column.side { width: 25%; } /* Middle column */ .column.middle { width: 50%; background-color:rgb(0, 100, 255); } /* Clear floats after the columns */ .row:after { content: ""; display: table; clear: both; } /* Style the footer */ .footer { background-color: white; padding: 40px; text-align: center; } /* Responsive layout - makes the three columns stack on top of each other instead of next to each other */ @media screen and (max-width: 600px) { .column.side, .column.middle { width: 100%; } } </style> </head> <body> <div class="header"> </div> <div class="topnav"> </div> <div class="row"> <div class="column side"> </div> <div class="column middle"> <center> <br> <form action="" method="POST"> <strong><im><h3><label for="username" >Username: </label><input id="username" type="text" name="user" Size="20" /> <br><br><br><?php echo"  ";echo"  ";echo"  ";echo"  ";echo"  ";echo"  ";echo"  "; echo"  ";echo"  ";?> <input type="submit" name="submit" value="Submit" /> </form> </div> <div class="column side"> </div> </div> <div class="footer"> </div> </body> </html> -
<?php //Affichage erreurs php error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); // Constantes et autres variables define('USER','*****'); define('PASSWORD','******'); $message=''; $url_page2 = "page2.php"; // variable à modifier selon tes besoins // récupération propre des variables (POST/GET/SESSION...) AVANT de les utiliser $user = !empty($_POST['user']) ? trim($_POST['user']) : NULL; $password = !empty($_POST['password']) ? trim($_POST['password']) : NULL; //traitement du submit if(isset($_POST['submit'])){ if(!$user || !$password){ $message='veuillez indiquer vos identifiants !'; }elseif($user != USER || $password != PASSWORD ){ $message='Vos identifiants sont faux. Merci de les vérifier'; }elseif($user == USER || $password = PASSWORD){ // tout est ok... donc : header('location:'.$url_page2); exit; // toujours mettre un exit après une redirection } } ?> <!DOCTYPE html> <html lang="fr"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> * { box-sizing: border-box; } body { margin: 0; } /* Style the header */ .header { background-color:white; padding: 50px; text-align: center; } /* Style the top navigation bar */ .topnav { overflow: hidden; background-color: white; } /* Create three unequal columns that floats next to each other */ .column { float: left; padding: 70px; } /* Left and right column */ .column.side { width: 25%; } /* Middle column */ .column.middle { width: 50%; background-color:rgb(0, 100, 255); } /* Clear floats after the columns */ .row:after { content: ""; display: table; clear: both; } /* Style the footer */ .footer { background-color: white; padding: 40px; text-align: center; } /* Responsive layout - makes the three columns stack on top of each other instead of next to each other */ @media screen and (max-width: 600px) { .column.side, .column.middle { width: 100%; } } #btn_submit{ padding-left:60px; } #div_error{ margin-left:80px; } </style> </head> <body> <div class="header"> </div> <div class="topnav"> </div> <div class="row"> <div class="column side"> </div> <div class="column middle"> <center> <h1 style="border:3px solid #ff6347;">welcome</h1> <br> <form action="" method="post"> <strong><im><h3> <label for="username" >Username: </label> <input id="user" type="text" name="user" Size="20" value="<?php echo htmlspecialchars($user);?>"/> <br><br> <label for="password" >Password: </label> <input id="user" type="text" name="password" Size="20" value="<?php echo htmlspecialchars($password);?>"/> <br><br> <input type="submit" id="btn_submit" name="submit" value="Submit" /> </form> <?php if(!empty($message)){ echo '<div id="div_error">'; echo '<p style="color:red;">'.$message.'</p>'; echo '</div>'; } ?> </div> <div class="column side"> </div> <div class="footer"> </div> </div> </body> </html> -
cbon je résous ce probleme
-
comment je peux changer cette partie de code pour faire ca
//Get standard users and contacts $search_filter ='(|(objectCategory=person)(objectCategory=contact))'; //Connect to LDAP $result = ldap_search($ldap_connection, $ldap_base_dn, $search_filter);-
-
Contributeur@yg_besi oui, que sais-tu de l'utilisateur que tu veux filtrer? tu as son Username, comme il s'affiche dans la première colonne de la table?
si oui, peut-être ainsi:$search_filter = "sAMAccountName=".$userName;
-
-
ok je prends tous les informations
-
Le PC qui héberge ton code php se trouve sur le même réseau ?oui il se trouve sur un reseau privé
Les informations utilisées dans ton script PHP sont les bonnes ?non parce que la société ne donne pas des informations
As tu demandé aux admin de ton réseau ?non
quelle les infomations que j'ai besoin pour connecter a l' AD -
est si AD fonctionne avec un autre serveur?
-
est-il possible de se connecter a l'active directory sans utiliser le serveur ldap?
-
Modérateurben.... non.....
Ldap... ça fonctionne avec un AD
Active Directory est un annuaire au format Microsoft qui a pour objectif de stocker des données qualifiées d’objets.
Quant au LDAP, il s’agit d’un protocole d’accès aux informations. L’outil permet d’échanger des renseignements entre les annuaires compatibles au protocole.
-
-
Connexion...
( ! ) Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server in C:\wamp64\www\connex.php on line 16
Call Stack
# Time Memory Function Location
1 0.0003 408000 {main}( ) ...\connex.php:0
2 0.0003 408352 ldap_bind ( ) ...\connex.php:16
Déconnexion...-
ModérateurDonc ton erreur se situe dans le bin.
$ds=ldap_connect($server); if ($ds==1) { // on s'authentifie en tant que super-utilisateur, ici, ldap_admin $ldapbind=ldap_bind($ds,$rootdn,$rootpw) or die (ldap_err2str( ldap_errno($ds) ); // verify binding if ($ldapbind) { // Ici les opérations à effectuer echo "Déconnexion...<br>"; ldap_close($ds); } else { echo "Erreur BIND !"; } } else { echo "Impossible de se connecter au serveur LDAP"; }
Et au cas où ... voici un exemple propre de code que tu peux utiliser
https://www.php.net/manual/fr/function.ldap-search.php#112191
A noter que les erreurs que tu nous montres jusqu'à maintenant semblent plus liés à des soucis de paramétrages/identifiants qu'à des soucis de code php....
Hors.. nous ne sommes pas admin de ton réseau et ne pourrons pas t'aider à trouver les identifiants à utiliser !
-
-
else { echo"ldap-error:".ldap_errno()."<br>\n"; echo "Impossible de se connecter au serveur LDAP"; } -
Connexion...
( ! ) Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server in C:\wamp64\www\connex.php on line 16
Call Stack
# Time Memory Function Location
1 0.0274 407832 {main}( ) ...\connex.php:0
2 0.0516 408184 ldap_bind ( ) ...\connex.php:16
Déconnexion... -
else { echo"ldap-error:".ldap_err2str(ldap_errno())."<br>\n"; echo "Impossible de se connecter au serveur LDAP"; } -
Modérateuril ne faut pas hésiter à regarder la documentation (surtout que je t'ai donné le lien...)
https://www.php.net/manual/fr/function.ldap-errno.php
https://www.php.net/manual/fr/function.ldap-err2str.php
Et pas conséquent, corriger le codeldap_err2str( ldap_errno() );
parecho ldap_err2str( ldap_errno($ds) );
-
<?php $server = "localhost"; $port = "389"; $racine = "o=inet, c=home"; $rootdn = "cn=Stage,o=inet, c=home"; $rootpw = "Stage2020"; echo "Connexion...<br>"; $ds=ldap_connect($server); if ($ds==1) { // on s'authentifie en tant que super-utilisateur, ici, ldap_admin $r=ldap_bind($ds,$rootdn,$rootpw); // Ici les opérations à effectuer echo "Déconnexion...<br>"; ldap_close($ds); } else { echo "Impossible de se connecter au serveur LDAP"; } ?>-
-
@jordane45( ! ) Warning: ldap_errno() expects exactly 1 parameter, 0 given in C:\wamp64\www\connex.php on line 25
Call Stack
# Time Memory Function Location
1 0.1061 408528 {main}( ) ...\connex.php:0
2 0.1585 408560 ldap_errno ( ) ...\connex.php:25 -
-
@jordane45Connexion...
( ! ) Warning: ldap_errno() expects exactly 1 parameter, 0 given in C:\wamp64\www\connex.php on line 25
Call Stack
# Time Memory Function Location
1 0.1376 408704 {main}( ) ...\connex.php:0
2 0.1578 408736 ldap_errno ( ) ...\connex.php:25
ldap-error:Success
Impossible de se connecter au serveur LDAP -
Contributeur@yossraqu'en penses-tu? le message n'est-il pas clair?
-
- 1
- 2