From c26d21e42179d4147dccd3574d043a5d559e3224 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 13 Oct 2010 13:58:50 +0000 Subject: [PATCH] Added additional checks to prevent invalid folder widget initialization. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20035 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../groupware/FolderWidget/class_FolderWidget.inc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc index 1fde7b8f3..fc409dd86 100644 --- a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc +++ b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc @@ -116,6 +116,14 @@ class FolderWidget extends plugin function setFolderList($arr) { $this->buildRecursiveList($arr, $this->pathSeparator); + + // Ensure that we've at least the base folder set + if(!isset($this->folderList[$this->accountPrefix])){ + $this->addPath($this->accountPrefix, preg_replace("/^.*\//","", $this->accountPrefix)); + + trigger_error(sprintf("You reuquire at least a folder named '%s'! This time it was added automatically.", + $this->accountPrefix)); + } } -- 2.30.2