index 33c730945c693f604b812a5428435461f326e40c..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)){
}
$this->uattrib = $uattrib;
- $this->parent = $parent;
+ $this->parent = &$parent;
plugin::plugin($config,$dn);
/* Get sieve, if this fail abort class initialization */
$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,"\\"))){
- @log::log("modify","users/mailAccount".get_class($this),$script['NAME'],"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));