1
mjz55
Which chmod attributes for a photo gallery album?
  • 2007/7/8 10:07

  • mjz55

  • Quite a regular

  • Posts: 298

  • Since: 2007/1/18


Which attributes would I use if I want nobody to be able to delete the folder. Just allow them to view and to add and delete contents of the folder. If this is possible.

2
Tobias
Re: Which chmod attributes for a photo gallery album?
  • 2007/7/8 13:51

  • Tobias

  • Not too shy to talk

  • Posts: 172

  • Since: 2005/9/13


*Edit: Ooops sorry, I've misread. In any case, I hope you're not talking about giving everyone ftp access! If you do, they should not be able to delete/change permissions on directories for which they're not the owner, should they? Original post follows:*

Depends a little on your servers setup, but if they can up, then they can also delete. From the point of view of file permissions.

Now, if they can upload only through some php script, such as a XOOPS gallery, then it's probably the user who runs the webserver who has the appropriate permissions and ownership, not the world or the person who's looking at the gallery through a browser. Meaning that your visitors can only delete if the php script provides that option to them. They hopefully don't have ftp access anyway.

In any case: It's not about chmod, but about tuning the permissions for your gallery, which, I assume, integrates with xoops. If you're talking about ftp, then it's a different story.

3
mjz55
Re: Which chmod attributes for a photo gallery album?
  • 2007/7/8 14:11

  • mjz55

  • Quite a regular

  • Posts: 298

  • Since: 2007/1/18


Thanks Tobias. I guess I should have explained a bit more. I'm not using ftp for users. As you said, it is through the gallery module. Unfortunately, there is one slight flaw in gallery. I can give a user upload (add) an item rights. But if I want them to be able to delete that upload I have to give them delete rights, which also allows them to delete a folder that I created for them. Which creates the problem. They don't have create folder rights so I get the email and or phone call that they accidently deleted their album but just wanted to delete their images. The delete rights for a user in gallery should also have just a delete item rights choice.

Since I'm not very versed in all this, I just thought by changing the chmod rights to that album I created that they wouldn't be able to delete the album, just the items (pics) that they added inside.

4
Tobias
Re: Which chmod attributes for a photo gallery album?
  • 2007/7/8 14:52

  • Tobias

  • Not too shy to talk

  • Posts: 172

  • Since: 2005/9/13


Okay, in that case, you'd have to manage ownership so that the "user running the webserver" cannot remove the directories. So you could chmod them to 777, but the directories themselves still couldn't be removed by anyone other than the owner. Or root, of course. If I'm not mistaken, that is.

If you have a relatively static set of directories, perhaps you can get your webhost to change ownership of those directories for you. That might mean that you yourself wouldn't be able to remove these directories either.

5
mjz55
Re: Which chmod attributes for a photo gallery album?
  • 2007/7/8 15:00

  • mjz55

  • Quite a regular

  • Posts: 298

  • Since: 2007/1/18


I am the webhost. Do you know where and how I can block them from being deleted?

6
Tobias
Re: Which chmod attributes for a photo gallery album?
  • 2007/7/8 15:15

  • Tobias

  • Not too shy to talk

  • Posts: 172

  • Since: 2005/9/13


You mean you own the server? Try to take ownership for root.

chown root:root blahblahblah
and then
chmod 777 blahblahblah

You probably have to be root to do that, or sudo if you can. Blahblahblah are the directories. I'm not sure this isn't dangerous. You might find a better user then just root. Just for testing purposes.

But perhaps, I've also been talking a bunch of nonsense and you can prevent the directories from being removed by just taking write permission away from their parent directory. You could try setting the parent directory to 555. But that may recurse into the child directories, so that your users won't be able to upload anymore.

This question sounds really basic, but I'm terribly unsure. I'm just a single user without public access to my machine. You may want to wait for someone more knowledgable to give you the real webmaster tips.

*Edit: Yeah, this looks like it might be worth a shot. Consolidate all the directories you want to have, then chmod the parent directory to 555. I can quickly get that scenario to work on my box. So I can write to the child directory, but not remove the child directory itself. Not sure whether there could be complications with the web server, though.*

7
mjz55
Re: Which chmod attributes for a photo gallery album?
  • 2007/7/8 15:58

  • mjz55

  • Quite a regular

  • Posts: 298

  • Since: 2007/1/18


Umm, tried that. The darn gallery overrides the chmod's. No matter what I do, it reverts back to 755. There is a spot in gallery that allows permissions but there is no offer of a 555. This beats me up. I even tried to change the code in the useralbumhelper.class and that didnt work either. I guess I'm just going to have to mention and remention about not deleting the album.

8
Tobias
Re: Which chmod attributes for a photo gallery album?
  • 2007/7/8 16:15

  • Tobias

  • Not too shy to talk

  • Posts: 172

  • Since: 2005/9/13


The php script overwrites the permissions you set through the shell on the parent directory? That is outrageous! Then you might really have to make sure that the apache user isn't owner and doesn't belong to the group.

Just so we're on the same page: The aim is that the parent directory is set to 555, and the individual user directories to 755 so that users can write into them and delete from them, but cannot delete de user directories themselves.

Sorry, I'm at the end of my wits!

9
mjz55
Re: Which chmod attributes for a photo gallery album?
  • 2007/7/11 13:02

  • mjz55

  • Quite a regular

  • Posts: 298

  • Since: 2007/1/18


Well, I finally got to change the chmod to 555. Now what happened is that the owner of the sub-album was allowed to delete his sub-album but received an error; which I thought was cool if it didn't really allow the deletion. What happened is that it deleted the album image but kept the album on the server. So, that didn't really work. In fact I could'nd delete the album even after changing the chmod back via the server. I had to actually remove the parent album and create a new blank parent album just to get rid of it.

10
mjz55
Re: Which chmod attributes for a photo gallery album?
  • 2007/7/11 13:17

  • mjz55

  • Quite a regular

  • Posts: 298

  • Since: 2007/1/18


I chmoded the main album and the sub-album to 555 this time. It would't let the user delete it.......good. HOWEVER, now when he went to add an item in the sub-album he got this error........

Platform Error
An error has occurred while interacting with the platform.


I think (hope) we're closer.

Login

Who's Online

339 user(s) are online (266 user(s) are browsing Support Forums)


Members: 0


Guests: 339


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits