summaryrefslogtreecommitdiff
path: root/lib/Kolab/Utils/DAVBackend.php
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-03-20 15:21:20 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-03-20 15:21:20 (GMT)
commit6f526b71a5cadd9ea99d1ed28fd62faf72b1d9df (patch)
tree44dec47b9f35b9757e87f9d0e7570880326dc446 /lib/Kolab/Utils/DAVBackend.php
parent9e55e39d63b81446d1039cdad94330e7ad4c1bf3 (diff)
downloadiRony-6f526b71a5cadd9ea99d1ed28fd62faf72b1d9df.tar.gz
List calendar attachments as URIs and deliver contents on request
Diffstat (limited to 'lib/Kolab/Utils/DAVBackend.php')
-rw-r--r--lib/Kolab/Utils/DAVBackend.php29
1 files changed, 27 insertions, 2 deletions
diff --git a/lib/Kolab/Utils/DAVBackend.php b/lib/Kolab/Utils/DAVBackend.php
index 822437b..3a1708c 100644
--- a/lib/Kolab/Utils/DAVBackend.php
+++ b/lib/Kolab/Utils/DAVBackend.php
@@ -24,6 +24,7 @@
namespace Kolab\Utils;
use \kolab_storage;
+use \rcube_utils;
/**
*
@@ -86,5 +87,29 @@ class DAVBackend
return $success;
}
-
-} \ No newline at end of file
+
+ /**
+ * Build an absolute URL with the given parameters
+ */
+ public static function abs_url($parts = array())
+ {
+ $schema = 'http';
+ $default_port = 80;
+ if (rcube_utils::https_check()) {
+ $schema = 'https';
+ $default_port = 443;
+ }
+ $url = $schema . '://' . $_SERVER['HTTP_HOST'];
+
+ if ($_SERVER['SERVER_PORT'] != $default_port)
+ $url .= ':' . $_SERVER['SERVER_PORT'];
+
+ if (dirname($_SERVER['SCRIPT_NAME']))
+ $url .= dirname($_SERVER['SCRIPT_NAME']);
+
+ $url .= join('/', array_map('urlencode', $parts));
+
+ return $url;
+ }
+
+}