ID: 51019 Updated by: [email protected] Reported By: bruce dot bahlmann at lsiowa dot org -Status: Open +Status: Bogus Bug Type: LDAP related Operating System: Windows Vista Business PHP Version: 5.2.12 New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2010-02-11 15:55:51] bruce dot bahlmann at lsiowa dot org Description: ------------ There seems to be an issue with ldap_add when the cn and corresponding dn, include a forward slash (/). NOTE, ldap in this case is an active directory (AD) server. Ldap_add works fine when the cn doesn't include a forward slash, however, when the text does include it, I cannot get the ldap_add to work. I've tried escaping the characters (using backslash) with no success. I've also tried equivalent characters, but same result - the ldap add doesn't run. Interestingly, if one uses LDAP explorer, the entries which have forward slashes actually show a backward slash before the forward slash. If I use those tools, I can manually add ldap entries with a forward slash, just can't do it with php ldap library. I've attached the ldap_add calling script which provides a wrapper for creating a group on the ldap server. Reproduce code: --------------- --- >From manual page: function.ldap-add#Parameters --- function ldapcreateGroup($hash, $dn) { // Maintain handle on LDAP connection to limit unnecessary ldapOpen if (!isset($GLOBALS["static_ad"])) { @ldapOpen(); } // Add these fields to ensure proper group be added $hash['objectClass'][0] = "top"; $hash['objectClass'][1] ="group"; $hash['groupType']=(int)'-2147483646'; $hash['objectcategory'] = 'CN=Group,CN=Schema,CN=Configuration,'.sdn; $hash["sAMAccountName"] = $hash['cn']; unset($hash['distinguishedname']); #print_r($hash); @ldap_add($GLOBALS["static_ad"],$dn,$hash); if(@ldap_error($GLOBALS["static_ad"]) == "Success") { return 1; } else { return 0; } } Expected result: ---------------- Short of not using forward slashes in the cn, which would take some time to change in all the various entries in AD, is there some possible way to get ldap_add to add these? Or, is there some special preparations required to perform on the cn field that would allow me to use conventional ldap_add to correctly insert this entry? Actual result: -------------- none ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=51019&edit=1
