Code

Updated to regex support
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 22 Mar 2007 14:28:14 +0000 (14:28 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 22 Mar 2007 14:28:14 +0000 (14:28 +0000)
Size allows Byte now.
require "Regex" will be added automatically now.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5865 594d385d-05f5-0310-b6e9-bd551577e9d8

include/sieve/class_sieveElement_If.inc
include/sieve/class_sieveManagement.inc

index 702ccdb30a8130fcc19f82e02617917665a64575..56a25b385855c15872b76246ead4401f33d20d24 100644 (file)
@@ -585,6 +585,9 @@ class sieve_if
             if(!isset($match_types[$mt])){
               $parsed[$key]['LastError'] = _("Invalid match type given.");
             }
+              if($mt == ":regex"){
+                $this->parent->add_require("regex");
+              }
             $parsed[$key]['Match_type'] = $mt;
           }
 
@@ -694,8 +697,9 @@ class sieve_if
           $Match_types = array( ":over" => _("greater than") ,
                                 ":under" => _("lower than"));
 
-          $Units       = array( "M" => _("Megabyte") ,
-                                "K" => _("Kilobyte"));
+          $Units       = array( "M" => _("Megabyte"),
+                                "K" => _("Kilobyte"),
+                                ""  => _("Bytes"));
 
           /* Toggle Inverse ? */
           if(isset($_POST['toggle_inverse_'.$element_id])){
@@ -1030,8 +1034,9 @@ class sieve_if
           $Match_types = array( ":over" => _("greater than") , 
                                 ":under" => _("lower than"));
 
-          $Units       = array( "M" => _("Megabyte") , 
-                                "K" => _("Kilobyte")); 
+          $Units       = array( "M" => _("Megabyte"),
+                                "K" => _("Kilobyte"),
+                                ""  => _("Bytes"));
 
           $Match_type   = $data['Match_type'];
           $Value        = preg_replace("/[^0-9]/","",$data['Value_List'][0]);
index dff33d0fe73af84007ef550afc1acd4feb39caf9..5c963d584f190805bf9e29bacbb6ae9b7b153128 100644 (file)
@@ -889,7 +889,7 @@ class sieveManagement extends plugin
     foreach($this->scripts as $key => $script){
       if($script['EDITED']){
         $data = $this->scripts[$key]['SCRIPT'];
-        if(!$this->sieve_handle->sieve_sendscript($script['NAME'], $data)){
+        if(!$this->sieve_handle->sieve_sendscript($script['NAME'], addcslashes ($data,"\\"))){
           gosa_log("Failed to save sieve script named '".$script['NAME']."': ".to_string($this->sieve_handle->error_raw));
           $everything_went_fine = FALSE;
           print_red(to_string($this->sieve_handle->error_raw));