lib/Kolab

Daniel Hoffend hoffend at kolabsys.com
Mon Jan 26 17:48:40 CET 2015


 lib/Kolab/FreeBusy/Source.php     |    3 ++-
 lib/Kolab/FreeBusy/SourceIMAP.php |   10 +++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit c60c71a16f8272b08aa4ef274da66b7172aa55d2
Author: Daniel Hoffend <dh at dotlan.net>
Date:   Sun Jan 25 14:08:42 2015 +0100

    add tls:// support

diff --git a/lib/Kolab/FreeBusy/Source.php b/lib/Kolab/FreeBusy/Source.php
index 92a673a..5b0213f 100644
--- a/lib/Kolab/FreeBusy/Source.php
+++ b/lib/Kolab/FreeBusy/Source.php
@@ -43,6 +43,7 @@ abstract class Source
 		$config['url'] = $url;
 		switch ($config['scheme']) {
 			case 'file':	return new SourceFile($config + $conf);
+			case 'tls':
 			case 'imap':
 			case 'imaps':	return new SourceIMAP($config + $conf);
 			case 'http':
@@ -119,4 +120,4 @@ abstract class Source
 	{
 		return $this->cached;
 	}
-}
\ No newline at end of file
+}
diff --git a/lib/Kolab/FreeBusy/SourceIMAP.php b/lib/Kolab/FreeBusy/SourceIMAP.php
index 6536a4b..6f116b7 100644
--- a/lib/Kolab/FreeBusy/SourceIMAP.php
+++ b/lib/Kolab/FreeBusy/SourceIMAP.php
@@ -292,7 +292,15 @@ class SourceIMAP extends Source
 		$imap  = $rcube->get_storage();
 		$host  = $config['host'];
 		$port  = $config['port'] ?: ($config['scheme'] == 'imaps' ? 993 : 143);
-		$ssl   = $config['scheme'] == 'imaps' || $port == 993;
+
+		// detect ssl|tls method
+		if ($config['scheme'] == 'imaps' || $port == 993) {
+			$ssl = 'imaps';
+		} elseif ($config['scheme'] == 'tls') {
+			$ssl = 'tls';
+		} else {
+			$ssl = false;
+		}
 
 		// enable proxy authentication
 		if (!empty($config['proxy_auth'])) {




More information about the commits mailing list