Code

Updated schemaCheck in configRegistry
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 May 2010 15:02:09 +0000 (15:02 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 May 2010 15:02:09 +0000 (15:02 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18630 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/html/main.php
gosa-core/include/class_configRegistry.inc

index a47271342e85c1b995ebe9dd7336e93b371a9a8d..83f0a7e3d90255bbdcc12dac55a6bb4e51588473 100644 (file)
@@ -65,7 +65,7 @@ if ($_SERVER['REMOTE_ADDR'] != $ui->ip){
 $config= session::global_get('config');
 $config->check_and_reload();
 $config->configRegistry->reload();
-$config->configRegistry->validateSchemata(TRUE, TRUE);
+$config->configRegistry->validateSchemata($force=FALSE,$disableIncompatiblePlugins=TRUE,$errorMessages= TRUE);
 
 /* Enable compressed output */
 if ($config->get_cfg_value("core","sendCompressedOutput") == "true"){
index a362e525eaca36855dd2bfc3464cd976b36a42ed..6bf66a195988f402c2fdede98b8d5e897695d81f 100644 (file)
@@ -20,6 +20,8 @@ class configRegistry{
 
     public $objectClasses = array();
 
+    public $schemaCheckFinished = FALSE;
+
     function __construct($config)
     {
         $this->config = &$config;
@@ -45,13 +47,16 @@ class configRegistry{
     }
 
 
-    function validateSchemata($disableIncompatiblePlugins = FALSE,$displayMessage = FALSE)
+    function validateSchemata($force = FALSE, $disableIncompatiblePlugins = FALSE,$displayMessage = FALSE)
     {
         // We can check the schemata only with a valid LDAP connection
         if(empty($this->config->current['CONFIG'])){
             return(TRUE); 
         }
 
+        // Don't do things twice unless forced
+        if($this->schemaCheckFinished && !$force) return; 
+
         // Read objectClasses from ldap
         if(!count($this->objectClasses)){
             $ldap = $this->config->get_ldap_link();
@@ -91,6 +96,7 @@ class configRegistry{
                 }
             }
         }
+        $this->schemaCheckFinished =TRUE;
     }
 
     function ocVersionMatch($required, $installed)