From 03e90e80fd2293c9daa2e8407623dd8c73e4b620 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 18 Jun 2007 08:03:09 +0000 Subject: [PATCH] Updated get_objectclasses git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6611 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_ldap.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 126aabbad..f3b1adb9e 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -772,6 +772,7 @@ class LDAP{ } $this->cd($cdn); $this->add($na); + show_ldap_error($this->get_error(), sprintf(_("Creating subtree '%s' failed."),$cdn)); if (!preg_match('/success/i', $this->error)){ return FALSE; @@ -1253,7 +1254,15 @@ class LDAP{ function get_objectclasses() { $objectclasses = array(); - + global $config; + + /* Only read schema if it is allowed */ + if(isset($config) && preg_match("/config/i",get_class($config))){ + if(!isset($config->data['MAIN']['SCHEMA_CHECK']) || !preg_match("/true/i",$config->data['MAIN']['SCHEMA_CHECK'])){ + return($objectclasses); + } + } + # Get base to look for schema $sr = @ldap_read ($this->cid, NULL, "objectClass=*", array("subschemaSubentry")); if(!$sr){ -- 2.30.2