From: hzerres Date: Thu, 25 Nov 2010 11:47:03 +0000 (+0000) Subject: (groupware) added all exchange permissions and repaired gwAcltranslation. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d8951f331f67ed0fe54c20401348ac89cc158d94;p=gosa.git (groupware) added all exchange permissions and repaired gwAcltranslation. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20369 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 72b6a64da..b517c3c3a 100644 --- a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc +++ b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc @@ -824,7 +824,7 @@ class Groupware extends plugin // Save the primary Email Address. if($this->isFeatureEnabled("primaryMail")&& $this->hasFeaturebeenChanged("primaryMail")){ - echo "------MailAddress to be saved: ".$this->mailAddress."
"; + $res = $this->groupwareDao->save("primaryMail", $this->uid, $this->mailAddress); if($res === NULL){ $message = _("Setting account mail address failed!"); @@ -839,7 +839,7 @@ class Groupware extends plugin $res = $this->groupwareDao->save("alternateAddresses", $this->uid, array($this->alternateAddresses)); } else{ - echo "deleting AltAddresses."; + $res = $this->groupwareDao->save("alternateAddresses", $this->uid, array(array())); } if($res === NULL){ @@ -980,7 +980,6 @@ class Groupware extends plugin unset($this->mailFolderChanges["user/".$this->uid]); foreach($this->mailFolderChanges as $folder => $memberlist){ - echo "Status: ".$this->mailFolderChanges[$folder]["status"]."
"; if($this->mailFolderChanges[$folder]["status"] == "added"){ $this->groupwareDao->save("mailFolder", $folder); @@ -1005,11 +1004,13 @@ class Groupware extends plugin } } else{ + //Todo: remove debugs + /* 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."; @@ -1019,9 +1020,12 @@ class Groupware extends plugin } } if(!empty($memberListToBeSaved)){ + //Todo: remove debugs + /* echo "List To save:
";
 						print_r($memberListToBeSaved);
 						echo "

"; + */ $this->groupwareDao->save("folderACLs", $folder, array($memberListToBeSaved)); } } diff --git a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc index a5c5e6f4f..dce2a2544 100644 --- a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc +++ b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc @@ -381,10 +381,10 @@ class GroupwareDao{ */ private function translateGwAclsToGosaAcls($compFolders){ $resultArr = array(); - $folderAclDef = GroupwareDefinitions::getPermissions(); foreach ($compFolders as $fName => $fMembers) { $resultArr[$fName]["name"] = preg_replace("/^.*\//","",$fName); $resultArr[$fName]["status"] = ""; + $resultArr[$fName]["acls"] = array(); foreach($fMembers as $fMember => $fAcl){ $aclLine = array( "name" => $fMember, @@ -394,7 +394,8 @@ class GroupwareDao{ $aclLine["acl"] = GROUPWARE_RIGHTS_NONE; } else{ - $resultArr[$fName]["acls"] = $folderAclDef[$fAcl]; + $aclLine["acl"] = $fAcl; + } $resultArr[$fName]["acls"][] = $aclLine; } diff --git a/gosa-plugins/groupware/personal/groupware/class_GroupwareDefinitions.inc b/gosa-plugins/groupware/personal/groupware/class_GroupwareDefinitions.inc index 4cfd0225f..963e1103a 100644 --- a/gosa-plugins/groupware/personal/groupware/class_GroupwareDefinitions.inc +++ b/gosa-plugins/groupware/personal/groupware/class_GroupwareDefinitions.inc @@ -25,17 +25,36 @@ class GroupwareDefinitions { public static function getPermissions() { - $ret[GROUPWARE_RIGHTS_NONE] = _("None"); - $ret[RIGHTS_GROUPWARE_READ] = _("Read"); - $ret[RIGHTS_GROUPWARE_POST] = _("Post"); - $ret[GROUPWARE_RIGHTS_APPEND] = _("Append"); - $ret[RIGHTS_GROUPWARE_WRITE] = _("Write"); - $ret[GROUPWARE_RIGHTS_ALL] = _("All"); + $ret[GROUPWARE_RIGHTS_NONE] = _("no right"); + $ret[RIGHTS_GROUPWARE_READ] = _("read right"); + $ret[RIGHTS_GROUPWARE_POST] = _("post right"); + $ret[GROUPWARE_RIGHTS_APPEND] = _("append right"); + $ret[RIGHTS_GROUPWARE_WRITE] = _("write right"); + $ret[GROUPWARE_RIGHTS_ALL] = _("all rights"); + + $ret[GROUPWARE_LOOKUP] = _("lookup right"); + $ret[GROUPWARE_READ] = _("atomic read right"); + $ret[GROUPWARE_STATUS] = _("atomic status right"); + $ret[GROUPWARE_WRITE] = _("atomic write right"); + $ret[GROUPWARE_INSERT] = _("atomic insert right"); + $ret[GROUPWARE_POST] = _("atomic post right"); + $ret[GROUPWARE_CREATE] = _("atomic create right"); + $ret[GROUPWARE_DELETE] = _("atomic delete right"); + $ret[GROUPWARE_ADMINISTRATE] = _("atomic admin right"); + + //$ret[GROUPWARE_RIGHTS_NONE", 0); + //$ret[RIGHTS_GROUPWARE_READ", GROUPWARE_LOOKUP | GROUPWARE_READ | GROUPWARE_STATUS); + //$ret[RIGHTS_GROUPWARE_POST", RIGHTS_GROUPWARE_READ | GROUPWARE_POST); + //$ret[GROUPWARE_RIGHTS_APPEND", RIGHTS_GROUPWARE_POST | GROUPWARE_INSERT); + //$ret[RIGHTS_GROUPWARE_WRITE", GROUPWARE_RIGHTS_APPEND | GROUPWARE_WRITE | GROUPWARE_CREATE | GROUPWARE_DELETE); + //$ret[GROUPWARE_RIGHTS_ALL" + return($ret); } public static function getDefaultFolderACLs() - { + { + $r = array(); $r["Anonym"] = GROUPWARE_RIGHTS_NONE; $r["Standard"] = GROUPWARE_RIGHTS_NONE;