From: janw Date: Fri, 17 Nov 2006 08:14:48 +0000 (+0000) Subject: Bugfix: save() cause an error about dateOfBirth, if generic page has not been loaded. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4fef33b169c664bedb74ad394685424cf67cf326;p=gosa.git Bugfix: save() cause an error about dateOfBirth, if generic page has not been loaded. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5145 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 803f6ce57..4117aee96 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -690,7 +690,10 @@ class user extends plugin plugin::save (); if ($this->use_dob == "1"){ - $this->attrs['dateOfBirth']= date("Y-m-d", $this->attrs['dateOfBirth']); + /* If it is an array, the generic page has never been loaded - so there's no difference. Using an array would cause an error btw. */ + if(!is_array($this->attrs['dateOfBirth'])) { + $this->attrs['dateOfBirth']= date("Y-m-d", $this->attrs['dateOfBirth']); + } } /* Remove additional objectClasses */ $tmp= array();