Change Unix permissions using a web interface

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
noguru
Forum Commoner
Posts: 61
Joined: Thu Jun 06, 2002 4:03 am
Location: Just north of the City Of Gold, Land of Milk and Honey

Change Unix permissions using a web interface

Post by noguru »

Hi

I want to create a website where an admin user can specify permissions for certain users on certain UNIX directories using my web interface instead of doing it on the command line with the chmod command. How will I go about to accomplish this? I know a script file must be created containing the actual chmod command followed by the permission attributes (send as parameters), but I don't know how to create this script file in UNIX and also how to execute it with php code. I don't know Unix that well. Any help will be appreciated.

Thanks
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post by Johnm »

I do not think that you need a shell script to do this although it would work.
Look up the PHP functions:
system() and exec().

Direwolf
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You can use the chmod() function in PHP. chmod is explained here: http://cs-www.bu.edu/help/unix/using_chmod.html

Mac
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post by Johnm »

Ahhh yes... the old chmod() trick... <g>
Post Reply