andre 1 год назад
Родитель
Сommit
f171e8d77d

+ 9 - 3
app/Libs/Zimbra/Components/Api/Soap/Services/Update/UpdateAccount.php

@@ -70,9 +70,15 @@ class UpdateAccount extends CreateAccount
         $account->setAttr(Account::ATTR_COMPANY, $this->formData['company']);
         $account->setAttr(Account::ATTR_ACCOUNT_STATUS, $this->formData['status']);
         $account->setAttr(Account::ATTR_DISPLAY_NAME, $this->formData['display_name']);
-        $account->setAttr(Account::ATTR_MAIL_FORWARD, $this->formData['zimbraPrefMailForwardingAddress']);
-        $account->setAttr(Account::ATTR_DISABLE_LOCAL, $this->formData['zimbraPrefMailLocalDeliveryDisabled']);
-        $account->setAttr(Account::ATTR_ENABLE_FORWARD, $this->formData['zimbraFeatureMailForwardingEnabled']);
+        if ($this->formData['forward'] == 'on') {
+            $account->setAttr(Account::ATTR_MAIL_FORWARD, $this->formData['zimbraPrefMailForwardingAddress']);
+            $account->setAttr(Account::ATTR_DISABLE_LOCAL, TRUE);
+            $account->setAttr(Account::ATTR_ENABLE_FORWARD, TRUE);
+        } else {
+            $account->setAttr(Account::ATTR_MAIL_FORWARD, NULL);
+            $account->setAttr(Account::ATTR_DISABLE_LOCAL, FALSE);
+            $account->setAttr(Account::ATTR_ENABLE_FORWARD, FALSE);
+        }
         return $account;
 
     }

+ 0 - 8
app/UI/Client/EmailAccount/Providers/EditAccountDataProvider.php

@@ -115,14 +115,6 @@ class EditAccountDataProvider extends BaseDataProvider
         {
             $value = in_array($field, $fieldToProtection) ? htmlentities($value) : $value;
         }
-        if ($this->formData['forward'] == 'off') {
-            $this->formData['zimbraPrefMailLocalDeliveryDisabled'] = FALSE;
-            $this->formData['zimbraFeatureMailForwardingEnabled'] = FALSE;
-            $this->formData['zimbraPrefMailForwardingAddress'] = NULL;
-        } else {
-            $this->formData['zimbraPrefMailLocalDeliveryDisabled'] = TRUE;
-            $this->formData['zimbraFeatureMailForwardingEnabled'] = TRUE;
-        }
 
         /**
          * product manager allow to check product settings