From 714914a8454a80be1523dc5bd6ce6c7e18a761df Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 25 Mar 2008 19:01:10 +0000 Subject: [PATCH] fixed expiry times --- lam/lib/modules/phpGroupwareUser.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lam/lib/modules/phpGroupwareUser.inc b/lam/lib/modules/phpGroupwareUser.inc index fae38d21..1240dc37 100644 --- a/lam/lib/modules/phpGroupwareUser.inc +++ b/lam/lib/modules/phpGroupwareUser.inc @@ -134,7 +134,7 @@ class phpGroupwareUser extends baseModule { $return = array(); if (isset($this->attributes['objectClass']) && in_array('phpgwAccount', $this->attributes['objectClass'])) { $phpgwAccountExpires = ''; - if (isset($this->attributes['phpgwAccountExpires'][0])) { + if (isset($this->attributes['phpgwAccountExpires'][0]) && ($this->attributes['phpgwAccountExpires'][0] != "-1")) { $date = getdate($this->attributes['phpgwAccountExpires'][0]); $phpgwAccountExpires = $date['mday'] . '.' . $date['mon'] . '.' . $date['year']; } @@ -195,6 +195,7 @@ class phpGroupwareUser extends baseModule { public function process_attributes() { if (isset($_POST['form_subpage_phpGroupwareUser_attributes_addObjectClass'])) { $this->attributes['objectClass'][] = 'phpgwAccount'; + $this->attributes['phpgwAccountExpires'][0] = "-1"; } elseif (isset($_POST['form_subpage_phpGroupwareUser_attributes_remObjectClass'])) { for ($i = 0; $i < sizeof($this->attributes['objectClass']); $i++) { @@ -224,8 +225,8 @@ class phpGroupwareUser extends baseModule { $text = _('Account expiration date'); $help = "phpgwAccountExpires"; } - $time = 0; - if (isset($this->attributes[$attr][0])) { + $time = time(); + if (isset($this->attributes[$attr][0]) && ($this->attributes[$attr][0] != "-1")) { $time = $this->attributes[$attr][0]; } $date = getdate($time); @@ -281,7 +282,7 @@ class phpGroupwareUser extends baseModule { } elseif (strpos($buttonName, '_del') !== false) { // remove attribute value - unset($this->attributes[$attr]); + $this->attributes[$attr][0] = "-1"; } return $return; } @@ -429,6 +430,9 @@ class phpGroupwareUser extends baseModule { $messages[] = $errMsg; } } + else { + $partialAccounts[$i]['phpgwAccountExpires'] = "-1"; + } } return $messages; }