From bc1145533c9d2162be68e36c37c1c3882468deb5 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 7 Nov 2011 09:48:08 +0000 Subject: [PATCH] * email/sieve: improved vacation script handling: be more talkative to the user on rule validation errors while saving --- emailadmin/inc/class.emailadmin_script.inc.php | 9 +++++---- felamimail/inc/class.uisieve.inc.php | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/emailadmin/inc/class.emailadmin_script.inc.php b/emailadmin/inc/class.emailadmin_script.inc.php index 7dbf7c9f1c..7c459ff594 100644 --- a/emailadmin/inc/class.emailadmin_script.inc.php +++ b/emailadmin/inc/class.emailadmin_script.inc.php @@ -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 "
$newscript
"; exit; + //error_log(__METHOD__.__LINE__.array2string($newscript)); + //print "
$newscript
"; exit; $scriptfile = $this->name; - #print "
".htmlentities($newscript)."

"; + //print "
".htmlentities($newscript)."

"; if (!$connection->installScript($this->name, $newscript, true)) { $this->errstr = 'updateScript: putscript failed: ' . $connection->errstr; error_log(__METHOD__.__LINE__.' # Error: ->'.$this->errstr); diff --git a/felamimail/inc/class.uisieve.inc.php b/felamimail/inc/class.uisieve.inc.php index ed14b877fc..f6b35c0069 100644 --- a/felamimail/inc/class.uisieve.inc.php +++ b/felamimail/inc/class.uisieve.inc.php @@ -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('
',$this->errorStack)); } }