From: hickert Date: Mon, 9 Jun 2008 11:20:33 +0000 (+0000) Subject: Updated class config to support sieve options (tls) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=60df3e95fad489695341edbdf566f384a997303d;p=gosa.git Updated class config to support sieve options (tls) git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11263 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_config.inc b/gosa-core/include/class_config.inc index 29d45a9ac..8001926bb 100644 --- a/gosa-core/include/class_config.inc +++ b/gosa-core/include/class_config.inc @@ -370,20 +370,40 @@ class config { } error_reporting(E_ALL); } else { - $ldap->search ("(objectClass=goImapServer)", array('goImapName', 'goImapConnect', 'goImapAdmin', 'goImapPassword', + $ldap->search ("(&(objectClass=goImapServer)(goImapSieveServer=*))", + array('goImapName', 'goImapConnect', 'goImapAdmin', 'goImapPassword', 'goImapSieveServer', 'goImapSievePort')); $this->data['SERVERS']['IMAP']= array(); - error_reporting(0); + while ($attrs= $ldap->fetch()){ - $name= $attrs['goImapName'][0]; - $this->data['SERVERS']['IMAP'][$name]= array( "connect" => $attrs['goImapConnect'][0], - "admin" => $attrs['goImapAdmin'][0], - "password" => $attrs['goImapPassword'][0], - "sieve_server" => $attrs['goImapSieveServer'][0], - "sieve_port" => $attrs['goImapSievePort'][0]); + + /* Check if the given goImapSieveServer is in the new style "{cn:port/option}" + or the old style just "cn". + */ + if(preg_match("/\{/",$attrs['goImapSieveServer'][0])){ + $sieve_server = preg_replace("/^\{([^:]*).*$/","\\1",$attrs['goImapSieveServer'][0]); + $sieve_option = preg_replace("/^[^:]*[^\/]*+\/(.*)\}$/","\\1",$attrs['goImapSieveServer'][0]); + }else{ + $sieve_server = $attrs['goImapSieveServer'][0]; + $sieve_option = ""; + } + + $pwd = $attrs['goImapPassword'][0]; + $imap_admin = $attrs['goImapAdmin'][0]; + $imap_connect = $attrs['goImapConnect'][0]; + $imap_server = $attrs['goImapName'][0]; + $sieve_port = $attrs['goImapSievePort'][0]; + + $this->data['SERVERS']['IMAP'][$imap_server]= + array( + "connect" => $imap_connect, + "admin" => $imap_admin, + "password" => $pwd, + "sieve_server"=> $sieve_server, + "sieve_option"=> $sieve_option, + "sieve_port" => $sieve_port); } - error_reporting(E_ALL); } /* Get kerberos server. FIXME: only one is supported currently */