From: hickert Date: Wed, 21 Jul 2010 13:30:05 +0000 (+0000) Subject: FIxed posix template adaption X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2fa199e0738ef1f6478663922ec140e612886c83;p=gosa.git FIxed posix template adaption git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@19041 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 6c31a1764..c717b0f14 100644 --- a/gosa-core/plugins/personal/posix/class_posixAccount.inc +++ b/gosa-core/plugins/personal/posix/class_posixAccount.inc @@ -1248,21 +1248,18 @@ 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"; + $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)