on 08-21-2005 12:20 AM
Hello,
I am working with Netweaver Studio in a PDK 6.0 application. I want to create an application that reset the password of the portal user and send and email with the new passsword.
Does someone knows there is a method in the UME api or somewhere else that let me manage this kind of process??
Thanks in advance
Hi Marysol,
The following code has everything you need.
String uniqueId = uaf.getUserAccountByLogonId("hsharma").getUniqueID();
IUserMaint user = UMFactory.getUserFactory().getMutableUser(uniqueId);
IUserAccount ua = UMFactory.getUserAccountFactory().getMutableUserAccount(uniqueId);
String password = "xxxx";
ua.setPassword(password);
ua.save();
ua.commit();
SendMailAsynch sendemail = new SendMailAsynch();
IUser performer = request.getUser(); SendMailAsynch.generateEmailOnUMEvent(performer, user, "pswd_reset_performed", null, password);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Prakash,
I've deployed the similar application on EP. The password has been reseted successfully and there is no excepion throwed. But the user couldn't get the respons email. Do you know what has caused this issue ? Do we have to restart the server engine after deployed par on Portal?
Thanks in advance.
The source code is as bellow,
if (null != userObject&& userObject.getEmail().equalsIgnoreCase(userEmail.getValue().toString())) {
IUserAccount ua = UMFactory .getUserAccountFactory().getUserAccountByLogonId(uid);
IUserAccount mua =UMFactory .getUserAccountFactory() .getMutableUserAccount(ua.getUniqueID());
String password =
UMFactory.getSecurityPolicy().generatePassword();
mua.setPassword(password);
mua.save();
mua.commit();
SendMailAsynch.generateEmailOnUMEvent(
userObject,
userObject,
"pswd_reset_performed",
"You password of userID in Portal system has been reset. Please logon and change password as soon as possible.",
password);
conBean.setSuccessMsg(
"Password Reset successful and was sent to your email.");
break;
} //end if
break;
} //end try
catch (UMException e) {
conBean.setMsgID(
"The userID does not exist, please input the right userID or contact authorization administrator directly.");
} //end catch
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.