mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-21 18:31:37 +02:00
need to check timed Sieve available on icServer object not mail account, to allow plugins to overwrite it
This commit is contained in:
parent
e6304eec45
commit
c707a25b5a
@ -20,12 +20,6 @@ class mail_sieve
|
|||||||
'edit' => True,
|
'edit' => True,
|
||||||
'editEmailNotification'=> True, // Added email notifications
|
'editEmailNotification'=> True, // Added email notifications
|
||||||
);
|
);
|
||||||
/**
|
|
||||||
* Flag if we can do a timed vaction message, requires Cyrus Admin User/Pw to enable/disable via async service
|
|
||||||
*
|
|
||||||
* @var boolean
|
|
||||||
*/
|
|
||||||
var $timed_vacation;
|
|
||||||
|
|
||||||
var $errorStack;
|
var $errorStack;
|
||||||
|
|
||||||
@ -81,7 +75,7 @@ class mail_sieve
|
|||||||
/**
|
/**
|
||||||
* account object
|
* account object
|
||||||
*
|
*
|
||||||
* @var emailadmin_imap
|
* @var emailadmin_account
|
||||||
*/
|
*/
|
||||||
var $account;
|
var $account;
|
||||||
|
|
||||||
@ -114,8 +108,6 @@ class mail_sieve
|
|||||||
$this->mailConfig = config::read('mail');
|
$this->mailConfig = config::read('mail');
|
||||||
|
|
||||||
$this->restoreSessionData();
|
$this->restoreSessionData();
|
||||||
|
|
||||||
$this->timed_vacation = $this->account->acc_sieve_enabled && $this->account->acc_imap_administration;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -509,7 +501,6 @@ class mail_sieve
|
|||||||
*/
|
*/
|
||||||
function editVacation($content=null, $msg='')
|
function editVacation($content=null, $msg='')
|
||||||
{
|
{
|
||||||
|
|
||||||
//Instantiate an etemplate_new object, representing the sieve.vacation template
|
//Instantiate an etemplate_new object, representing the sieve.vacation template
|
||||||
$vtmpl = new etemplate_new('mail.sieve.vacation');
|
$vtmpl = new etemplate_new('mail.sieve.vacation');
|
||||||
$vacation = array();
|
$vacation = array();
|
||||||
@ -541,16 +532,16 @@ class mail_sieve
|
|||||||
$this->account = $accounts[$profileID];
|
$this->account = $accounts[$profileID];
|
||||||
|
|
||||||
$this->is_admin_vac = true;
|
$this->is_admin_vac = true;
|
||||||
$this->timed_vacation = $this->account->acc_sieve_enabled && $this->account->acc_imap_administration;
|
|
||||||
$preserv['account_id'] = $account_id;
|
$preserv['account_id'] = $account_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$icServer = $this->account->imapServer($this->is_admin_vac ? $account_id : false);
|
||||||
|
|
||||||
if ( $this->account->acc_sieve_enabled)
|
if ($icServer->acc_sieve_enabled)
|
||||||
{
|
{
|
||||||
$vacRules = $this->getVacation($account_id);
|
$vacRules = $this->getVacation($account_id);
|
||||||
|
|
||||||
if ($this->timed_vacation)
|
if ($icServer->acc_imap_administration)
|
||||||
{
|
{
|
||||||
$ByDate = array('by_date' => lang('By date'));
|
$ByDate = array('by_date' => lang('By date'));
|
||||||
}
|
}
|
||||||
@ -640,11 +631,11 @@ class mail_sieve
|
|||||||
{
|
{
|
||||||
if (isset($account_id) && $this->mail_admin)
|
if (isset($account_id) && $this->mail_admin)
|
||||||
{
|
{
|
||||||
$resSetvac = $this->account->imapServer()->setVacationUser($account_id,$this->scriptName, $newVacation);
|
$resSetvac = $icServer->setVacationUser($account_id,$this->scriptName, $newVacation);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$resSetvac = $this->account->imapServer()->setVacation($this->scriptName, $newVacation);
|
$resSetvac = $icServer->setVacation($this->scriptName, $newVacation);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$resSetvac)
|
if (!$resSetvac)
|
||||||
@ -658,7 +649,7 @@ class mail_sieve
|
|||||||
{
|
{
|
||||||
$newVacation['scriptName'] = $this->scriptName;
|
$newVacation['scriptName'] = $this->scriptName;
|
||||||
}
|
}
|
||||||
$this->account->imapServer()->setAsyncJob($newVacation);
|
$icServer->setAsyncJob($newVacation);
|
||||||
$msg = lang('Vacation notice sucessfully updated.');
|
$msg = lang('Vacation notice sucessfully updated.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -670,7 +661,7 @@ class mail_sieve
|
|||||||
$response = egw_json_response::get();
|
$response = egw_json_response::get();
|
||||||
$response->call('app.mail.mail_callRefreshVacationNotice',$this->mailbo->profileID);
|
$response->call('app.mail.mail_callRefreshVacationNotice',$this->mailbo->profileID);
|
||||||
egw_framework::refresh_opener($msg, 'mail','edit');
|
egw_framework::refresh_opener($msg, 'mail','edit');
|
||||||
if ($button === 'apply' || $this->account->imapServer()->error !=="")
|
if ($button === 'apply' || $icServer->error !=="")
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user