From: hzerres Date: Wed, 20 Oct 2010 09:14:09 +0000 (+0000) Subject: (groupware) some code cleaning X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d4baae049ba011f33de494de3e808de5478f35e2;p=gosa.git (groupware) some code cleaning git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20098 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 0f03abdb3..bd5c624cd 100644 --- a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc +++ b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc @@ -127,7 +127,6 @@ class Groupware extends plugin return($res); } - /*! \brief Checks if feature is availavle on the server (a call to getCapabilities achieves this.) */ public function isFeatureEnabled($featureName) @@ -156,9 +155,9 @@ class Groupware extends plugin $featureReq = array( "primaryMail" => array( 'acctGetPrimaryMailAddress'), - "quotaUsage" => array("_off", + "quotaUsage" => array( 'acctGetQuota'), - "quotaSize" => array("_off", + "quotaSize" => array( 'acctSetQuota','acctGetQuota'), "mailLocations" => array( 'getMailboxLocations'), @@ -170,13 +169,14 @@ class Groupware extends plugin "forwardingAddresses" => array( 'acctAddMailForwardAddress','acctDelMailForwardAddress', 'acctGetMailForwardAddresses','acctSetMailForwardAddresses'), - "vacationMessage" => array("_off", + "vacationMessage" => array( 'acctDelFilter','acctGetFilters','acctSetFilters','acctSetFilters'), "mailBoxWarnLimit" => array( 'acctSetQuota','acctGetQuota'), "mailBoxSendSizelimit" => array( 'acctSetQuota','acctGetQuota'), - "mailBoxHardSizelimit" => array( + //This is the same as qotaSize - should stay turned off + "mailBoxHardSizelimit" => array( "_off", 'acctSetQuota','acctGetQuota'), "mailBoxAutomaticRemoval" => array( 'acctSetQuota','acctGetQuota'), @@ -804,15 +804,15 @@ class Groupware extends plugin //Save quota if( ($this->isFeatureEnabled("mailBoxWarnLimit") || $this->isFeatureEnabled("mailBoxSendSizelimit") || - $this->isFeatureEnabled("mailBoxHardSizelimit") || + $this->isFeatureEnabled("quotaSize") || $this->isFeatureEnabled("mailBoxAutomaticRemoval")) && ($this->hasFeaturebeenChanged("mailBoxWarnLimit") || $this->hasFeaturebeenChanged("mailBoxSendSizelimit") || - $this->hasFeaturebeenChanged("mailBoxHardSizelimit") || + $this->hasFeaturebeenChanged("quotaSize") || $this->hasFeaturebeenChanged("mailBoxAutomaticRemoval") )){ $quota = array( "warn_limit" => $this->mailBoxWarnLimitValue, "send_limit" => $this->mailBoxSendSizelimitValue, - "hard_limit" => $this->mailBoxHardSizelimitValue, + "hard_limit" => $this->quotaSize, "hold" => $this->quotaSize); $this->groupwareDao->save("quotaSize", $this->uid, $quota); @@ -825,11 +825,8 @@ class Groupware extends plugin */ function check() { - //add some checks + //checked only if features are enabled. $messages = plugin::check(); - - //Check the dates - // TODO: check only if features are enabled. //required vacationEnabled if($this->vacationEnabled){ diff --git a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc index 6194987fe..0ad4a0e4a 100644 --- a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc +++ b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc @@ -1,7 +1,7 @@ groupwarePluginRef = &$pluginRef; - - // TODO: Remove all echos $this->init(); } @@ -82,8 +80,6 @@ class GroupwareDao{ public function init() { $this->availableMethods = $this->groupwarePluginRef->rpcExec('gwGetCapabilities'); - //$this->availableProperties = $this->groupwarePluginRef->rpcExec('gwGetSupportedProperties'); - //$this->debug("availableProperties on init:", $this->availableProperties); } @@ -189,7 +185,7 @@ class GroupwareDao{ //Folder Id from the User ... //user/$id/ $resultArr["mailFolder"] = $this->get("mailFolder", array("user/".$uid."/")); - //print_a($resultArr["mailFolder"]); + print_a($resultArr["mailFolder"]); /* "RIGHTS_NONE", 0); "RIGHTS_READ", LOOKUP | READ | STATUS); @@ -198,58 +194,6 @@ class GroupwareDao{ "RIGHTS_WRITE", RIGHTS_APPEND | WRITE | CREATE | DELETE); "" */ - /* - $resultArr["mailFolder"] = array( - 'user/wiwu/Aufgaben' => array( - "name" =>"Aufgaben", - "acls"=> array( - array( - "name" => "wiwu", - "acl" => GROUPWARE_RIGHTS_ALL, - "type"=>"user"), - array( - "name" => "2a", - "acl" => GROUPWARE_RIGHTS_ALL, - "type"=>"user"))), - - 'user/wiwu/Entw\xc3\xbcrfe' =>array( - "name" => "Entw\xc3\xbcrfe", - "acls" => array( - array( - "name" => "wiwu", - "acl" => GROUPWARE_RIGHTS_ALL, - "type"=>"user"))), - 'user/wiwu/Gel\xc3\xb6schte Objekte' => array( - "name" => "Gel\xc3\xb6schte Objekte", - "acls" => array( - array( - "name" => "wiwu", - "acl" => GROUPWARE_RIGHTS_ALL, - "type"=>"user"))), - 'user/wiwu/Synchronisierungsprobleme/Lokale Fehler' => array( - "name" => "Lokale Fehler", - "acls" => array( - array( - "name" => "wiwu", - "acl" => GROUPWARE_RIGHTS_ALL, - "type"=>"user"))), - 'user/wiwu/Synchronisierungsprobleme/Serverfehler' => array( - "name" => "Serverfehler", - "acls" => array( - array( - "name" => "wiwu", - "acl" => GROUPWARE_RIGHTS_ALL, - "type"=>"user"))), - 'shared/publicFolder' => array( - "name" => "publicFolder", - "acls" => array( - array( - "name" => "wiwu", - "acl" => GROUPWARE_RIGHTS_ALL, - "type"=>"user"))), - ); - */ - //need a status for the array - setting them now for the example data. foreach($resultArr["mailFolder"] as $id => $folder){ @@ -269,13 +213,6 @@ class GroupwareDao{ // Usage is a Mapi function which is not yet // example Array for Quota - /* - $quota = array( "warn_limit" => 1008, - "send_limit" => 108, - "hard_limit" => 1108, - "hold" => 508, - "usage" => 1108); - */ $quota = $this->get("quotaSize", array($uid)); $resultArr["quotaSize"] = $quota["usage"]; @@ -315,7 +252,7 @@ class GroupwareDao{ return $resultArr; } - //TODO: move this function into the groupwareplugin. # + //TODO: move this function into the groupwareplugin. //This is a feature with many datasets inside which should be cut in slices and saved separately. //Since the knowledge about the feature is only known in the plugin this has got to be moved.