Commit 54cfb283 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes #3890 Vacation range should be disabled on mail methods as none implements it

parent a86da769
......@@ -38,7 +38,7 @@ class mailMethodCyrus extends mailMethod
protected $enableDomainSelection = FALSE;
protected $enableQuota = TRUE;
protected $enableVacationRange = TRUE;
protected $enableVacationRange = FALSE;
protected $enableFolderTypes = FALSE;
protected function init()
......
......@@ -34,7 +34,7 @@ class mailMethodKolab extends mailMethodCyrus
/* Enabled mail domain selection. If enabled getMailDomains must the domain parts */
protected $enableDomainSelection = FALSE;
protected $enableQuota = TRUE;
protected $enableVacationRange = TRUE;
protected $enableVacationRange = FALSE;
protected $enableFolderTypes = TRUE;
protected $attributes = array(
......
......@@ -32,7 +32,7 @@ class mailMethodKolab22 extends mailMethodKolab
/* Enabled mail domain selection. If enabled getMailDomains must the domain parts */
protected $enableDomainSelection = TRUE;
protected $enableQuota = TRUE;
protected $enableVacationRange = TRUE;
protected $enableVacationRange = FALSE;
protected $enableFolderTypes = TRUE;
protected $userObjectClasses = array("kolabInetOrgPerson");
......
......@@ -22,7 +22,6 @@
class mailMethod
{
/* Allow modification of account_ids for existing mail accounts */
protected $modifyableMail = TRUE;
......@@ -76,7 +75,7 @@ class mailMethod
*/
protected $enableDomainSelection = FALSE;
protected $enableQuota = TRUE;
protected $enableVacationRange = TRUE;
protected $enableVacationRange = FALSE;
protected $enableFolderTypes = FALSE;
/* Default values */
......
......@@ -278,8 +278,33 @@ class mailAccount extends simplePlugin
$this->attributesAccess['flag_sieveownscript']->setInLdap(FALSE);
if (!$this->mailMethod->vacationRangeEnabled()) {
unset($this->attributesAccess['gosaVacationStart']);
unset($this->attributesAccess['gosaVacationStop']);
$this->attributesAccess['gosaVacationStart']->setDisabled(TRUE);
$this->attributesAccess['gosaVacationStart']->setVisible(FALSE);
$this->attributesAccess['gosaVacationStop']->setDisabled(TRUE);
$this->attributesAccess['gosaVacationStop']->setVisible(FALSE);
$this->attributesAccess['flag_vacation']->setManagedAttributes (
array (
'erase' => array (
FALSE => array (
'gosaVacationMessage'
)
)
)
);
$this->attributesAccess['flag_sieveownscript']->setManagedAttributes (
array (
'erase' => array (
TRUE => array (
'flag_vacation',
'gosaVacationMessage',
'flag_spamlevel','flag_spamsize','gosaMailMaxSize',
'gosaSpamMailbox','gosaSpamSortLevel',
'flag_ownmailbox',
'flag_localonly'
)
)
)
);
} else {
$this->attributesAccess['flag_vacation']->setManagedAttributes (
array (
......@@ -290,6 +315,20 @@ class mailAccount extends simplePlugin
)
)
);
$this->attributesAccess['flag_sieveownscript']->setManagedAttributes (
array (
'erase' => array (
TRUE => array (
'flag_vacation',
'gosaVacationStart','gosaVacationStop','gosaVacationMessage',
'flag_spamlevel','flag_spamsize','gosaMailMaxSize',
'gosaSpamMailbox','gosaSpamSortLevel',
'flag_ownmailbox',
'flag_localonly'
)
)
)
);
}
$this->attributesAccess['flag_spamlevel']->setManagedAttributes (
......@@ -309,20 +348,6 @@ class mailAccount extends simplePlugin
)
);
$this->attributesAccess['flag_sieveownscript']->setManagedAttributes (
array (
'erase' => array (
TRUE => array (
'flag_vacation',
'gosaVacationStart','gosaVacationStop','gosaVacationMessage',
'flag_spamlevel','flag_spamsize','gosaMailMaxSize',
'gosaSpamMailbox','gosaSpamSortLevel',
'flag_ownmailbox',
'flag_localonly'
)
)
)
);
/* sieve submit the form so that managed attributes are correctly updated */
$this->attributesAccess['flag_sieveownscript']->setSubmitForm(TRUE);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment