added force password change to profile editor
This commit is contained in:
parent
1f20b1d48e
commit
b1f85eb050
|
@ -1,4 +1,5 @@
|
|||
6.8
|
||||
- Windows: added home drive and force password change to profile editor
|
||||
- LAM Pro:
|
||||
-> Bind DLZ: entry table can show record data (use special attribute "#records" in server profile)
|
||||
- Fixed bugs:
|
||||
|
|
|
@ -2820,6 +2820,9 @@ class windowsUser extends baseModule implements passwordService {
|
|||
}
|
||||
$driveSelect = new htmlResponsiveSelect('windowsUser_homeDrive', $drives, array('-'), _('Home drive'), 'homeDrive');
|
||||
$return->add($driveSelect, 12);
|
||||
// force password change
|
||||
$passwordChangeCheckbox = new htmlResponsiveInputCheckbox('windowsUser_pwdMustChange', true, _('Password change at next login'), 'pwdMustChange');
|
||||
$return->add($passwordChangeCheckbox, 12);
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -2879,6 +2882,18 @@ class windowsUser extends baseModule implements passwordService {
|
|||
$oList = preg_split('/;[ ]*/', $profile['windowsUser_o'][0]);
|
||||
$this->attributes['o'] = $oList;
|
||||
}
|
||||
// force password change
|
||||
if (isset($profile['windowsUser_pwdMustChange'][0]) && ($profile['windowsUser_pwdMustChange'][0] == "true")) {
|
||||
$this->attributes['pwdLastSet'][0] = '0';
|
||||
}
|
||||
elseif (isset($profile['windowsUser_pwdMustChange'][0]) && ($profile['windowsUser_pwdMustChange'][0] == "false")) {
|
||||
if (isset($this->orig['pwdLastSet'][0]) && ($this->orig['pwdLastSet'][0] !== '0')) {
|
||||
$this->attributes['pwdLastSet'][0] = $this->orig['pwdLastSet'][0];
|
||||
}
|
||||
else {
|
||||
$this->attributes['pwdLastSet'][0] = '-1';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue