From 95ac595f2472f40f2ca424bc5d86c27fa384a4f4 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 21 May 2010 15:02:09 +0000 Subject: [PATCH] Updated schemaCheck in configRegistry git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18630 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/html/main.php | 2 +- gosa-core/include/class_configRegistry.inc | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gosa-core/html/main.php b/gosa-core/html/main.php index a47271342..83f0a7e3d 100644 --- a/gosa-core/html/main.php +++ b/gosa-core/html/main.php @@ -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"){ diff --git a/gosa-core/include/class_configRegistry.inc b/gosa-core/include/class_configRegistry.inc index a362e525e..6bf66a195 100644 --- a/gosa-core/include/class_configRegistry.inc +++ b/gosa-core/include/class_configRegistry.inc @@ -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) -- 2.30.2