diff --git a/include/class_ldap.inc b/include/class_ldap.inc
index e191657f304f15345b4b32ae25d18adfb621023b..0e1e909b5282c3e4e6ae12e96847863947321076 100644 (file)
--- a/include/class_ldap.inc
+++ b/include/class_ldap.inc
Currently used codes:
, => CO
\2C => CO
+ \22 => TO
+ \" => TO
+ \+ => PL
( => OB
) => CB
/ => SL */
function convert($dn)
{
if (SPECIALS_OVERRIDE == TRUE){
- $tmp= preg_replace(array("/\\\\,/", "/\\\\2C/", "/\(/", "/\)/", "/\//"),
- array("\001CO", "\001CO", "\001OB", "\001CB", "\001SL"),
+ $tmp= preg_replace(array("/\\\\,/", "/\\\\2C/", "/\(/", "/\)/", "/\//", "/\\\\22/", '/\\\\"/', "/\\\\3D/", "/\\\\2B/", '/\\\\+/'),
+ array("\001CO", "\001CO", "\001OB", "\001CB", "\001SL", "\001TO", "\001TO", "\001GL", "\001PL", "\001PL"),
$dn);
return (preg_replace('/,\s+/', ',', $tmp));
} else {
function fix($dn)
{
if (SPECIALS_OVERRIDE == TRUE){
- return (preg_replace(array("/\001CO/", "/\001OB/", "/\001CB/", "/\001SL/"),
- array("\,", "(", ")", "/"),
+ return (preg_replace(array("/\001CO/", "/\001OB/", "/\001CB/", "/\001SL/", "/\001TO/", "/\001PL/", "/\001GL/"),
+ array("\,", "(", ")", "/", '\"', "\+", "="),
$dn));
} else {
return ($dn);
}
+ /* Function to fix problematic characters in DN's that are used for search
+ requests. I.e. member=.... */
+ function prepare4filter($dn)
+ {
+ return normalizeLdap(preg_replace('/\\\\/', '\\\\\\', @LDAP::fix($dn)));
+ }
+
+
function connect()
{
$this->hascon=false;
}
if($this->error != "Success"){
- /* Some error occured */
+ /* Some error occurred */
print "---------------------------------------------";
print $this->get_error()."<br>";
print $sourcedn."<br>";
/* Assemble_entry */
if ($tag != ""){
$na['objectClass']= array($ocname, "gosaAdministrativeUnitTag");
+ $na["gosaUnitTag"]= $tag;
} else {
$na['objectClass']= array($ocname);
}