Commit c785eb9e by Tuukka Kivilahti

Merge branch 'userimagefix' into 'master'

Userimagefix

Gf 4.1 fix for user image filesystemgeneration.

kattoi @tkfftk
2 parents 296f1b73 41df4ee4
......@@ -264,7 +264,7 @@ public class UserBean implements UserBeanLocal {
@RolesAllowed(SpecialPermission.S_USER)
public UserImage uploadImage(EventUser user, String contentType, InputStream imagestream, String filename, String description) {
user = eventUserFacade.merge(user);
user = eventUserFacade.reload(user);
logger.debug("uploading image to userid {}", user);
EventUser curruser = permbean.getCurrentUser();
......
......@@ -111,9 +111,13 @@ public class FileDownloadServlet extends GenericImageServlet {
// Create image on file for cropper to work...
// Check
// http://code.google.com/p/primefaces/issues/detail?id=3751
String imagefilePath = this.getServletContext().getRealPath("/dydata/" + super.request.getPathInfo());
File imagefile = new File(imagefilePath);
if (!imagefile.exists())
String dydataRoot = this.getServletContext().getRealPath("/dydata/");
File imagefile = null;
if (dydataRoot != null) {
imagefile = new File(dydataRoot + super.request.getPathInfo());
}
if (imagefile != null && !imagefile.exists())
{
File parentPath = new File(imagefile.getParent());
if (!parentPath.isDirectory() && !parentPath.mkdirs()) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!