X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_config.inc;h=5f00a2bd0abea86c7649a256c091fa0719aa824c;hb=72108fa8fe45d2d12d204dba329b99d1578a2aab;hp=225f647cf34a0fe83e65e542f565c9ec76eacf25;hpb=a983e025cf2b5228ca16f8e3d7f0c49fcbc3ab10;p=gosa.git diff --git a/gosa-core/include/class_config.inc b/gosa-core/include/class_config.inc index 225f647cf..5f00a2bd0 100644 --- a/gosa-core/include/class_config.inc +++ b/gosa-core/include/class_config.inc @@ -70,6 +70,22 @@ class config { function check_and_reload() { + global $ui; + + /* Check if class_location.inc has changed, this is the case + if we have installed or removed plugins. + */ + if(session::is_set("class_location.inc:timestamp")){ + $tmp = stat("../include/class_location.inc"); + if($tmp['mtime'] != session::get("class_location.inc:timestamp")){ + session::un_set("plist"); + } + } + $tmp = stat("../include/class_location.inc"); + session::set("class_location.inc:timestamp",$tmp['mtime']); + + + if($this->filename != "" && filemtime($this->filename) != $this->last_modified){ $this->config_found= FALSE; @@ -366,12 +382,18 @@ class config { if ($this->current['MAILMETHOD'] == ""){ $ldap->search ("(objectClass=goMailServer)", array('cn')); $this->data['SERVERS']['IMAP']= array(); - error_reporting(0); while ($attrs= $ldap->fetch()){ $name= $attrs['cn'][0]; - $this->data['SERVERS']['IMAP'][$name]= $name; + $this->data['SERVERS']['IMAP'][$name]= + array( + "server_dn" => $attrs['dn'], + "connect" => "", + "admin" => "", + "password" => "", + "sieve_server"=> "", + "sieve_option"=> "", + "sieve_port" => ""); } - error_reporting(E_ALL); } else { $ldap->search ("(&(objectClass=goImapServer)(goImapSieveServer=*))", array('goImapName', 'goImapConnect', 'goImapAdmin', 'goImapPassword', @@ -400,6 +422,7 @@ class config { $this->data['SERVERS']['IMAP'][$imap_server]= array( + "server_dn" => $attrs['dn'], "connect" => $imap_connect, "admin" => $imap_admin, "password" => $pwd, @@ -760,7 +783,7 @@ class config { } /* Fix name, if it contains a replace tag */ - $name= @LDAP::fix($name); + $name= preg_replace('/\\\\,/', ',', @LDAP::fix($name)); /* Check if current name is too long, then cut it */ if(mb_strlen($name, 'UTF-8')> $max_size){ @@ -833,7 +856,7 @@ class config { foreach($res as $entry){ - $acl = $ui->get_permissions($entry['dn'],"server/goShareServer",""); + $acl = $ui->get_permissions($entry['dn'],"server",""); if(isset($entry['goExportEntry']['count'])){ unset($entry['goExportEntry']['count']); } @@ -911,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