From e058a5a533ea6f2158204a5391f8138fe2a87f1d Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 14 Mar 2007 06:19:07 +0000 Subject: [PATCH] Some changes git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5778 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/sieve/class_My_Tree.inc | 1 + include/sieve/class_sieveElement_Else_Elsif.inc | 5 +++++ include/sieve/class_sieveElement_Fileinto.inc | 5 +++++ include/sieve/class_sieveElement_If.inc | 8 +++++--- include/sieve/class_sieveElement_Vacation.inc | 3 +++ include/sieve/class_sieveManagement.inc | 1 + 6 files changed, 20 insertions(+), 3 deletions(-) diff --git a/include/sieve/class_My_Tree.inc b/include/sieve/class_My_Tree.inc index 826817b88..8167ad8b8 100644 --- a/include/sieve/class_My_Tree.inc +++ b/include/sieve/class_My_Tree.inc @@ -31,6 +31,7 @@ class My_Tree extends Tree "sieve_comment" => _("Comment"), "sieve_fileinto" => _("File into"), "sieve_keep" => _("Keep"), + "sieve_discard" => _("Discard"), "sieve_redirect" => _("Redirect"), "sieve_reject" => _("Reject"), "sieve_require" => _("Require"), diff --git a/include/sieve/class_sieveElement_Else_Elsif.inc b/include/sieve/class_sieveElement_Else_Elsif.inc index 10a454eb2..e4b8046f8 100644 --- a/include/sieve/class_sieveElement_Else_Elsif.inc +++ b/include/sieve/class_sieveElement_Else_Elsif.inc @@ -10,6 +10,11 @@ class sieve_else { var $object_id = -1; + function check() + { + return(array()); + } + function sieve_else($data,$object_id) { $this->object_id = $object_id; diff --git a/include/sieve/class_sieveElement_Fileinto.inc b/include/sieve/class_sieveElement_Fileinto.inc index c15dc444c..16b8c26d7 100644 --- a/include/sieve/class_sieveElement_Fileinto.inc +++ b/include/sieve/class_sieveElement_Fileinto.inc @@ -22,6 +22,11 @@ class sieve_fileinto function sieve_fileinto($data,$object_id) { $this->object_id = $object_id; + + if($data == NULL){ + $data = array('ELEMENTS' => array(array('class' => "quoted-string" ,"text" => _("")))); + } + foreach($data['ELEMENTS'] as $node ){ if(in_array($node['class'],array("quoted-string","text"))){ $this->data[] = preg_replace("/\"/","",$node['text']); diff --git a/include/sieve/class_sieveElement_If.inc b/include/sieve/class_sieveElement_If.inc index 2cd0a6504..819ebe002 100644 --- a/include/sieve/class_sieveElement_If.inc +++ b/include/sieve/class_sieveElement_If.inc @@ -112,7 +112,9 @@ class sieve_if default: { if(isset($data['LastError']) && !empty($data['LastError'])){ - $ret[] = $data['LastError']; + $ret[] = $data['LastError']; + + echo "'".$data['LastError']."' ".$key."
" ; } } } @@ -1148,13 +1150,13 @@ class sieve_if case "true": { $tmp['true'] = "true"; - $tmp[$type]['LastError'] = ""; + $tmp['true']['LastError'] = ""; break; } case "false": { $tmp['false'] = "false"; - $tmp[$type]['LastError'] = ""; + $tmp['false']['LastError'] = ""; break; } diff --git a/include/sieve/class_sieveElement_Vacation.inc b/include/sieve/class_sieveElement_Vacation.inc index 95e6ef216..7de20b9d6 100644 --- a/include/sieve/class_sieveElement_Vacation.inc +++ b/include/sieve/class_sieveElement_Vacation.inc @@ -21,6 +21,9 @@ class sieve_vacation /* Not all attribute types are supported by the sieve class right now */ $known_attrs = array(":days",":subject",":from",":mime",":handle"); + /* skip if empty */ + if($data == NULL) return; + /* Walk through elements */ for($i = 0 ; $i < count($data['ELEMENTS']) ; $i ++){ diff --git a/include/sieve/class_sieveManagement.inc b/include/sieve/class_sieveManagement.inc index 22db80a40..cfbbb748e 100644 --- a/include/sieve/class_sieveManagement.inc +++ b/include/sieve/class_sieveManagement.inc @@ -210,6 +210,7 @@ class sieveManagement extends plugin $this->scripts[$this->current_script]['EDITED'] = TRUE; $this->current_handler = NULL; }else{ + print_a($chk); print_red(_("Please fix all errors before saving.")); } } -- 2.30.2