on 01-19-2011 7:25 AM
Hi,
Instead of curren tuser, if we want to reset password for existing user of LDAP. which is available as string then how to convert string to IUser ?
try {
IWDClientUser clientUser = WDClientUser.getCurrentUser(); <--- EXISTING USER INSTEAD OF CURRENT USER
IUser User = clientUser.getSAPUser();
if (User != null)
{
IUserAccount[] acct = User.getUserAccounts();
if(acct[0] != null)
{
acct[0].setPassword("secret");
acct[0].setPasswordChangeRequired(false); //included for first logon pwd change prompt
acct[0].save();
acct[0].commit();
}
}
} catch (WDUMException e1) {
// TODO Auto-generated catch block
//e1.printStackTrace();
wdComponentAPI.getMessageManager().reportSuccess(e1.getMessage());
} catch (InvalidPasswordException e1) {
// TODO Auto-generated catch block
//e1.printStackTrace();
wdComponentAPI.getMessageManager().reportSuccess(e1.getMessage());
} catch (UMException e1) {
// TODO Auto-generated catch block
//e1.printStackTrace();
wdComponentAPI.getMessageManager().reportSuccess(e1.getMessage());
}
thank you,
B
Hi,
Try this:
IUserFactory userFactory = UMFactory.getUserFactory();
IUser user = userFactory.getUserByLogonID("<Enter Logon ID>");
Regards,
Omri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.