From 72108fa8fe45d2d12d204dba329b99d1578a2aab Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 24 Jul 2008 09:47:28 +0000 Subject: [PATCH] Added function to get cfg values in order "current", "global", "default". git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11974 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_config.inc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gosa-core/include/class_config.inc b/gosa-core/include/class_config.inc index a51caa58b..5f00a2bd0 100644 --- a/gosa-core/include/class_config.inc +++ b/gosa-core/include/class_config.inc @@ -934,6 +934,23 @@ class config { } + function get_cfg_value($name, $default= "") { + $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); + } + + function check_config_version() { /* Skip check, if we've already mentioned the mismatch -- 2.30.2