Commit 85cbd036 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes: #2170 sambaPwdCanChange is obsolete

parent 9387b5b8
...@@ -298,8 +298,7 @@ class sambaAccount extends simplePlugin ...@@ -298,8 +298,7 @@ class sambaAccount extends simplePlugin
), ),
new BooleanAttribute ( new BooleanAttribute (
_('Cannot change password'), _('Not allowed to change password'), _('Cannot change password'), _('Not allowed to change password'),
'sambaPwdCanChange', FALSE, FALSE, '', 'fd_pwdCantChange'
'4294967295', ''
), ),
new DateAttribute ( new DateAttribute (
_('Account expiration'), _('When does the account expire'), _('Account expiration'), _('When does the account expire'),
...@@ -371,6 +370,15 @@ class sambaAccount extends simplePlugin ...@@ -371,6 +370,15 @@ class sambaAccount extends simplePlugin
'erase' => array ('' => array ('sambaHomePath')) 'erase' => array ('' => array ('sambaHomePath'))
) )
); );
$this->attributesAccess['sambaPwdLastSet']->setManagedAttributes(
array(
'disable' => array (TRUE => array ('fd_pwdCantChange'))
)
);
$this->attributesAccess['fd_pwdCantChange']->setInLdap(FALSE);
$value = (isset($this->attrs['sambaPwdLastSet']) && ($this->attrs['sambaPwdLastSet'][0] == '4294967295'));
$this->attributesAccess['fd_pwdCantChange']->setInitialValue($value);
$this->attributesAccess['fd_pwdCantChange']->setValue($value);
// Get samba domain and its sid/rid base // Get samba domain and its sid/rid base
if ($this->sambaSID != "") { if ($this->sambaSID != "") {
...@@ -492,11 +500,10 @@ class sambaAccount extends simplePlugin ...@@ -492,11 +500,10 @@ class sambaAccount extends simplePlugin
} }
/* Do not modify values if not needed */ /* Do not modify values if not needed */
if (!$this->attributesAccess['sambaPwdLastSet']->hasChanged()) { if (!$this->attributesAccess['sambaPwdLastSet']->hasChanged() && !$this->attributesAccess['fd_pwdCantChange']->hasChanged()) {
unset($this->attrs['sambaPwdLastSet']); unset($this->attrs['sambaPwdLastSet']);
} } elseif (!$this->sambaPwdLastSet) {
if (!$this->attributesAccess['sambaPwdCanChange']->hasChanged()) { $this->attrs['sambaPwdLastSet'] = ($this->fd_pwdCantChange?array('4294967295'):'');
unset($this->attrs['sambaPwdCanChange']);
} }
// Handle "sambaKickoffTime" // Handle "sambaKickoffTime"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment