vendredi 23 février 2018

How can I fetch data from active directory(Windows) in laravel 5.4?

$ldap_con = ldap_connect("xxx.com",80);

$ldap_dn = "cn=read-only-administrator,dc=xxx,dc=com";

$ldap_ps = "YYY";
ldap_set_option($ldap_con, LDAP_OPT_PROTOCOL_VERSION, 3);
if (ldap_bind($ldap_con, $ldap_dn, $ldap_ps)):
    echo 'Ldap binding successful';

   /*@Getting data START */
   $filter = "(uid=user)";
   $results = ldap_search($ldap_con, "dc=xxx,dc=com", $filter);
   $search_result = ldap_get_entries($ldap_con, $results);
  /*@Getting data ENDS */

else:
   echo 'Ldap binding not successful';
endif;

Here's the code i've tried so far, Kindly someone update me regarding this.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2GCTrx8
via IFTTT

Aucun commentaire:

Enregistrer un commentaire