Code

Added DNS and DHCP enable disable options into setup step 2
[gosa.git] / include / sieve / class_sieveManagement.inc
index ba01e0cf3aaa0bbe50a4a26b2d617e99b4afca3a..90b4b54efc1abed34864ce5db604017247889de5 100644 (file)
@@ -62,7 +62,7 @@ class sieveManagement extends plugin
   {
     /* Check given parameter */
     if(!isset($parent->$uattrib)){
-      trigger_error("Sieve Management implementation error. Parameter 4 must be part of the given parent element.");
+      trigger_error("Sieve Management implementation error. Parameter 4 (".$uattrib.") must be part of the given parent element (".get_class($parent).").");
     }
 
     $this->uattrib = $uattrib;
@@ -406,7 +406,7 @@ class sieveManagement extends plugin
         }
       }else{
         foreach($chk as $msgs){
-          print_red(sprintf(_("Please fix all errors before saving. Last error was : %s"),$msgs));
+          print_red(sprintf(_("Please fix all errors before saving. Last error was: %s"),$msgs));
         }
       }
     }
@@ -435,9 +435,9 @@ class sieveManagement extends plugin
           if($file['size'] == 0){
             print_red(_("Specified file seems to be empty."));
           }elseif(!file_exists($file['tmp_name'])){
-            print_red(_("Upload failed, somehow nothing was uploaded or the temporary file can't be accessed."));
+            print_red(_("Upload failed. The temporary file can't be accessed."));
           }elseif(!is_readable ($file['tmp_name'])){
-            print_red(sprintf(_("Can't open file '%s' to read uploaded file contents."),$file['tmp_name']));
+            print_red(sprintf(_("Can't open file '%s'."),$file['tmp_name']));
           }else{
             
             
@@ -796,6 +796,15 @@ class sieveManagement extends plugin
       $ele[] = new sieve_block_end(NULL,preg_replace("/[^0-9]/","",microtime()),$parent);
       $ele[] = new $this->add_element_type(NULL, preg_replace("/[^0-9]/","",microtime()),$parent);
       $ele[] = new sieve_block_start(NULL,preg_replace("/[^0-9]/","",microtime()),$parent);
+    }elseif($this->add_element_type == "sieve_vacation"){
+
+      /* Automatically add addresses to sieve alternate addresses */
+      $data = NULL;
+      $tmp = new $this->add_element_type($data, preg_replace("/[^0-9]/","",microtime()),$parent);
+      if(isset($this->parent->gosaMailAlternateAddress)){
+        $tmp->addresses = $this->parent->gosaMailAlternateAddress;
+      }
+      $ele[] = $tmp ;
     }else{
       $ele[] = new $this->add_element_type(NULL, preg_replace("/[^0-9]/","",microtime()),$parent);
     }
@@ -1039,7 +1048,8 @@ class sieveManagement extends plugin
       if($script['EDITED']){
         $data = $this->scripts[$key]['SCRIPT'];
         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));
+          new log("modify","users/mailAccount".get_class($this),$script['NAME'],"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));
           $this->scripts[$key]['MSG'] = "<font color='red'>".