Thumbs Creation - phoca written folder's permissions

Phoca Gallery - image gallery extension
smithe
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 27 Aug 2009, 16:10

Thumbs Creation - phoca written folder's permissions

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Thumbs Creation - phoca written folder's permissions

Post 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
If you find Phoca extensions useful, please support the project
smithe
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 27 Aug 2009, 16:10

Re: Thumbs Creation - phoca written folder's permissions

Post 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.
webcreatives
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 28 Aug 2009, 16:51

Re: Thumbs Creation - phoca written folder's permissions

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Thumbs Creation - phoca written folder's permissions

Post 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
If you find Phoca extensions useful, please support the project
webcreatives
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 28 Aug 2009, 16:51

Re: Thumbs Creation - phoca written folder's permissions

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Thumbs Creation - phoca written folder's permissions

Post 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
If you find Phoca extensions useful, please support the project
webcreatives
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 28 Aug 2009, 16:51

Re: Thumbs Creation - phoca written folder's permissions

Post by webcreatives »

Hi Jan,

Seems to work fine for me.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Thumbs Creation - phoca written folder's permissions

Post by Jan »

Ok, I will do some new behaviour.

Jan
If you find Phoca extensions useful, please support the project
harishdahiya
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 15 Sep 2009, 23:54

Re: Thumbs Creation - phoca written folder's permissions

Post by harishdahiya »

Hi
I have tried both the optins of jfolder listed above.
But my problem still not resolved.
Post Reply