X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_config.inc;h=036872656097e5a8e376521e14ff64081267e1d1;hb=bc81ccefd133ead30e4d43c2be5896df4fb89486;hp=c466c97970dce148f5869dea74ccf82e0a8683a9;hpb=ec426fd0c97a7da9922b32bdbe8ee30a1d81777c;p=gosa.git diff --git a/include/class_config.inc b/include/class_config.inc index c466c9797..036872656 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -308,7 +308,7 @@ class config { function load_servers () { /* Only perform actions if current is set */ - if ($this->current == NULL){ + if ($this->current === NULL){ return; } @@ -327,7 +327,7 @@ class config { "sieve_server" => $attrs['goImapSieveServer'][0], "sieve_port" => $attrs['goImapSievePort'][0]); } - error_reporting(E_ALL); + error_reporting(E_ALL | E_STRICT); /* Get kerberos server. FIXME: only one is supported currently */ $ldap->cd ($this->current['BASE']); @@ -751,6 +751,46 @@ class config { return FALSE; } + + function __search(&$arr, $name, $return) + { + $return= strtoupper($return); + if (is_array($arr)){ + foreach ($arr as &$a){ + if (isset($a['CLASS']) && strcasecmp($name, $a['CLASS']) == 0){ + return(isset($a[$return])?$a[$return]:""); + } else { + $res= $this->__search ($a, $name, $return); + if ($res != ""){ + return $res; + } + } + } + } + return (""); + } + + + function search($class, $value, $categories= "") + { + if (is_array($categories)){ + foreach ($categories as $category){ + $res= $this->__search($this->data[strtoupper($category)], $class, $value); + if ($res != ""){ + return $res; + } + } + } else { + if ($categories == "") { + return $this->__search($this->data, $class, $value); + } else { + return $this->__search($this->data[strtoupper($categories)], $class, $value); + } + } + + return (""); + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: