public void changeWlanPassword(final LdapUser user, final String newPassword) { final String sambaPasswordAttributeId = "sambaNTPassword"; if (isSambaAccountsConfigured() == false) { log.error("Could not change attribute " + sambaPasswordAttributeId + " because the samba accounts are not configured."); return; } if (user.getSambaSIDNumber() == null) { log.error("Could not change attribute " + sambaPasswordAttributeId + " because the sambaSID is null."); return; } log.info("Change attribute " + sambaPasswordAttributeId + " for " + getObjectClass() + ": " + buildDn(null, user)); final String sambaNTPassword = SmbEncrypt.NTUNICODEHash(newPassword); final ModificationItem modItem = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute(sambaPasswordAttributeId, sambaNTPassword)); // Perform the update modify(user, Collections.singletonList(modItem)); }
/** * @see org.projectforge.business.ldap.LdapDao#getAdditionalObjectClasses(org.projectforge.business.ldap.LdapObject) */ @Override protected String[] getAdditionalObjectClasses(final LdapUser obj) { final boolean posixAccount = isPosixAccountsConfigured() == true && PFUserDOConverter.isPosixAccountValuesEmpty(obj) == false; final boolean sambaAccount = isSambaAccountsConfigured() == true && PFUserDOConverter.isSambaAccountValuesEmpty(obj) == false; if (ALL_OBJECT_CLASSES == null) { initializeObjectClasses(); } if (posixAccount == true) { if (sambaAccount == true) { return ALL_OBJECT_CLASSES_WITH_SAMBA_AND_POSIX_ACCOUNT; } return ALL_OBJECT_CLASSES_WITH_POSIX_ACCOUNT; } if (sambaAccount == true) { return ALL_OBJECT_CLASSES_WITH_SAMBA_ACCOUNT; } return ALL_OBJECT_CLASSES; }
ListHelper.addAll(properties, "uidNumber", "gidNumber", "homeDirectory", "loginShell"); if (ldapUserDao.isSambaAccountsConfigured() == true && isSambaAccountValuesEmpty(src) == false) { ListHelper.addAll(properties, "sambaSIDNumber", "sambaPrimaryGroupSIDNumber", "sambaNTPassword"); if (ldapUserDao.isSambaAccountsConfigured() == true && isSambaAccountValuesEmpty(src) == false) { final long diffSambaPwdLastSet = dest.getSambaPwdLastSetAsUnixEpochSeconds() - src.getSambaPwdLastSetAsUnixEpochSeconds();
final boolean modifyPosixAccount = isPosixAccountsConfigured() == true && PFUserDOConverter.isPosixAccountValuesEmpty(user) == false; final boolean modifySambaAccount = isSambaAccountsConfigured() == true && PFUserDOConverter.isSambaAccountValuesEmpty(user) == false; if (modifyPosixAccount == true || modifySambaAccount == true) {
ldapConfig = ldapService.getLdapConfig(); final boolean posixAccountsConfigured = isPosixAccountsConfigured(); final boolean sambaAccountsConfigured = isSambaAccountsConfigured(); if (posixAccountsConfigured == true || sambaAccountsConfigured == true) { final String no = LdapUtils.getAttributeStringValue(attributes, "uidNumber");
.setTooltip(getString("user.localUser.tooltip")); final boolean posixConfigured = ldapUserDao.isPosixAccountsConfigured(); final boolean sambaConfigured = ldapUserDao.isSambaAccountsConfigured(); if (posixConfigured == false && sambaConfigured == false) { return;