From: hickert Date: Wed, 21 Jul 2010 13:28:57 +0000 (+0000) Subject: Fixed problem with shadow expire and template adaption X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=160cbaef820075559aa0228522f592608dfbf3bc;p=gosa.git Fixed problem with shadow expire and template adaption git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19040 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc index 5222ff337..6df03a564 100644 --- a/gosa-core/plugins/personal/posix/class_posixAccount.inc +++ b/gosa-core/plugins/personal/posix/class_posixAccount.inc @@ -1079,21 +1079,17 @@ class posixAccount extends plugin } } - /* FIXME: NEED review of this section */ - /* Need to check shadowExpire separately */ - - /* - * If shadowExpire is not enabled in the template, it's a UNIX timestamp - so don't convert it to seconds. - * The check is a hack - if difference between timestamp generated above and here is max 1 day. - */ - if(abs($this->shadowExpire - time())>86400) { - $this->shadowExpire= $this->convertToSeconds($this->shadowExpire); - } - /* Only enable checkbox, if shadowExpire is in the future */ if($this->shadowExpire > time()) { $this->activate_shadowExpire= "1"; } + + /* Convert shadowExpire for usage */ + if ($this->shadowExpire == 0){ + $this->shadowExpire= ""; + } else { + $this->shadowExpire= date('d.m.Y', $this->shadowExpire * 60 * 60 * 24); + } } function convertToSeconds($val)