From 5626283bb127a35d29176dc5b48698af52d83848 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 27 May 2010 14:15:15 +0000 Subject: [PATCH] Updated schema check git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18776 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_configRegistry.inc | 36 ++++++++++++++++------ 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/gosa-core/include/class_configRegistry.inc b/gosa-core/include/class_configRegistry.inc index ac9ba9562..048af50c7 100644 --- a/gosa-core/include/class_configRegistry.inc +++ b/gosa-core/include/class_configRegistry.inc @@ -56,10 +56,33 @@ class configRegistry{ } + function validateSchemata($force = FALSE, $disableIncompatiblePlugins = FALSE) { - // We can check the schemata only with a valid LDAP connection - if(empty($this->config->current['CONFIG'])){ + // Read objectClasses from ldap + if(!count($this->objectClasses)){ + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->config->current['BASE']); + $this->setObjectClasses($ldap->get_objectclasses()); + } + + return($this->_validateSchemata($force, $disableIncompatiblePlugins)); + } + + function setObjectClasses($ocs) + { + $this->objectClasses = $ocs; + } + + function getSchemaResults() + { + return($this->detectedSchemaIssues); + } + + function _validateSchemata($force = FALSE, $disableIncompatiblePlugins = FALSE) + { + // We cannot check without readable schema info + if(!count($this->objectClasses)){ return(TRUE); } @@ -74,13 +97,6 @@ class configRegistry{ // Clear last results $this->pluginsDeactivated = array(); - // Read objectClasses from ldap - if(!count($this->objectClasses)){ - $ldap = $this->config->get_ldap_link(); - $ldap->cd($this->config->current['BASE']); - $this->objectClasses = $ldap->get_objectclasses(); - } - // Collect required schema infos $this->pluginRequirements = array('ldapSchema' => array()); $this->categoryToClass = array(); @@ -203,6 +219,8 @@ class configRegistry{ $this->properties = array(); $this->mapByName = array(); + if(!$this->config) return; + // Search for config flags defined in the config file (TAB section) foreach($this->config->data['TABS'] as $tabname => $tabdefs){ foreach($tabdefs as $info){ -- 2.30.2