From: cajus Date: Thu, 24 Jul 2008 09:47:28 +0000 (+0000) Subject: Added function to get cfg values in order "current", "global", "default". X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=72108fa8fe45d2d12d204dba329b99d1578a2aab;p=gosa.git 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 --- 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