From 29cf39ee4d5854f40df695a679b3bd835d879124 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 18 Feb 2012 13:47:49 +0000 Subject: [PATCH] sync with Kerberos --- lam/lib/modules/sambaSamAccount.inc | 15 ++++++++++++++- lam/lib/modules/shadowAccount.inc | 13 +++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index ab73c1e9..3b8db252 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -438,7 +438,7 @@ class sambaSamAccount extends baseModule implements passwordService { 'description' => _('Account expiration date'), 'help' => 'expireDate', 'default' => '31-12-2030', - 'example' => '15-10-2006' + 'example' => '15-10-2020' ), array( 'name' => 'sambaSamAccount_group', @@ -978,18 +978,28 @@ class sambaSamAccount extends baseModule implements passwordService { if (strpos($buttonName, '_change') !== false) { // set new time $this->setExpirationDate($_POST['expire_yea'], $_POST['expire_mon'], $_POST['expire_day']); + // sync other modules if (isset($_POST['syncShadow']) && ($_POST['syncShadow'] == 'on')) { $this->getAccountContainer()->getAccountModule('shadowAccount')->setExpirationDate( $_POST['expire_yea'], $_POST['expire_mon'], $_POST['expire_day']); } + if (isset($_POST['syncHeimdal']) && ($_POST['syncHeimdal'] == 'on')) { + $this->getAccountContainer()->getAccountModule('heimdalKerberos')->setExpirationDate( + $_POST['expire_yea'], $_POST['expire_mon'], $_POST['expire_day']); + } } elseif (strpos($buttonName, '_del') !== false) { // remove attribute value unset($this->attributes[$attr]); + // sync other modules if (isset($_POST['syncShadow']) && ($_POST['syncShadow'] == 'on')) { $this->getAccountContainer()->getAccountModule('shadowAccount')->setExpirationDate( null, null, null); } + if (isset($_POST['syncHeimdal']) && ($_POST['syncHeimdal'] == 'on')) { + $this->getAccountContainer()->getAccountModule('heimdalKerberos')->setExpirationDate( + null, null, null); + } } return $return; } @@ -1389,6 +1399,9 @@ class sambaSamAccount extends baseModule implements passwordService { if ($this->getAccountContainer()->getAccountModule('shadowAccount') != null) { $return->addElement(new htmlTableExtendedInputCheckbox('syncShadow', false, _('Set also for Shadow')), true); } + if ($this->getAccountContainer()->getAccountModule('heimdalKerberos') != null) { + $return->addElement(new htmlTableExtendedInputCheckbox('syncHeimdal', false, _('Set also for Kerberos')), true); + } $return->addElement(new htmlSpacer(null, '10px'), true); $buttons = new htmlTable(); $buttons->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'change' . $attr, _('Change'))); diff --git a/lam/lib/modules/shadowAccount.inc b/lam/lib/modules/shadowAccount.inc index a07a7fdc..d3c48489 100644 --- a/lam/lib/modules/shadowAccount.inc +++ b/lam/lib/modules/shadowAccount.inc @@ -382,18 +382,28 @@ class shadowAccount extends baseModule implements passwordService { // set expiration date if (isset($_POST['form_subpage_shadowAccount_attributes_change'])) { $this->setExpirationDate($_POST['shadowExpire_yea'], $_POST['shadowExpire_mon'], $_POST['shadowExpire_day']); + // sync other modules if (isset($_POST['syncSamba']) && ($_POST['syncSamba'] == 'on')) { $this->getAccountContainer()->getAccountModule('sambaSamAccount')->setExpirationDate( $_POST['shadowExpire_yea'], $_POST['shadowExpire_mon'], $_POST['shadowExpire_day']); } + if (isset($_POST['syncHeimdal']) && ($_POST['syncHeimdal'] == 'on')) { + $this->getAccountContainer()->getAccountModule('heimdalKerberos')->setExpirationDate( + $_POST['shadowExpire_yea'], $_POST['shadowExpire_mon'], $_POST['shadowExpire_day']); + } } // remove expiration date elseif (isset($_POST['form_subpage_shadowAccount_attributes_del'])) { unset($this->attributes['shadowExpire']); + // sync other modules if (isset($_POST['syncSamba']) && ($_POST['syncSamba'] == 'on')) { $this->getAccountContainer()->getAccountModule('sambaSamAccount')->setExpirationDate( null, null, null); } + if (isset($_POST['syncHeimdal']) && ($_POST['syncHeimdal'] == 'on')) { + $this->getAccountContainer()->getAccountModule('heimdalKerberos')->setExpirationDate( + null, null, null); + } } return $errors; } @@ -423,6 +433,9 @@ class shadowAccount extends baseModule implements passwordService { if ($this->getAccountContainer()->getAccountModule('sambaSamAccount') != null) { $return->addElement(new htmlTableExtendedInputCheckbox('syncSamba', false, _('Set also for Samba 3')), true); } + if ($this->getAccountContainer()->getAccountModule('heimdalKerberos') != null) { + $return->addElement(new htmlTableExtendedInputCheckbox('syncHeimdal', false, _('Set also for Kerberos')), true); + } $return->addElement(new htmlSpacer(null, '10px'), true); $buttonTable = new htmlTable(); $buttonTable->addElement(new htmlAccountPageButton('shadowAccount', 'attributes', 'change', _('Change')));