* email/sieve: improved vacation script handling: be more talkative to the user on rule validation errors while saving

This commit is contained in:
Klaus Leithoff 2011-11-07 09:48:08 +00:00
parent bd616f8a34
commit bc1145533c
2 changed files with 7 additions and 4 deletions

View File

@ -363,8 +363,8 @@ class emailadmin_script {
if ($this->vacation) {
$vacation = $this->vacation;
if (!$vacation['days']) $vacation['days'] = $default->vacation_days;
if (!$vacation['text']) $vacation['text'] = $default->vacation_text;
if (!$vacation['days']) $vacation['days'] = ($default->vacation_days ? $default->vacation_days:'');
if (!$vacation['text']) $vacation['text'] = ($default->vacation_text ? $default->vacation_text:'');
if (!$vacation['status']) $vacation['status'] = 'on';
// filter out invalid addresses.
@ -505,9 +505,10 @@ class emailadmin_script {
$newscript = $newscripthead . $newscriptbody . $newscriptfoot;
$this->script = $newscript;
#print "<pre>$newscript</pre>"; exit;
//error_log(__METHOD__.__LINE__.array2string($newscript));
//print "<pre>$newscript</pre>"; exit;
$scriptfile = $this->name;
#print "<hr><pre>".htmlentities($newscript)."</pre><hr>";
//print "<hr><pre>".htmlentities($newscript)."</pre><hr>";
if (!$connection->installScript($this->name, $newscript, true)) {
$this->errstr = 'updateScript: putscript failed: ' . $connection->errstr;
error_log(__METHOD__.__LINE__.' # Error: ->'.$this->errstr);

View File

@ -287,6 +287,7 @@
}
else
{
$this->errorStack['message'] = lang('Vacation notice is not saved yet! (But we filled in some defaults to cover some of the above errors. Please correct and check your settings and save again.)');
return false;
}
}
@ -601,6 +602,7 @@
}
else
{
if(isset($_POST['save'])) unset($_POST['save']);
$this->t->set_var('validation_errors',implode('<br />',$this->errorStack));
}
}