From: hickert Date: Wed, 13 Oct 2010 13:58:50 +0000 (+0000) Subject: Added additional checks to prevent invalid folder widget initialization. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c26d21e42179d4147dccd3574d043a5d559e3224;p=gosa.git 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 --- 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)); + } }