1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| attributeSet.add( new LDAPAttribute("sn", nom));
attributeSet.add( new LDAPAttribute("chilliLogin",login));
attributeSet.add( new LDAPAttribute("userPassword",this.getPassword()));
attributeSet.add( new LDAPAttribute("chilliGodFather", parrain));
attributeSet.add( new LDAPAttribute("objectClass", new String[]{"chilliPerson","top"}));
attributeSet.add( new LDAPAttribute("chilliExpiration", dateF));
attributeSet.add( new LDAPAttribute("cn",prenom + " "+ nom));
attributeSet.add( new LDAPAttribute("chilliCreation", dateO));
attributeSet.add( new LDAPAttribute("chilliDesc", raison));
String dn = "chilliLogin="+login+"," + containerName;
LDAPEntry newEntry = new LDAPEntry( dn, attributeSet );
try {
// connect to the server
lc.connect( ldapHost, ldapPort );
// authenticate to the server
lc.bind( ldapVersion, loginDN, password.getBytes("UTF8") );
lc.add( newEntry );
logger.debug( "\nAdded object: " + dn + " successfully." ); |
Partager