Joomla! Discussion Forums



It is currently Fri Nov 27, 2009 11:16 am (All times are UTC )

 




Post new topic Reply to topic  [ 9 posts ] 
Author Message
Posted: Fri Nov 06, 2009 12:21 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Feb 19, 2008 2:53 am
Posts: 43
Hi guys, I've had a fair bit of luck with the help I've gotten off you in the past so hopefully you can help me here.

I'm creating a photo gallery component for my new site, during the installation of the component it creates all the necessary files and folders, including the folder I wish to save user submitted photos to. This folder is in the directory components/com_photoalbum/images. However my script can not save files to this folder as by default the permission are 755. If I manually change the permissions to 777 it works fine.

It may seem like this isn't a problem, but I'd like to publish this component in the JED and want set up to be as easy and secure as possible, and don't want people to have to chmod that directory themselves.

I've tried this code in my script chmod("components/com_photoalbum/images", 0777); but this doesn't work.

What can I do to make a that directory writeable from my script? If it makes a difference my test site runs on PHP 4, but i also want it to work on PHP 5. Also when i install the component I'm installing from my tmp directory rather than uploading the .zip via FTP

Any help would be greatly appreciated, and would help me share my work with the community.


Top
  E-mail  
 
Posted: Fri Nov 06, 2009 12:29 am 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Mon Aug 11, 2008 1:16 am
Posts: 312
Nobody will use your component under those conditions!
I thought I read somewhere that you can only go one folder deep on the media directory with components.

Otherwise you may have some local permission setup issues. Are all the user and group permissions correct on your files?


Top
  E-mail  
 
Posted: Fri Nov 06, 2009 12:32 am 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Fri Jul 25, 2008 12:27 am
Posts: 1206
Location: Bunker or a Hazard
Can you set the photo gallery to use the /images directory off the root?

_________________
Even a blind squirrel finds a nut every once in a while.


Top
   
 
Posted: Fri Nov 06, 2009 2:02 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Wed Oct 21, 2009 10:43 pm
Posts: 4
check if the owner of the directory is same as others below it (should be same as httpd process owner).
It is odd that if the directory was created by the script, that it should already have full access to it, since its the same process (owner).


Top
  E-mail  
 
Posted: Fri Nov 06, 2009 7:08 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Feb 19, 2008 2:53 am
Posts: 43
becyn wrote:
Nobody will use your component under those conditions!

Why? Whats the problem with chmoding a folder to 777, saving a file then chmoding it back to 755. Why would nobody use this?.

SFGolfer wrote:
Can you set the photo gallery to use the /images directory off the root?

Yeah I though about that, had a look and all the directories in the /images folder off the root area also 755. Also how would I create a new folder in that directory during the install of my component? Can't you only create directories in the admin and front end directories of you component?


Top
  E-mail  
 
Posted: Fri Nov 06, 2009 7:52 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Feb 19, 2008 2:53 am
Posts: 43
ok looks like this page may help me and any other people who have this issue
http://docs.joomla.org/How_to_use_the_f ... em_package
But if anyone has any experience in how to do this I'd like to hear from you.


Top
  E-mail  
 
Posted: Sun Nov 08, 2009 12:09 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Feb 19, 2008 2:53 am
Posts: 43
This now seems to be working if I use the php mkdir function, but is this safe? Is this a security vulnerability and is there a better way to do this in Joomla?


Top
  E-mail  
 
Posted: Sun Nov 08, 2009 4:00 pm 
User avatar
Joomla! Champion
Joomla! Champion
Online

Joined: Fri Sep 09, 2005 2:13 pm
Posts: 6775
Location: The Netherlands
Maybe strange question: Why do you want a 777 chmod on a folder?
755 should be good enough..

_________________
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards


Top
  E-mail  
 
Posted: Sun Nov 08, 2009 6:55 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso
Offline

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4491
Location: Toronto, Canada
circsoc wrote:
Hi guys, I've had a fair bit of luck with the help I've gotten off you in the past so hopefully you can help me here.

I'm creating a photo gallery component for my new site, during the installation of the component it creates all the necessary files and folders, including the folder I wish to save user submitted photos to. This folder is in the directory components/com_photoalbum/images. However my script can not save files to this folder as by default the permission are 755. If I manually change the permissions to 777 it works fine.

It may seem like this isn't a problem, but I'd like to publish this component in the JED and want set up to be as easy and secure as possible, and don't want people to have to chmod that directory themselves.

I've tried this code in my script chmod("components/com_photoalbum/images", 0777); but this doesn't work.

What can I do to make a that directory writeable from my script? If it makes a difference my test site runs on PHP 4, but i also want it to work on PHP 5. Also when i install the component I'm installing from my tmp directory rather than uploading the .zip via FTP

Any help would be greatly appreciated, and would help me share my work with the community.

THe problem isn't your component, the problem is your server.

Make sure that the PHP/Apache user is the user that owns your files and directories. 755 and 644 should be sufficient if your server is setup properly. You also should be using JFile rather than directory PHP file system calls so that your extension will automatically use the FTP layer if it is enabled.

Ian

_________________
Joomla! Leadership Team - Production Working Group
Joomla! Bug Squad Coordinator
Joomla! Developer Documentation Team
Please don't say something 'isn't working'. Explain what you tried, and what happened as a result.


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

Quick reply

 



Who is online

Users browsing this forum: Ask Jeeves [Bot] and 33 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group