I am using Netware 6 as an LDAP server and running Apache & PHP 4.2.2 on a
linux Redhat 7.2.
For some reason when I do a wildcard (ou=*) LDAP_SEARCH I only get part of
the directory.

I then did a LDAP_SEARCH on the CNs in the OUs that the LDAP_SEARCH did not
find, and the
LDAP_SEARCH found all the CNs.  Very Strange????

Does anyone have any ideas why this is happening?

also....
I tried Terrence Miao's LDAPExplorer and his PHP script only shows part of
the tree. ( exactly like mine).
I also tried a java LDAP explorer and I could see the entire tree.

Here is the code.
Our LDAP server has two OUs under the O and only one is displayed.
<?php
// Connecting to LDAP server
$ds=ldap_connect("Novell server");
echo "connect result is ".$ds."<p>";

if ($ds) {
    echo "Binding ...";
    $r=ldap_bind($ds);     // "anonymous" bind, typically
    echo "Bind result is ".$r."<p>";

    echo "Searching for (ou=*) ...";
    // Search Organization Unit entry
    $sr=ldap_search($ds,"o=OurOrg", "ou=*" );
    echo "Search result is ".$sr."<p>";
    echo "Number of entires returned is ".ldap_count_entries
($ds,$sr)."<p>";
    echo "Getting entries ...<p>";
    $info = ldap_get_entries($ds, $sr);
    echo "Data for ".$info["count"]." items returned:<p>";
    for($i=0;$i<$info["count"];$i++)
   {
      echo $info[$i]["dn"];
      $parts=explode(",",$info[$i]["dn"]);
      $nds=explode("=",$parts[0]);
      echo "<br>nds: ".$nds[1]."<br>";
}

    echo "Closing connection";
    ldap_close($ds);

} else {
    echo "<h4>Unable to connect to LDAP server</h4>";
}
?>

Thanks!



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to