summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b31dbec)
raw | patch | inline | side by side (parent: b31dbec)
author | hzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 23 Nov 2010 16:14:40 +0000 (16:14 +0000) | ||
committer | hzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 23 Nov 2010 16:14:40 +0000 (16:14 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20343 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/groupware/personal/groupware/class_Groupware.inc | patch | blob | history | |
gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc | patch | blob | history |
diff --git a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc
index 99a2f6e742b1b902728bca83c286f1d88daf27d9..72b6a64da3673e36bf143360b3dbb9422d43c59c 100644 (file)
else{
$this->mailFolderChanges = $this->FolderWidget->save();
}
- $this->folderSave();
+
+ $this->folderSave($this->uid);
$this->FolderWidget = NULL;
}
}
}
}
- // Save account folders
+ // TODO: Check the following paragraph
+ // Save account folders
if($this->mailFolder !== NULL && $this->isFeatureEnabled("mailFolder") && $this->hasFeaturebeenChanged("mailFolder")){
- $res = $this->saveFoldersAndAcls($this->uid, $this->mailFolder);
+ //$res = $this->saveFoldersAndAcls($this->uid, $this->mailFolder);
if($res === NULL){
$message = _("Saving mail folder failed!");
msg_dialog::display(_("Error"),$message."<br>".sprintf(_("Error was: '%s'."),$this->rpcErrorMessage),ERROR_DIALOG);
}
//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>";
+ echo "Status: ".$this->mailFolderChanges[$folder]["status"]."<br>";
+
if($this->mailFolderChanges[$folder]["status"] == "added"){
$this->groupwareDao->save("mailFolder", $folder);
}
$this->groupwareDao->del("mailFolder", $folder);
}
+ $memberListToBeSaved = array();
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"] );
+ $memberListToBeSaved = $defAcls;
+ //append all mebers set in Gosa widget.
+ foreach($memberlist["acls"] as $member){
+ $memberListToBeSaved[$member["name"]] = $member["acl"];
+ }
}
}
else{
- if(array_differs($memberlist["acls"], $this->mailFolderChanges[$folder]["acls"])){
- echo "DEBUG HAPE- Changing ACLs Folder".$folder."<br>";
- $memberListToBeSaved = array_merge($memberlist["acls"]);
+ echo "--- Hello1";
+ print_a($memberlist["acls"]);
+ echo "--- Hello2";
+ print_a($this->mailFolderChanges[$folder]["acls"]);
+
+ if(array_differs($memberlist["acls"], $this->mailFolder[$folder]["acls"])){
+ //append all mebers set in Gosa widget.
+ echo "ACLs have changed.";
+ foreach($memberlist["acls"] as $member){
+ $memberListToBeSaved[$member["name"]] = $member["acl"];
+ }
}
}
- echo "<pre>";
- print_r($memberListToBeSaved);
- echo "</pre>";
- $this->groupwareDao->save("folderACLs", $this->uid, array($memberListToBeSaved));
+ if(!empty($memberListToBeSaved)){
+ echo "List To save:<pre>";
+ print_r($memberListToBeSaved);
+ echo "</pre><br>";
+ $this->groupwareDao->save("folderACLs", $folder, array($memberListToBeSaved));
+ }
}
}
}
$messages[] = _("The primary address cannot be used as forwarding address!");
}
}
- }
- }
+ }
+ }
//checks for feature "mailLimit" - integer
if ($this->isFeatureEnabled("mailLimit")){
# //checks for feature "alternateAddresses"
# if ($this->isFeatureEnabled("alternateAddresses")){}
-
return($messages);
}
"mailFolder" => _("Mail folder"),
"quotaUsage" => _("Quota usage"),
"mailFilter" => _("Mail filter"),
+ "mailFilter" => _("Mail filter"),
"quotaSize" => _("Quota size"),
"alternateAddresses" => _("Alternate mail addresses"),
"forwardingAddresses" => _("Forwarding mail addresses"),
/*! \brief This is a feature with many datasets inside which should be
- * cut in slices and saved separately.
- */
- //
+
function saveFoldersAndAcls($id, $mailFolder)
{
// In the tests with the exchange server groupware setting acls is very
}
return($res);
}
+ */
}
diff --git a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc
index dfc0b07630508249ba1227386367a98c5035edf2..a5c5e6f4f6ecfaa36e0f31ef648f9cf00988b98d 100644 (file)
$valueArray = array($function, $uid, $valueArray);
}
else{
-
//omit otherwise
$valueArray = array($function, $uid);
}
$resultArr["primaryMail"] = $comp["primaryMail"];
$resultArr["alternateAddresses"] = $comp["alternateAddresses"];
- $resultArr["forwardingAddresses"] = array(key($comp["forwardingAddresses"]));
- var_dump($resultArr["forwardingAddresses"]);
+ //This dao will only accept the first forwardingAddress.
+ $resultArr["forwardingAddresses"] = array(key($comp["forwardingAddresses"]));
+ var_dump($resultArr["forwardingAddresses"]);
+
$resultArr["mailLocation"] = $comp["mailLocation"];
//Quota things.
$resultArr["quotaSize"] = $comp["quota"]["usage"];
$resultArr["mailBoxSendSizelimitEnabled"] = TRUE;
$resultArr["mailBoxSendSizelimitValue"] = $quota["send_limit"];
}else{
- $resultArr["mailBoxSendSizelimitEnabled"] = FALSE;
+ $resultArr["mailBoxSendSizelimitEnabled"] = FALSE;
}
if($quota["hard_limit"] > 0){
$resultArr["mailBoxHardSizelimitEnabled"] = TRUE;
$resultArr["vacationEnabled"] = !empty($resultArr["vacationMessage"]);
}
return $resultArr;
- }
+ }
/* \brief Translates Groupware folderAcls to Gosa widget Acls.
* @return Array list of Groupware Members with rights to folders.