summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e9b6681)
raw | patch | inline | side by side (parent: e9b6681)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 Dec 2007 13:32:03 +0000 (13:32 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 Dec 2007 13:32:03 +0000 (13:32 +0000) |
-Vacation start stop saving
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8149 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8149 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/personal/mail/class_mailAccount.inc | patch | blob | history |
diff --git a/gosa-core/plugins/personal/mail/class_mailAccount.inc b/gosa-core/plugins/personal/mail/class_mailAccount.inc
index ab3c46585d6ff1f9f804b1338f9719adfac6e6b7..bb00ffa84d74bf16e66c403c6147b412612b51bb 100644 (file)
}
/* Replace attributes */
- $attrs= $this->parent->by_object['user']->attributes;
- foreach ($attrs as $val){
-
- 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);
+ $attrs = array();
+ $obj = NULL;
+ if(isset($this->parent->by_object['user'])){
+ $attrs = $this->parent->by_object['user']->attributes;
+ $obj = $this->parent->by_object['user'];
+ }else{
+ $obj = new user($this->config,$this->dn);
+ $attrs = $obj->attributes;
+ }
+
+ if($obj){
+ foreach ($attrs as $val){
+ if(preg_match("/dateOfBirth/",$val)){
+ if($obj->use_dob){
+ $contents= preg_replace("/%$val/",date("Y-d-m",$obj->dateOfBirth),$contents);
+ }
+ }else {
+ $contents= preg_replace("/%$val/",
+ $obj->$val, $contents);
+ }
+
+ /* Replace vacation start and end time */
+ if(preg_match("/%start/",$contents)){
+ $contents = preg_replace("/%start/",date("d.m.Y",$this->gosaVacationStart),$contents);
+ }
+ if(preg_match("/%end/",$contents)){
+ $contents = preg_replace("/%end/",date("d.m.Y",$this->gosaVacationStop),$contents);
}
- }else {
- $contents= preg_replace("/%$val/",
- $this->parent->by_object['user']->$val, $contents);
- }
-
- /* Replace vacation start and end time */
- if(preg_match("/%start/",$contents)){
- $contents = preg_replace("/%start/",date("d.m.Y",$this->gosaVacationStart),$contents);
- }
- if(preg_match("/%end/",$contents)){
- $contents = preg_replace("/%end/",date("d.m.Y",$this->gosaVacationStop),$contents);
}
}
$this->is_modified= TRUE;
}
$this->gosaMailDeliveryMode= $tmp;
+
+
+ if($this->acl_is_writeable("gosaVacationMessage") && preg_match("/V/",$this->gosaMailDeliveryMode)){
+ if(isset($_POST['gosaVacationStart'])){
+ $this->gosaVacationStart = $_POST['gosaVacationStart'];
+ }
+ if(isset($_POST['gosaVacationStop'])){
+ $this->gosaVacationStop = $_POST['gosaVacationStop'];
+ }
+ }
}
}
-
}