summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 89ae684)
raw | patch | inline | side by side (parent: 89ae684)
author | hzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 15 Nov 2010 10:57:18 +0000 (10:57 +0000) | ||
committer | hzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 15 Nov 2010 10:57:18 +0000 (10:57 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20232 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 674bf23dd15a25fc23fc585532ab668bde871337..f61a6b4b5898a8cf6546b2ce2aed50a9b42d0466 100644 (file)
"mailFolder" => array(
'folderList','folderDel','folderAdd'),
"mailLimit" => array(
- 'acctGetMailLimit', 'acctSetMailLimit')
+ 'acctGetMailLimit', 'acctSetMailLimit'),
+ //Just for speedup
+ "folderListWithMembers" => array(
+ 'acctGetComprehensiveUser'),
+ "comprehensiveUser" => array(
+ 'acctGetComprehensiveUser')
);
// Check if all required methods can be called!
$this->hasFeaturebeenChanged("mailBoxAutomaticRemoval") )){
$quota = array( "warn_limit" => $this->mailBoxWarnLimitValue,
"send_limit" => $this->mailBoxSendSizelimitValue,
- "hard_limit" => $this->quotaSize,
+ "hard_limit" => null,
"hold" => $this->quotaSize);
$res = $this->groupwareDao->save("quotaSize", $this->uid, $quota);
diff --git a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc
index 80940ba5b62f16679cceda99ad85b5f1c4b3d023..9aeeca23d31e3258247117d388efa66488ae7456 100644 (file)
private $accountLocations;
private $groupwarePluginRef = FALSE;
+
private static $gwFeatures = array(
"primaryMail" => array( "get"=>"gwAcctGetPrimaryMailAddress",
"save"=>"gwFolderSetMembers",
"delete"=>"gwFolderDelMember"),
"mailLimit" => array("get"=>"gwAcctGetMailLimit",
- "save"=>"gwAcctSetMailLimit")
+ "save"=>"gwAcctSetMailLimit"),
+
+ //function for speedup
+ "folderListWithMembers" => array(
+ "get"=>"gwFolderListWithMembers"),
+ "comprehensiveUser" => array(
+ "get"=>'gwAcctGetComprehensiveUser')
);
*/
public function getComprehensiverUser( $uid)
{
- $resultArr = array();
-
+ if($this->groupwarePluginRef->isFeatureEnabled("comprehensiveUser")){
+ return $this->getComprehensiverUserCompact($uid);
+ }
+ else{
+ return $this->getComprehensiverUserSeparate($uid);
+ }
+ }
+ private function getComprehensiverUserCompact($uid){
+
+ $resultArr = array();
+
+ if($this->groupwarePluginRef->isFeatureEnabled("mailLocations")){
+ $resultArr["mailLocations"] = $this->groupwarePluginRef->rpcExec('gwGetMailboxLocations');
+
+ }
+ $comp = $this->get("comprehensiveUser", array($uid));
+ $resultArr["primaryMail"] = $comp["primaryMail"];
+ $resultArr["alternateAddresses"] = $comp["alternateAddresses"];
+ $resultArr["forwardingAddresses"] = $comp["forwardingAddresses"];
+ $resultArr["mailLocation"] = $comp["mailLocation"];
+ //Quota things.
+ $resultArr["quotaSize"] = $comp["quota"]["usage"];
+
+ $resultArr["mailBoxWarnLimitEnabled"] = TRUE;
+ $resultArr["mailBoxWarnLimitValue"] = $comp["quota"]["usage"];
+
+ $resultArr["mailBoxSendSizelimitEnabled"] = TRUE;
+ $resultArr["mailBoxSendSizelimitValue"] = $comp["quota"]["send_limit"];
+
+ $resultArr["mailBoxHardSizelimitEnabled"] = TRUE;
+ $resultArr["mailBoxHardSizelimitValue"] = $comp["quota"]["hard_limit"];
+
+ //Mail Limits
+ $resultArr["mailLimitReceiveEnabled"] = TRUE;
+ $resultArr["mailLimitReceiveValue"] = $comp["mailLimits"]["receive"];
+
+ $resultArr["mailLimitSendEnabled"] = TRUE;
+ $resultArr["mailLimitSendValue"] = $comp["mailLimits"]["send"];
+
+ $resultArr["vacationMessage"] = $comp["vacation"]["message"];
+
+ //Folder Stuff
+ $prefix = $this->groupwarePluginRef->folderPrefix;
+ $compFolders = $this->get("folderListWithMembers", array($prefix));
+ //ausgelagerte Funktion..
+ $resultArr["mailFolder"] = $this->translateGwAclsToGosaAcls($compFolders);
+
+ return $resultArr;
+
+ }
+
+ private function getComprehensiverUserSeparate($uid){
if($this->groupwarePluginRef->isFeatureEnabled("primaryMail")){
$resultArr["primaryMail"] = $this->get("primaryMail", array($uid));
}
// Get groupware folders for the current user.
$prefix = $this->groupwarePluginRef->folderPrefix;
+
+ $mFolder = $this->get("mailFolder", array($prefix));
+
+ $newFolder = array();
+ foreach($mFolder as $key =>$val){
+ $newFolder[$val] = $this->get("private_folderACLS", array($val));
+ }
+ $resultArr["mailFolder"] = $this->translateGwAclsToGosaAcls($newFolder);
+ /*
+ old Stuff
$resultArr["mailFolder"] = $this->get("mailFolder", array($prefix));
// Walk through results an fill in missing values, like name, status and acls.
}
}
}
+ */
// Add the required status field for each folder.
foreach($resultArr["mailFolder"] as $id => $folder){
}
return $resultArr;
}
+ private function translateGwAclsToGosaAcls($compFolders){
+ $resultArr = array();
+ $folderAclDef = GroupwareDefinitions::getPermissions();
+ foreach ($compFolders as $fName => $fMembers) {
+ $resultArr[$fName]["name"] = preg_replace("/^.*\//","",$fName);
+ foreach($fMembers as $fMember => $fAcl){
+ $aclLine = array(
+ "name" => $fMember,
+ "type"=>"user"
+ );
+ if(empty($fAcl)){
+ $resultArr[$fName]["acls"]["acl"] = GROUPWARE_RIGHTS_NONE;
+ }
+ else{
+ $resultArr[$fName]["acls"]["acl"] = $folderAclDef[$fAcl];
+ }
+ $resultArr[$fName]["acls"][] = $aclLine;
+ }
+ }
+ return $resultArr;
+ }
}
?>