FTP_permissions addon v1.0 Beta

[1] What is FTP_permissions?

INTRODUCTION On most hosts Pixelpost requires a chmod 777 (full access to everyone) to both the images and thumbnails folders to enable the uploading of images. A chmod of 777 will effectively set the folders open for anyone. Although, in general, this won’t be a much exploited thing but it is better to be safe then sorry.

The FTP_permissions addon was developed to address this problem and adds more security to the Pixelpost folder setup. With this addon a FTP connection is build which can be used to open/close the folders automatically or manually for writing.

Some hosting companies actually do a good job and they do not require a chmod 777 on the folders to upload a file. Before installing this addon you should test if your folders are writeable with a chmod of 755.

This can be set by your favorite FTP client or at the control panel your hosting company provides. Try uploading a picture when the folders have a chmod of 755.

If this works, you're in luck. You don't need this addon. If it doesn't upload a picture, you're also in luck. You already downloaded this beautiful addon and you're one step closer to a more secure folder setup.

[2] Installation - admin side

INTRODUCTION The installation is quite straightforward, it will only affect the admin side of Pixelpost. It requires uploading one file to a specific folder. Details are below.

STEP 01 Upload the file in the 'addon' folder located in the zip file to your 'addons' directory located on the root of your Pixelpost.

STEP 02 Login to your Pixelpost admin site and go to the 'addons' tab. Check if the FTP_permissions addon is there and if it is "ON".

Note, the first time viewing this page, the FTP_permissions addon will create a 'FTPpermissions' table for storing settings.

Please note that your password to access the FTP is not stored in anyway. When the password is needed it has to be provided by the user through the interface.
STEP 03 You can now explore the settings needed for this addon. Please go to the 'Options' tab of your Pixelpost installation. There you'll find a new menu item called SECURITY, where all options can be set. Feel free to change settings at this point, but they are described in detail later on for better understandability.

[3] Administration Settings

INTRODUCTION Here is a description of all administrative settings located on the options section for this addon.

FTP Password: The field for the FTP Password in the "Set folder permissions" section cannot be considered an administration setting. This field is used mainly to open and close the folders manually by pressing the corresponding button.

If you provided the correct information needed to connect through FTP you will see messages stating the folders have changed to chmod 755 or chmod 777. If the settings are wrong, you'll see error messages. Below you can find a list of possible error messages.

Possible errors:

"Unable to connect to FTP server. Please check the settings" => this error is most likely because of a wrong host, wrong username, wrong password or a combination of the aforementioned settings.

"Unable to set folder permissions. Please check the settings" => the FTP path is not correct, therefore the settings for the folder could not be set.
FTP Host: This is the hostname you use to connect through FTP. This setting was provided to you by your hosting company.

FTP Username: This is the username you use to connect through FTP. This setting was provided to you by your hosting company.

FTP Path: The full FTP path to the root of the pixelpost installation. (e.g. public_html/pixelpost/)

This is actually the most tricky part of the installation. The easiest way to determine this path is by loging in to your server with your favorite FTP software and write down the paths you need to open to get to your Pixelpost installation.

Do not forget the trailing slash "/" (without quotation marks) at the end. Press the button in the previous section to test if it works.
Use passive mode: In passive mode, data connections are initiated by the client, rather than by the server. It may be needed if the client is behind firewall and will prevent connection problems. Set this setting to 'yes' if you experience connection problems (only if you have double checked the FTP connection settings).

automatic opening
and closing:
The addon can be used to handle all opening and closing automatically. In the "New Image" form a new field is added in which you can provide your FTP password. Upon uploading folders are opened and closed automatically as needed. The options in the "New Image" form will be discussed in the next section.

[4] Automatic vs manual opening and closing

INTRODUCTION The FTP_permissions addon can be used to either open/close the folders manually or automatically. In this section more detailed information is given for both methods.

Manually Under the 'Options' tab of your Pixelpost installation you'll find a new menu item called SECURITY. In this page you can provide the FTP password and press the button to do the corresponding action. This is also known as manually opening/closing the folders.

Note, the caption on the button changes depending on the state of the folders.
However, the major drawback of this approach is the fact when you manually open your folders you have to close them also by hand. If you are like me, it is not unlikely you will forget this.

While uploading a new image you will get information if the folders are open or closed and a suggestion to go to the options page to open them manually.

Note, when the hosting company has done a good job your folders are still writeable with chmod 755. So if you have set your folders to chmod 755 and the addon reports the folders are open for writing, you're in luck. You do not need this addon. Just leave the folders to chmod 755 and be happy with a secure folders setup.
Automatically With the introduction of more workspaces in Pixelpost 1.6 it is now possible to perform actions before and after uploading. These features are used when the automatic opening and closing setting is set to 'yes'.

While uploading a new image you will see an extra field asking for the FTP Password. In case you have multiple pictures you want to upload and cannot be bothered by typing the FTP Password everytime there is an option to remember the password for the duration of the browser session. The addon takes care of the opening and closing of the folders which makes your life a bit easier.

[5] Uninstalling FTP_permissions

INTRODUCTION Currently there is no user-friendly way of deleting this addon. I spent so much time writing it, I never thought that someone may want to delete it! However, here is a checklist of things you need to manually delete.

Files:
'admin_ftp_permissions.php' - In addons folder
Database data:
'FTPpermissions' - Table which contains setting
   information
Note, if you are not familiar with database administration, just leave these items floating in your database until I release another version that may do this for you.

[6] Some Known Issues

INTRODUCTION You will find a list of know issues below. This list may change from time to time depending on the release of newer versions of this addon.
ISSUES None at this point.

[7] Future development

INTRODUCTION If you have any ideas not listed bellow that may make this addon more useful, please feel free to email at schonhose@gmail.com.

FUTURE DEV 1 - Automatic FTP Path detection
      I'm still exploring ways to detect the FTP Path automatically

2 - Uninstall procedure.
      A uninstall procedure, cleaning the database and remove the file


[8] Version History

INTRODUCTION Key:
[!] Important
[+] New
[-] Fixed error
[*] Changes

Note: Currently the addon is in beta version, but it has been stable for the last few months.
HISTORY Beta version

Initial release (version 1.0)
[*] Provided more detailed errormessages and statusmessages