From: cajus Date: Thu, 19 Oct 2006 06:27:29 +0000 (+0000) Subject: Fixed bug #20 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a299349980a1274a8ca7bac04ad76475584aa85c;p=gosa.git Fixed bug #20 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4902 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index b7b03c299..ef67b86cd 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -175,12 +175,7 @@ class posixAccount extends plugin } /* Convert to seconds */ - if ($this->shadowExpire != 0){ - $this->shadowExpire*= 60 * 60 * 24; - } else { - $date= getdate(); - $this->shadowExpire= floor($date[0] / (60*60*24)) * 60 * 60 * 24; - } + $this->shadowExpire= $this->convertToSeconds($this->shadowExpire); /* Generate shell list from /etc/gosa/shells */ if (file_exists('/etc/gosa/shells')){ @@ -1082,8 +1077,22 @@ class posixAccount extends plugin $this->$oval= "1"; } } + + $this->shadowExpire= $this->convertToSeconds($this->shadowExpire); + } + + + function convertToSeconds($val) + { + if ($val != 0){ + $val*= 60 * 60 * 24; + } else { + $date= getdate(); + $val= floor($date[0] / (60*60*24)) * 60 * 60 * 24; + } } + function get_next_id($attrib) { $ids= array();