From 2fa199e0738ef1f6478663922ec140e612886c83 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 21 Jul 2010 13:30:05 +0000 Subject: [PATCH] FIxed posix template adaption git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@19041 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/posix/class_posixAccount.inc | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) 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) -- 2.30.2