From 37f76431eee2e720673ce46e628451947eecb110 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 24 Sep 2007 19:11:18 +0000 Subject: [PATCH] show infinity symbol for too big values --- lam/lib/modules/sambaSamAccount.inc | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index 7548a057..0cd16a50 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -920,8 +920,13 @@ class sambaSamAccount extends baseModule { $dateValue = "     -      "; if (isset($this->attributes['sambaPwdCanChange'][0])) { - $date = getdate($this->attributes['sambaPwdCanChange'][0]); - $dateValue = $date['mday'] . "." . $date['mon'] . "." . $date['year']; + if ($this->attributes['sambaPwdCanChange'][0] > 2147483648) { + $dateValue = "     ∞      "; + } + else { + $date = getdate($this->attributes['sambaPwdCanChange'][0]); + $dateValue = $date['mday'] . "." . $date['mon'] . "." . $date['year']; + } } $return[] = array( array('kind' => 'text', 'text' => _('User can change password')), @@ -932,8 +937,13 @@ class sambaSamAccount extends baseModule { array('kind' => 'help', 'value' => 'pwdCanChange' )); $dateValue = "     -      "; if (isset($this->attributes['sambaPwdMustChange'][0])) { - $date = getdate($this->attributes['sambaPwdMustChange'][0]); - $dateValue = $date['mday'] . "." . $date['mon'] . "." . $date['year']; + if ($this->attributes['sambaPwdMustChange'][0] > 2147483648) { + $dateValue = "     ∞      "; + } + else { + $date = getdate($this->attributes['sambaPwdMustChange'][0]); + $dateValue = $date['mday'] . "." . $date['mon'] . "." . $date['year']; + } } $return[] = array( array('kind' => 'text', 'text' => _('User must change password')), @@ -944,8 +954,13 @@ class sambaSamAccount extends baseModule { array('kind' => 'help', 'value' => 'pwdMustChange' )); $dateValue = "     -      "; if (isset($this->attributes['sambaKickoffTime'][0])) { - $date = getdate($this->attributes['sambaKickoffTime'][0]); - $dateValue = $date['mday'] . "." . $date['mon'] . "." . $date['year']; + if ($this->attributes['sambaKickoffTime'][0] > 2147483648) { + $dateValue = "     ∞      "; + } + else { + $date = getdate($this->attributes['sambaKickoffTime'][0]); + $dateValue = $date['mday'] . "." . $date['mon'] . "." . $date['year']; + } } $return[] = array( array('kind' => 'text', 'text' => _('Account expiration date')),