掲示板

Add a profile picture in user registration page

10年前 に Nishant Shakya によって更新されました。

Add a profile picture in user registration page

New Member 投稿: 1 参加年月日: 13/10/24 最新の投稿
I want to add a profile picture while creating an account.....we can get this while editing the myaccount but i want this while creating account. Is there any way of doing this using the default Liferay User registration page?
thumbnail
9年前 に Afzal Shaikh によって更新されました。

RE: Add a profile picture in user registration page

New Member 投稿: 18 参加年月日: 15/03/28 最新の投稿
HI , Nishant Shakya

Have you got answer..? i am also searching for this functionality to add on my page using HOOK .
thumbnail
9年前 に Jan Geißler によって更新されました。

RE: Add a profile picture in user registration page

Liferay Master 投稿: 735 参加年月日: 11/07/05 最新の投稿
Hi!
You need to Hook the Login Portlet. (58) There you have to overwrite create_account.jsp and hook the CreateAccount Action Class.
Jsp for the InputField, the ActionClass because you need to process the image.

Regards
Jan
thumbnail
9年前 に Afzal Shaikh によって更新されました。

RE: Add a profile picture in user registration page

New Member 投稿: 18 参加年月日: 15/03/28 最新の投稿
hi,
Jan Geißler ,thanks for reply

Yes,i did the same for hook to add custome fields and store in expando table. but i want to use liferay's inbuilt functionality to upload and store profile picture on create account page.
like liferay portal provides when we edit user profile.
thumbnail
9年前 に Jan Geißler によって更新されました。

RE: Add a profile picture in user registration page

Liferay Master 投稿: 735 参加年月日: 11/07/05 最新の投稿
UserLocalServiceUtil.updatePortrait(userId, bytes[])?
thumbnail
9年前 に Afzal Shaikh によって更新されました。

RE: Add a profile picture in user registration page

New Member 投稿: 18 参加年月日: 15/03/28 最新の投稿
Thanks for reply
but main thing is that how we can add functionality on create_account.jsp page..
thumbnail
9年前 に Jan Geißler によって更新されました。

RE: Add a profile picture in user registration page

Liferay Master 投稿: 735 参加年月日: 11/07/05 最新の投稿
In the jsp you only add the UI Elements for the form upload. Handling the data of the uploaded file would be in the Action Class.
thumbnail
9年前 に Afzal Shaikh によって更新されました。

RE: Add a profile picture in user registration page

New Member 投稿: 18 参加年月日: 15/03/28 最新の投稿
Hi, Jan Geißler
Thanks for your help.
i use this code on action class and it Uploads Image in profile...in create_account.jsp via Hook.

UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest);
File file = uploadRequest.getFile("file");
if(file != null) {
byte[] bytes = FileUtil.getBytes(file);
if ((bytes == null) || (bytes.length == 0)) {
throw new UploadException();
}
UserLocalServiceUtil.updatePortrait(userId, bytes);
}