From: hickert Date: Mon, 5 Feb 2007 04:50:52 +0000 (+0000) Subject: Fixed replacing of dateOfBirth in vacation templates X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8e19ad66b0980cd273eda15245f154cfc05b5104;p=gosa.git Fixed replacing of dateOfBirth in vacation templates git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5687 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc index 96c09aa18..93662308d 100644 --- a/plugins/personal/mail/class_mailAccount.inc +++ b/plugins/personal/mail/class_mailAccount.inc @@ -406,8 +406,15 @@ class mailAccount extends plugin /* Replace attributes */ $attrs= $this->parent->by_object['user']->attributes; foreach ($attrs as $val){ - $contents= preg_replace("/%$val/", - $this->parent->by_object['user']->$val, $contents); + + if(preg_match("/dateOfBirth/",$val)){ + if($this->parent->by_object['user']->use_dob){ + $contents= preg_replace("/%$val/",date("Y-d-m",$this->parent->by_object['user']->dateOfBirth),$contents); + } + }else { + $contents= preg_replace("/%$val/", + $this->parent->by_object['user']->$val, $contents); + } } /* Save message */