Remove scriptName which is no longer neccessary to be set, as we set it in emailadmin_seive anyway

This commit is contained in:
Hadi Nategh 2014-05-20 17:22:52 +00:00
parent 467c715ddc
commit 8bbba434c2

View File

@ -191,7 +191,7 @@ class mail_sieve
}
if (isset($content['externalEmail']) && !empty($content['externalEmail']))
{
if (!$this->account->imapServer()->setEmailNotification($this->scriptName, $newEmailNotification))
if (!$this->account->imapServer()->setEmailNotification(null, $newEmailNotification))
{
$msg = lang("email notification update failed")."<br />";
break;
@ -334,7 +334,7 @@ class mail_sieve
if($newRule['action'] && $this->rulesByID['priority'])
{
$this->rules[$ruleID] = $newRule;
$ret = $this->account->imapServer()->setRules($this->scriptName, $this->rules);
$ret = $this->account->imapServer()->setRules(null, $this->rules);
if (!$ret && !empty($this->account->imapServer()->error))
{
$msg .= lang("Saving the rule failed:")."<br />".$this->account->imapServer()->error."<br />";
@ -415,25 +415,17 @@ class mail_sieve
throw new egw_exception_no_permission();
}
if($this->account->imapServer()->getScript($this->scriptName))
{
if(PEAR::isError($error = $this->account->imapServer()->retrieveRules($this->scriptName)) )
if(PEAR::isError($error = $this->account->imapServer()->retrieveRules()) )
{
$rules = array();
$emailNotification = array();
}
else
{
$rules = $this->account->imapServer()->getRules($this->scriptName);
$emailNotification = $this->account->imapServer()->getEmailNotification($this->scriptName);
}
}
else
{
// something went wrong
error_log(__METHOD__.__LINE__.' failed');
return false;
$rules = $this->account->imapServer()->getRules();
$emailNotification = $this->account->imapServer()->getEmailNotification();
}
return $emailNotification;
}
@ -459,7 +451,7 @@ class mail_sieve
else
{
$icServer = $this->account->imapServer();
$icServer->retrieveRules($this->scriptName);
$icServer->retrieveRules();
$vacation = $icServer->getVacation();
}
}
@ -637,10 +629,6 @@ class mail_sieve
}
else
{
if (!isset($newVacation['scriptName']) || empty($newVacation['scriptName']))
{
$newVacation['scriptName'] = $this->scriptName;
}
$icServer->setAsyncJob($newVacation);
$msg = lang('Vacation notice sucessfully updated.');
}
@ -1091,10 +1079,7 @@ class mail_sieve
*/
function getRules($ruleID = null)
{
if(($script = $this->account->imapServer()->getScript($this->scriptName)))
{
$this->scriptToEdit = $this->scriptName;
if(PEAR::isError($error = $this->account->imapServer()->retrieveRules($this->scriptName)) )
if(PEAR::isError($error = $this->account->imapServer()->retrieveRules()) )
{
error_log(__METHOD__.__LINE__.$error->message);
$this->rules = array();
@ -1103,20 +1088,12 @@ class mail_sieve
}
else
{
$this->rules = $this->account->imapServer()->getRules($this->scriptName);
$this->rules = $this->account->imapServer()->getRules();
$this->rulesByID = $this->rules[$ruleID];
$this->vacation = $this->account->imapServer()->getVacation($this->scriptName);
$this->vacation = $this->account->imapServer()->getVacation();
}
return true;
}
else
{
// something went wrong
error_log(__METHOD__.__LINE__.' failed');
return false;
}
//error_log(__METHOD__.array2string( $script));
}
/**