Code

checked in broken template - removed features.
authorhzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Sep 2010 13:00:53 +0000 (13:00 +0000)
committerhzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Sep 2010 13:00:53 +0000 (13:00 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19622 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/personal/groupware/class_groupware.inc

index 220a2a0dc208f973b63a22621d08d35e40ddeace..9f3424437ba331ea7e390c4139c91438b5b257a1 100644 (file)
@@ -27,6 +27,7 @@ class groupware extends plugin
     var $rpcError = FALSE;
     var $rpcErrorMessage = "";
 
+    /*
     var $attributes = array(
             "mailAddress",
             "mailLocation",
@@ -49,6 +50,7 @@ class groupware extends plugin
             "localDeliveryOnly",
             "dropOwnMails"
             );
+            */
 
     var $enabledFeatures = array();
 
@@ -139,6 +141,38 @@ class groupware extends plugin
         $this->groupwareDao = new groupware_dao($this);
 
         $features = array();
+        $featureReq = array(
+                       "primaryMail"                           => array(
+                               'acctGetPrimaryMailAddress'),
+                   "quotaUsage"                => array(
+                       'acctGetQuota'),
+                "quotaSize"                 => array(
+                    'acctSetQuota','acctGetQuota'),
+                "mailFilter"                => array(
+                    'acctDelFilter','acctGetFilters','acctSetFilters','acctSetFilters'),
+                "alternateAddresses"        => array(
+                    'acctDelAlternateMailAddress','acctSetAlternateMailAddresses',
+                    'acctAddAlternateMailAddress','acctGetAlternateMailAddresses'),
+                "forwardingAddresses"       => array(
+                    'acctAddMailForwardAddress','acctDelMailForwardAddress',
+                    'acctGetMailForwardAddresses','acctSetMailForwardAddresses'),
+                "vacationMessage"           => array(
+                    'acctDelFilter','acctGetFilters','acctSetFilters','acctSetFilters'),
+                "mailBoxWarnLimit"          => array(
+                    'acctSetQuota','acctGetQuota'),
+                "mailBoxSendSizelimit"      => array(
+                    'acctSetQuota','acctGetQuota'),
+                "mailBoxHardSizelimit"      => array(
+                    'acctSetQuota','acctGetQuota'),
+                "mailBoxAutomaticRemoval"   => array(
+                        'acctSetQuota','acctGetQuota'),
+                "localDeliveryOnly"         => array(
+                        'acctDelFilter','acctGetFilters','acctSetFilters','acctSetFilters'),
+                "dropOwnMails"              => array(
+                        'acctDelFilter','acctGetFilters','acctSetFilters','acctSetFilters')
+                       );
+             
+        /*
         $featureReq = array(
                        "primaryMail"                           => array(
                                'acctGetPrimaryMailAddress'),
@@ -168,7 +202,7 @@ class groupware extends plugin
                         'acctDelFilter','acctGetFilters','acctSetFilters','acctSetFilters'),
                 "dropOwnMails"              => array(
                         'acctDelFilter','acctGetFilters','acctSetFilters','acctSetFilters'));
-      
+      */
         // Check if all required methods cann be called! 
         foreach($featureReq as $name => $requires){
             $active = TRUE;
@@ -708,10 +742,20 @@ class groupware extends plugin
         }
          
         /*
-         * Trying to save the primary Email Address.
+         *save the primary Email Address.
          */
         if(!empty($this->mailAddress)){
-               $this->groupwareDao->save("primaryMail", array($this->uid, $this->mailAddress));
+               $this->groupwareDao->save("primaryMail", $this->uid, $this->mailAddress);
+        }
+        
+        /*
+         *  
+         */
+        if(isset($this->forwardingAddresses) && is_array($this->forwardingAddresses)){
+                       $this->groupwareDao->save("alternateAddresses", $this->uid, $this->alternateAddresses);
+        }
+        if(isset($this->forwardingAddresses) && is_array($this->forwardingAddresses)){
+                       $this->groupwareDao->save("forwardingAddresses", $this->uid, $this->forwardingAddresses);
         }
       
     }
@@ -946,7 +990,7 @@ class groupware_dao{
        }
        
        
-       public function save($feature, $valueArray)
+       public function save($feature, $uid, $valueArray)
        {
                /*
                 * TODO: 
@@ -954,11 +998,12 @@ class groupware_dao{
                 * save and return the result.
                 */
                $function = groupware_dao::$gwFeatures[$feature]["save"];
+               
                if(is_array($valueArray)){
-                       $valueArray = array_merge(array($function), $valueArray);
+                       $valueArray = array_merge(array($function, $uid), $valueArray);
                }
                else{
-                       $valueArray = array($function, $valueArray);
+                       $valueArray = array($function, $uid, $valueArray);
                }
                $this->debug("SAVING (feature, value)", $valueArray);
                $result =  call_user_func_array(array($this->groupwarePluginRef, 'rpcExec'), $valueArray);