summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 117d489)
raw | patch | inline | side by side (parent: 117d489)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 21 Sep 2010 07:00:00 +0000 (07:00 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 21 Sep 2010 07:00:00 +0000 (07:00 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19777 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_ldap.inc | patch | blob | history | |
gosa-core/include/functions.inc | patch | blob | history |
index f955eb09a6ab56b5429d0b6fd759330ad6f19351..5c8bac1fb6b49a56af1c027932cf56f6ea8edc80 100644 (file)
LDAP::$characterMapRegFrom = array("/\001CO/", "/\001OB/", "/\001CB/", "/\001SL/", "/\001DQ/");
LDAP::$characterMapRegTo = array("\,", "(", ")", "/", '\"');
- if(LDAP::$characterMap == NULL){
+ if(LDAP::$characterMap === NULL){
LDAP::$characterMap = detectLdapSpecialCharHandling();
// Check if character-detection was successfull, if it wasn't use a fallback.
- if(LDAP::$characterMap){
+ if(LDAP::$characterMap !== NULL){
LDAP::$characterMapRegFrom = array();
LDAP::$characterMapRegTo = array();
foreach(LDAP::$characterMap as $from => $to){
LDAP::$characterMapRegFrom[] = "/{$from}/";
LDAP::$characterMapRegTo[] = "/{$to}/";
}
+ }else{
+ // To avoid querying a hundred times without any success, stop here.
+ LDAP::$characterMap = array();
}
}
if (SPECIALS_OVERRIDE == TRUE){
// Update the conversion instruction set.
- if(LDAP::$characterMap == NULL) LDAP::updateSpecialCharHandling();
+ if(LDAP::$characterMap === NULL) LDAP::updateSpecialCharHandling();
return (preg_replace(LDAP::$characterMapRegFrom,LDAP::$characterMapRegTo,$dn));
} else {
index 9e0219e57c5a5821e8cafb62bdcad0b2d8f2157e..1b707a6ca01945ac443c5a79d38be109323ff592 100644 (file)
$obj['objectClass'] = array('top','organization');
$obj['o'] = $name;
$obj['description'] = 'GOsa character encoding test-object.';
- ldap_add($ldapCID, $oDN, $obj);
+ if(!@ldap_add($ldapCID, $oDN, $obj)){
+ trigger_error("GOsa couldn't detect the special character handling used by your ldap!");
+ return(NULL);
+ }
}
// Read the character-handling detection entry from the ldap.
"(&(o=".$filterName.")(objectClass=organization))",
array('dn','o'));
$cnt = ldap_count_entries($ldapCID, $res);
- if($cnt != 1){
+ if($cnt != 1 || !$res){
trigger_error("GOsa couldn't detect the special character handling used by your ldap!");
return(NULL);
}else{