From 8e19ad66b0980cd273eda15245f154cfc05b5104 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 5 Feb 2007 04:50:52 +0000 Subject: [PATCH] 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 --- plugins/personal/mail/class_mailAccount.inc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 */ -- 2.30.2