Fórumok

Add a profile picture in user registration page

Nishant Shakya, módosítva 10 év-val korábban

Add a profile picture in user registration page

New Member Bejegyzés: 1 Csatlakozás dátuma: 2013.10.24. Legújabb bejegyzések
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
Afzal Shaikh, módosítva 9 év-val korábban

RE: Add a profile picture in user registration page

New Member Bejegyzések: 18 Csatlakozás dátuma: 2015.03.28. Legújabb bejegyzések
HI , Nishant Shakya

Have you got answer..? i am also searching for this functionality to add on my page using HOOK .
thumbnail
Jan Geißler, módosítva 9 év-val korábban

RE: Add a profile picture in user registration page

Liferay Master Bejegyzések: 735 Csatlakozás dátuma: 2011.07.05. Legújabb bejegyzések
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
Afzal Shaikh, módosítva 9 év-val korábban

RE: Add a profile picture in user registration page

New Member Bejegyzések: 18 Csatlakozás dátuma: 2015.03.28. Legújabb bejegyzések
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
Jan Geißler, módosítva 9 év-val korábban

RE: Add a profile picture in user registration page

Liferay Master Bejegyzések: 735 Csatlakozás dátuma: 2011.07.05. Legújabb bejegyzések
UserLocalServiceUtil.updatePortrait(userId, bytes[])?
thumbnail
Afzal Shaikh, módosítva 9 év-val korábban

RE: Add a profile picture in user registration page

New Member Bejegyzések: 18 Csatlakozás dátuma: 2015.03.28. Legújabb bejegyzések
Thanks for reply
but main thing is that how we can add functionality on create_account.jsp page..
thumbnail
Jan Geißler, módosítva 9 év-val korábban

RE: Add a profile picture in user registration page

Liferay Master Bejegyzések: 735 Csatlakozás dátuma: 2011.07.05. Legújabb bejegyzések
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
Afzal Shaikh, módosítva 9 év-val korábban

RE: Add a profile picture in user registration page

New Member Bejegyzések: 18 Csatlakozás dátuma: 2015.03.28. Legújabb bejegyzések
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);
}