Page 1 of 2

Thumbs Creation - phoca written folder's permissions

Posted: 27 Aug 2009, 16:24
by smithe
I have version 2.5.7

I am puzzled why folders created by phoca gallery do not give owner write permissions. The lack of these permissions is undoubtedly the cause of many people's inability to use this component.

The only way I can make it function is to manually create a folder in the www/images/phocagallery directory and then create a folder called thumbs inside it. By doing this, I can set the permissions to 755 and thumb creation process works properly.

If folders are created by phoca's backend the permissions are set so they can not be written to by owner - which means they can't even be deleted except by sever operator. Why is this?

Is this an issue with just my version or is there some reason phoca does this? I imagine many folks would just give up and move on to another gallery component.

The gallery seems superior to others available if this were fixed by developers - or at least a message stating the work around above.

Re: Thumbs Creation - phoca written folder's permissions

Posted: 27 Aug 2009, 19:44
by Jan
Hi, I cannot do support for hacking sites like other components do. If some other component will work with 777 permissions, this will be not problem for wrong set hostings (permissions, ownership), but there is no problems for hacking robots to write malignant code to 777, that is why Phoca Extensions use 755 permissions:

see:
https://www.phoca.cz/documents/50-phoca/ ... y-settings

Jan

Re: Thumbs Creation - phoca written folder's permissions

Posted: 28 Aug 2009, 16:19
by smithe
hi Jan,

I guess I wasn't very clear in my post. Phoca created folders are not set to 755 as they should be. I took a screenshot to show - you can see it here: http://www.erinsmith.net/erinsuploads/i ... allery.jpg

The directories created by phoca system when adding a category or pictures are set like this -

Owner permissions - Read:No Write: No Execute: No
Group permissions - Read:yes Write: No Execute: No
Public permissions - Read:No Write:Yes Execute: Yes
Numeric value 043
This was from a "thumbs" folder inside category. Others were similar or the same, but never 755.

When attempting to change numeric value through ftp (change file attirbutes) permission to do so is denied. The only way to do was to have server owner do it for me.

Now, if I manually create the category folders via ftp with a thumbs folder inside, then I can set them to 755 and the whole system works flawlessly. The problem with thumbs creation is that the permissions to the phoca created folders don't allow system to do what it needs to do.

I have gotten it to work for me by doing this, but I assume other users may just move on to another gallery even though yours is superior if functional. Just passing this on in case you weren't aware of this issue.

Re: Thumbs Creation - phoca written folder's permissions

Posted: 28 Aug 2009, 16:54
by webcreatives
I can confirm Smithe's problems. Exactly same problem here.
Have to manually set write permissions on thumbs folder straight on the server.

Re: Thumbs Creation - phoca written folder's permissions

Posted: 28 Aug 2009, 18:05
by Jan
Hi, this problem should be solved with:
$folder_permissions = octdec((int)$folder_permissions);

but seems like this can have some problems on some servers, so I need to change it again.


As on my all servers it works, can you test the following (to check if the problem is here)

file:
administrator\components\com_phocagallery\libraries\phocagallery\file\filefolder.php
FROM:
@JFolder::create($folder, $folder_permissions );
TO:
@JFolder::create($folder, 0755 );

Then try to create folder e.g. in Multiple Add in Phoca Gallery and please let me know if you get the right permissions (0755)

Thank you,
Jan

Re: Thumbs Creation - phoca written folder's permissions

Posted: 28 Aug 2009, 20:33
by webcreatives
Hi Jan,

The problem for me was not in

administrator\components\com_phocagallery\libraries\phocagallery\file\filefolder.php

but in

administrator\components\com_phocagallery\libraries\phocagallery\file\filethumbnail.php

changed

@JFolder::create($folderThumbnail, $folder_permissions );

to

@JFolder::create($folderThumbnail,"755");

this solved the problem

Thanks for pointing me in the right direction.

Re: Thumbs Creation - phoca written folder's permissions

Posted: 30 Aug 2009, 17:26
by Jan
Hi, both files are the same (one creates folder if you will create folder e.g. in multiple add, the second creates folder if thumbnails are written)

but I need to test this:

@JFolder::create($folderThumbnail,0755);

Please can you test it again:
FROM:
@JFolder::create($folderThumbnail,"755");
TO:
@JFolder::create($folderThumbnail,0755);

Thank you, Jan

Re: Thumbs Creation - phoca written folder's permissions

Posted: 31 Aug 2009, 11:59
by webcreatives
Hi Jan,

Seems to work fine for me.

Re: Thumbs Creation - phoca written folder's permissions

Posted: 08 Sep 2009, 17:29
by Jan
Ok, I will do some new behaviour.

Jan

Re: Thumbs Creation - phoca written folder's permissions

Posted: 17 Sep 2009, 05:21
by harishdahiya
Hi
I have tried both the optins of jfolder listed above.
But my problem still not resolved.