From f77e984151ab893c44555b49338eb5ca70d8ead8 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 11 May 2010 05:42:22 +0000 Subject: [PATCH] Updated get_cfg_value method git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18308 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_config.inc | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/gosa-core/include/class_config.inc b/gosa-core/include/class_config.inc index 314867e2d..7715388dd 100644 --- a/gosa-core/include/class_config.inc +++ b/gosa-core/include/class_config.inc @@ -1033,28 +1033,26 @@ class config { * * */ - function get_cfg_value($class,$name, $default= "") + function get_cfg_value($class,$name, $default= NULL) { + // The default parameter is deprecated + if($default != NULL){ +# trigger_error("Third parameter 'default' is deprecated for function 'get_cfg_value'!"); + } + // Return the matching property value if it exists. if($this->configRegistry->propertyExists($class,$name)){ return($this->configRegistry->getPropertyValue($class,$name)); } - syslog(1, $name); + // Show a warning in the syslog if there is an undefined property requested. + syslog(1,"Unconfigured property: {$class}::{$name}"); + // Try to find the property in the config file directly. $name= strtoupper($name); - - /* Check if we have a current value for $name */ - if (isset($this->current[$name])){ - return ($this->current[$name]); - } - - /* Check if we have a global value for $name */ - if (isset($this->data["MAIN"][$name])){ - return ($this->data["MAIN"][$name]); - } - - return ($default); + if (isset($this->current[$name])) return ($this->current[$name]); + if (isset($this->data["MAIN"][$name])) return ($this->data["MAIN"][$name]); + return (""); } -- 2.30.2