index 12f8546db47fb28dd6ff7717ba978234234ae254..a300ea2ac5dfc96e0932980e0142067595ef4dea 100644 (file)
/* Initialize the class and load all sieve scripts
* try to parse them and display errors
*/
- function sieveManagement($config,$dn,$parent,$uattrib)
+ function sieveManagement(&$config,$dn,&$parent,$uattrib)
{
/* 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;
- $this->parent = $parent;
+ $this->parent = &$parent;
plugin::plugin($config,$dn);
/* Get sieve, if this fail abort class initialization */
/* Is given name in lower case characters ? */
if($name != strtolower($name)){
$err =true;
- print_red(_("Only lower case names are allowed here."));
+ print_red(_("Only lower case names are allowed."));
}
/* Only chars are allowed here */
if(preg_match("/[^a-z]/i",$name)){
$err =true;
- print_red(_("Only a-z are allowed in script names."));
+ print_red(_("Only alphabetical characters are allowed in script names."));
}
$tmp = $this->get_used_script_names();
}
}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));
}
}
}
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{
$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);
}
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'>".