summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-07-17 15:15:01 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-07-17 15:15:01 (GMT)
commitdd622213660200d6357710f941906fce9903afa3 (patch)
tree7abf64fadf8c63dd0a28ff11d9157d789ca77ff9
parent7a6f82ba9f31908ae7ef0cfcd944afc5b6bf95f7 (diff)
downloadiRony-dd622213660200d6357710f941906fce9903afa3.tar.gz
Use UID as folder name if it doesn't appear to be a full-length UID
-rw-r--r--lib/Kolab/Utils/DAVBackend.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Kolab/Utils/DAVBackend.php b/lib/Kolab/Utils/DAVBackend.php
index cf165b7..04aa80f 100644
--- a/lib/Kolab/Utils/DAVBackend.php
+++ b/lib/Kolab/Utils/DAVBackend.php
@@ -233,7 +233,7 @@ class DAVBackend
{
$props = array(
'type' => $type,
- 'name' => 'Untitled',
+ 'name' => '',
'subscribed' => true,
);
@@ -255,6 +255,12 @@ class DAVBackend
}
}
+ // use UID as name if it doesn't seem to be a real UID
+ // TODO: append number to default "Untitled" folder name if one already exists
+ if (empty($props['name'])) {
+ $props['name'] = strlen($uid) < 16 ? $uid : 'Untitled';
+ }
+
if (!($fname = kolab_storage::folder_update($props))) {
rcube::raise_error(array(
'code' => 600, 'type' => 'php',