diff --git a/lam/lib/modules/windowsUser.inc b/lam/lib/modules/windowsUser.inc index d4dac57b..1e6f7b6b 100644 --- a/lam/lib/modules/windowsUser.inc +++ b/lam/lib/modules/windowsUser.inc @@ -53,6 +53,8 @@ class windowsUser extends baseModule implements passwordService { private $groupCache = null; /** option for forcing password change, used in postModifyActions */ private $pwdLastSet = null; + /** clear text password */ + private $clearTextPassword; /** @@ -385,6 +387,7 @@ class windowsUser extends baseModule implements passwordService { 'scriptPath' => _('Logon script'), 'pwdMustChange' => _('Password change at next login'), 'groups' => _('Groups'), + 'password' => _('Password'), ); // self service search attributes $return['selfServiceSearchAttributes'] = array('sAMAccountName'); @@ -463,6 +466,27 @@ class windowsUser extends baseModule implements passwordService { $this->groupList = $this->groupList_orig; } + + + /** + * Returns a list of modifications which have to be made to the LDAP account. + * + * @return array list of modifications + *
This function returns an array with 3 entries: + *
array( DN1 ('add' => array($attr), 'remove' => array($attr), 'modify' => array($attr)), DN2 .... ) + *
DN is the DN to change. It may be possible to change several DNs (e.g. create a new user and add him to some groups via attribute memberUid) + *
"add" are attributes which have to be added to LDAP entry + *
"remove" are attributes which have to be removed from LDAP entry + *
"modify" are attributes which have to been modified in LDAP entry + *
"info" are values with informational value (e.g. to be used later by pre/postModify actions) + */ + public function save_attributes() { + $return = parent::save_attributes(); + // add information about clear text password and password status change + $return[$this->getAccountContainer()->dn_orig]['info']['userPasswordClearText'][0] = $this->clearTextPassword; + return $return; + } + /** * Returns the HTML meta data for the main account page. * @@ -1199,6 +1223,13 @@ class windowsUser extends baseModule implements passwordService { $groups[] = extractRDNValue($group); } $return[get_class($this) . '_groups'] = array('' . _('Groups') . '' . implode(', ', $groups) . ''); + // password + if (isset($this->clearTextPassword)) { + $return['windowsUser_password'] = array('' . _('Password') . '' . $this->clearTextPassword . ''); + } + else if (isset($this->attributes['INFO.userPasswordClearText'])) { + $return['windowsUser_password'] = array('' . _('Password') . '' . $this->attributes['INFO.userPasswordClearText'] . ''); + } return $return; } @@ -1449,6 +1480,7 @@ class windowsUser extends baseModule implements passwordService { if ($forcePasswordChange) { $this->attributes['pwdLastSet'][0] = '0'; } + $this->clearTextPassword = $password; return array(); }