index 625d052cd48603c2b7c9dd737ebe3cd268818a5b..642908017b553e236a8ca00710cc2dc60961ec5f 100644 (file)
}
+ /* Function to fix problematic characters in DN's that are used for search
+ requests. I.e. member=.... */
+ static function prepare4filter($dn)
+ {
+ return normalizeLdap(preg_replace('/\\\\/', '\\\\\\', LDAP::fix($dn)));
+ }
+
+
function connect()
{
$this->hascon=false;
/* Bail out, if we've nothing to do... */
if ($ocname == ""){
- msg_dialog::display(_("Internal error"), sprintf(_("Cannot automatically create subtrees with RDN '%s': no object class found"),$type), ERROR_DIALOG);
- display_error_page();
+ msg_dialog::display(_("Internal error"), sprintf(_("Cannot automatically create subtrees with RDN '%s': no object class found"),$type), FATAL_ERROR_DIALOG);
+ exit();
}
/* Assemble_entry */
$na["dc"]= $param;
break;
default:
- msg_dialog::display(_("Internal error"), sprintf(_("Cannot automatically create subtrees with RDN '%s': not supported"),$type), ERROR_DIALOG);
- display_error_page();
+ msg_dialog::display(_("Internal error"), sprintf(_("Cannot automatically create subtrees with RDN '%s': not supported"),$type), FATAL_ERROR_DIALOG);
+ exit();
}
}
return($objectclasses);
}
}
+
+ /* Return the cached results. */
+ if(class_available('session') && session::is_set("LDAP_CACHE::get_objectclasses")){
+ $objectclasses = session::get("LDAP_CACHE::get_objectclasses");
+ return($objectclasses);
+ }
# Get base to look for schema
$sr = @ldap_read ($this->cid, NULL, "objectClass=*", array("subschemaSubentry"));
}
}
+ if(class_available("session")){
+ session::set("LDAP_CACHE::get_objectclasses",$objectclasses);
+ }
return $objectclasses;
}