public void configure(Benutzer inUser, String inPassword, String inUidNumber) throws NamingException, NoSuchAlgorithmException, IOException,
InterruptedException {
if (!ConfigMain.getBooleanParameter("ldap_readonly", false)) {
this.type = inUser.getLogin();
LdapGruppe lp = inUser.getLdapGruppe();
if (lp.getObjectClasses() == null) {
throw new NamingException("no objectclass defined");
}
/* ObjectClasses */
Attribute oc = new BasicAttribute("objectclass");
StringTokenizer tokenizer = new StringTokenizer(lp.getObjectClasses(), ",");
while (tokenizer.hasMoreTokens()) {
oc.add(tokenizer.nextToken());
}
this.myAttrs.put(oc);
this.myAttrs.put("uid", ReplaceVariables(lp.getUid(), inUser, inUidNumber));
this.myAttrs.put("cn", ReplaceVariables(lp.getUid(), inUser, inUidNumber));
this.myAttrs.put("displayName", ReplaceVariables(lp.getDisplayName(), inUser, inUidNumber));
this.myAttrs.put("description", ReplaceVariables(lp.getDescription(), inUser, inUidNumber));
this.myAttrs.put("gecos", ReplaceVariables(lp.getGecos(), inUser, inUidNumber));
this.myAttrs.put("loginShell", ReplaceVariables(lp.getLoginShell(), inUser, inUidNumber));
this.myAttrs.put("sn", ReplaceVariables(lp.getSn(), inUser, inUidNumber));
this.myAttrs.put("homeDirectory", ReplaceVariables(lp.getHomeDirectory(), inUser, inUidNumber));
this.myAttrs.put("sambaAcctFlags", ReplaceVariables(lp.getSambaAcctFlags(), inUser, inUidNumber));
this.myAttrs.put("sambaLogonScript", ReplaceVariables(lp.getSambaLogonScript(), inUser, inUidNumber));
this.myAttrs.put("sambaPrimaryGroupSID", ReplaceVariables(lp.getSambaPrimaryGroupSID(), inUser, inUidNumber));
this.myAttrs.put("sambaSID", ReplaceVariables(lp.getSambaSID(), inUser, inUidNumber));
this.myAttrs.put("sambaPwdMustChange", ReplaceVariables(lp.getSambaPwdMustChange(), inUser, inUidNumber));
this.myAttrs.put("sambaPasswordHistory", ReplaceVariables(lp.getSambaPasswordHistory(), inUser, inUidNumber));
this.myAttrs.put("sambaLogonHours", ReplaceVariables(lp.getSambaLogonHours(), inUser, inUidNumber));
this.myAttrs.put("sambaKickoffTime", ReplaceVariables(lp.getSambaKickoffTime(), inUser, inUidNumber));
this.myAttrs.put("sambaPwdLastSet", String.valueOf(System.currentTimeMillis() / 1000l));
this.myAttrs.put("uidNumber", inUidNumber);
this.myAttrs.put("gidNumber", ReplaceVariables(lp.getGidNumber(), inUser, inUidNumber));
/*
* -------------------------------- Samba passwords --------------------------------
*/
/* LanMgr */