Code

Updated schema check
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 May 2010 14:15:15 +0000 (14:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 May 2010 14:15:15 +0000 (14:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18776 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_configRegistry.inc

index ac9ba95628680c3f04419f6fcd80ba6c475c83cc..048af50c76f44fc08cabbf40ad26ce69366ece00 100644 (file)
@@ -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){