Code

Some changes
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 14 Mar 2007 06:19:07 +0000 (06:19 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 14 Mar 2007 06:19:07 +0000 (06:19 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5778 594d385d-05f5-0310-b6e9-bd551577e9d8

include/sieve/class_My_Tree.inc
include/sieve/class_sieveElement_Else_Elsif.inc
include/sieve/class_sieveElement_Fileinto.inc
include/sieve/class_sieveElement_If.inc
include/sieve/class_sieveElement_Vacation.inc
include/sieve/class_sieveManagement.inc

index 826817b88778fd5c649ee4abf2656356de6d9130..8167ad8b8c9e12b2d58ba9ed02a60ea51c73b73d 100644 (file)
@@ -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"),
index 10a454eb27031f9d3841108ee6f902c24e88502e..e4b8046f81d05923800a4cf35d23d8dfb7be61d1 100644 (file)
@@ -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;
index c15dc444ca27c33546c46a436ede7195df8775a9..16b8c26d735d4b240ca1fc7ad098e63876f90c32 100644 (file)
@@ -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']);
index 2cd0a65041eb08fd73c6c4505c338b65a18e98a7..819ebe00296cb397372ebf8787c230022bbfff23 100644 (file)
@@ -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."<br>" ;
           }
         }
       }
@@ -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;
       }
 
index 95e6ef216e45d965c9a42bd2e0500055c8b61c6e..7de20b9d6f9b84390fd329049512d5d3b6effcca 100644 (file)
@@ -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 ++){
 
index 22db80a40ceda5b74155206f5672806960142bfe..cfbbb748ec2520d443a5d2751e14df5ab754cf23 100644 (file)
@@ -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."));
       }
     }