User guide
Appendix A: Samples of User Program Descriptions
A-16
Changing the User Validity Period
This sample program assumes the environment setup below. Change the setup according to the actual
environment used.
• The public directory for creation of the repository is "ou=interstage,o=fujitsu,dc=com".
• The storage location of user information is "ou=User,ou=interstage,o=fujitsu,dc=com".
• RDN of user information is expressed by "cn".
• The name of the user whose validity period is to be changed is specified for "user" in
java.lang.String.
• The validity period start time is specified for "before" in java.lang.String.
• The validity period end time is specified for "after" in java.lang.String.
• The result of common pre-processing is used as the value of "ctx".
Description of User Program
Example
Pre-processing
:
String dn = "cn=" + user + ",ou=User,ou=interstage,o=fujitsu,dc=com";
ModificationItem[] mods = new ModificationItem[2];
mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE,
new BasicAttribute("ssoNotBefore",
before));
mods[1] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE,
new BasicAttribute("ssoNotAfter",
after));
ctx.modifyAttributes(dn, mods);
:
Postprocessing