http://www.icyphoenix.com/viewtopic.php?f=30&t=477&p=4311#p4311
-----------------------------------
moreteavicar
Tue 31 Oct, 2006 03:45

Re: Simple CHMOD Script For Linux Shell Users
-----------------------------------
@MG I like the colour scheme  :mrgreen: 
I just noticed that there is one small problem with the array assignment (partly my fault for using direct assignments) - the for loops should now start from 0 not 1.

Anyway, for a little fun, I have just re-built this script to include ftp capabilities... From doing some reading, it appears that php 4 doesn't support chmod through php anyway, so this new routine checks for this, then decides on appropriate method. If ftp is chosen, it checks if ftp_chmod exists, because not all servers have this enabled. If not, it creates the ftp_chmod function using SITE command. The input form is checked at every stage of ftp (first for connection, then for login) if along the way there is a fault, the user is prompted to check/enter the correct details.. and at any time they can cancel the ftp system and the file list is given so they can do it manually.

File attached as its too big to post here now! To test the ftp section (if you have php chmod on your server), simply change this line
[codeblock]if (!function_exists('chmod'))[/codeblock] on line 105 to [codeblock]if (function_exists('chmod'))[/codeblock]. It would be nice to see how other people find the ftp compatibility, because I have a feeling some servers act differently, for example on my server, I found the path had to relative to /public_html/, so it has been set up for that. However, some might find it is /home/public_html/ (I hope not but....)

The way this has been coded, it isn't dependent on its filename, so you can copy and paste it to the end of the install script if you wanted to.

**Attachment removed, as it has been updated**


