summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 79d27fe)
raw | patch | inline | side by side (parent: 79d27fe)
author | hzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 22 Nov 2010 12:59:09 +0000 (12:59 +0000) | ||
committer | hzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 22 Nov 2010 12:59:09 +0000 (12:59 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20319 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc
index b6e78e6849d0ee2fe377ee816ab6d305d058a85f..bf74a5bc0e8b76e179d62f2857f4e844ed140dbf 100644 (file)
var $mailAddress = "";
var $mailLocation = "";
var $mailFolder = NULL;
+ var $mailFolderChanged = NULL;
+
var $quotaUsage = 0;
var $quotaSize = 0;
var $alternateAddresses = array();
"mailLimit" => array(
'acctGetMailLimit', 'acctSetMailLimit'),
//Just for speedup
- "folderListWithMembers" => array(
+ "folderListWithMembers" => array(
'acctGetComprehensiveUser'),
+ "folderACLs" => array(
+ 'folderGetMembers', 'folderSetMembers'),
"comprehensiveUser" => array(
'acctGetComprehensiveUser')
);
if(count($msgs)){
msg_dialog::displayChecks($msgs);
}else{
- $this->mailFolder = $this->FolderWidget->save();
+
+ if(!empty($this->mailFolderChanges)){
+ $this->mailFolderChanges = array_merge($this->mailFolderChanges, $this->FolderWidget->save());
+ }
+ else{
+ $this->mailFolderChanges = $this->FolderWidget->save();
+ }
+ $this->folderSaverLaterObsolete();
+
$this->FolderWidget = NULL;
+
}
}
$this->mailBoxSendSizelimitValue = null;
}
-
-
$quota = array( "warn_limit" => $this->mailBoxWarnLimitValue,
"send_limit" => $this->mailBoxSendSizelimitValue,
"hard_limit" => $this->quotaSize);
}
}
-
+ $this->folderSaverLaterObsolete($this->uid);
+
+ }
//checks for feature "quotaUsage"
//not to be saved
#
# //checks for feature "dropOwnMails"
# if($this->isFeatureEnabled("dropOwnMails") && $this->hasFeaturebeenChanged("dropOwnMails")){}
- }
-
-
+
+
+ /*! \brief TODO remove this function later
+ */
+ function folderSaverLaterObsolete($id){
+ if($this->isFeatureEnabled("mailFolder")&& $this->hasFeaturebeenChanged("mailFolder")){
+ //is sorting necessary?
+ //Find folders to add
+ if(empty($this->mailFolderChanges)){
+ return;
+ }
+
+ //Remove the root folder - the widget adds it as new
+ echo "Removing: user/".$this->uid;
+ unset($this->mailFolderChanges["user/".$this->uid]);
+
+ foreach($this->mailFolderChanges as $folder => $memberlist){
+ echo "Status".$this->mailFolderChanges[$folder]["status"]."<br>";
+ if($this->mailFolderChanges[$folder]["status"] == "added"){
+ $this->groupwareDao->save("mailFolder", $folder);
+ }
+ if($this->mailFolderChanges[$folder]["status"] == "removed"){
+ $this->groupwareDao->del("mailFolder", $folder);
+ }
+
+ if($this->isFeatureEnabled("folderACLs")){
+ //checking if ACL has been changed.
+ if($this->mailFolderChanges[$folder]["status"] == "added"){
+ if(isset($memberlist["acls"])){
+ echo "DEBUG HAPE- Changing ACLs Folder".$folder."<br>";
+
+ //set Default ACLs if not yet set by User
+ $defAcls = GroupwareDefinitions::getDefaultFolderACLs();
+ $memberListToBeSaved = array_merge($defAcls, $memberlist["acls"] );
+ }
+
+ }
+ else{
+ if(array_differs($memberlist["acls"], $this->mailFolderChanges[$folder]["acls"])){
+ echo "DEBUG HAPE- Changing ACLs Folder".$folder."<br>";
+ $memberListToBeSaved = array_merge($memberlist["acls"]);
+ }
+ }
+ echo "<pre>";
+ print_r($memberListToBeSaved);
+ echo "</pre>";
+ $this->groupwareDao->save("folderACLs", $this->uid, array($memberListToBeSaved));
+ }
+ }
+ }
+ //reset the changes.. we have persisted them.
+ $this->mailFolderChanges = null;
+ }
+
/*! \brief Check given values
*/
function check()
diff --git a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc
index b53a7bcbdae9ee7384ec7684ef664bf01102a09a..6564396745ef3289f935035c5abdd3a91b99d1d6 100644 (file)
private $groupwarePluginRef = FALSE;
+
private static $gwFeatures = array(
"primaryMail" => array( "get"=>"gwAcctGetPrimaryMailAddress",
"folderListWithMembers" => array(
"get"=>"gwFolderListWithMembers"),
"comprehensiveUser" => array(
- "get"=>'gwAcctGetComprehensiveUser')
+ "get"=>'gwAcctGetComprehensiveUser'),
+ "folderACLs" => array(
+ "get"=>'gwFolderGetMember',
+ "save"=>'gwFolderSetMembers')
);
/*! \brief Generic saving method for all features defined in $gwFeatures
* which are the available features.
*/
- public function save($feature, $uid, $valueArray)
+ public function save($feature, $uid, $valueArray = null)
{
$function = GroupwareDao::$gwFeatures[$feature]["save"];
if(is_array($valueArray)){
$valueArray = array_merge(array($function, $uid), $valueArray);
}else{
- $valueArray = array($function, $uid, $valueArray);
+ $valueArray = array($function, $uid);
}
-
+
$result = call_user_func_array(array($this->groupwarePluginRef, 'rpcExec'), $valueArray);
return $result;
}
*
* NOT YET IMPLEMENTED
*/
- public function del($feature, $valueArray)
+ public function del($feature, $uid, $valueArray = null)
{
-
- echo "deletion of values is not implemented yet";
- /*
- $function = GroupwareDao::$gwFeatures[$feature]["delete"];
- $valueArray = array_merge(array($function), $valueArray);
- $result = call_user_func_array(array($this->groupwarePluginRef, 'rpcExec'), $valueArray);
- return $result;
- */
+ $function = GroupwareDao::$gwFeatures[$feature]["delete"];
+ if(is_array($valueArray)){
+ $valueArray = array_merge(array($function, $uid), $valueArray);
+ }else{
+ $valueArray = array($function, $uid);
+ }
+
+ $result = call_user_func_array(array($this->groupwarePluginRef, 'rpcExec'), $valueArray);
+ return $result;
}
-
/*! \brief determine availability of features.
*
* @param methodName
diff --git a/gosa-plugins/groupware/personal/groupware/class_GroupwareDefinitions.inc b/gosa-plugins/groupware/personal/groupware/class_GroupwareDefinitions.inc
index 8eb913d3214dc419f3bb0fb2bb43a3e2b57d35c6..4cfd0225f04d632106e91dd5ed10a71ebe90bbbb 100644 (file)
$ret[GROUPWARE_RIGHTS_ALL] = _("All");
return($ret);
}
+
+ public static function getDefaultFolderACLs()
+ {
+ $r["Anonym"] = GROUPWARE_RIGHTS_NONE;
+ $r["Standard"] = GROUPWARE_RIGHTS_NONE;
+
+ return $r;
+ }
}