PDA

View Full Version : program idea




Scarlet Fever
May 27, 2006, 03:33 AM
At my school we have about 25 eMacs in the music room, and they arent very well implemented into the rest of the school system of windows computers. they connect to the internet, but students cant log on in their own user accounts. There are two accounts on each of the computers; teacher and student. These macs are pretty much stock standard, so they have games, MSN etc available for them to use. I found a unix script in Macworld magazine, which changes who can do what with programs. Below, i use iChat as an example:
sudo chmod o-x /Applications/iChat.app/Contents/MacOS/iChat
This script works fine, but the problem is, if i was to do that at the school, i would have to write that script for every single app on every single computer.
So here is my idea; can someone write that script with a front end on it? I was thinking the user could select an app which they want permissions changed on, select what type of permission they have (read, write, open), and the program would do the rest for you.
Thanks in advance

EDIT: I forgot to mention that know nothing about writing in most languages. Im only really starting to touch on unix.



Soulstorm
May 27, 2006, 03:40 AM
You can easily do that with applescript. It's been a long time since I last used it, but I remember I had made something similar.

So: Make an applescript droplet which will open when you throw a program on it.

When it opens, make it call the unix functions you said above for each of the files you threw onto the droplet.

You can do that in 30-40 lines of code with applescript. The last program I made with simple applescript (not applescript studio) is Finder Utility (http://users.forthnet.gr/ath/jonmecos/Mainsite/Development/Applescript/filez/Futil.zip), which will give you an idea of what you can do. It's big, but that's only because it has many functions to perform. I wrote it when I was 15 (I'm 20 now) so, If I can do it, so can you.

jeremy.king
May 29, 2006, 05:52 PM
Um...

You can already change permissions in Finder through the Get Info window, so you won't really need a program to do it. Keep in mind, permissions can only be changed by a user who has, er, permission to it...

Rereading that, I am thinking that you want to change 25 computers at once? Are these controlled by a network server of any sort?

yellow
May 29, 2006, 05:57 PM
Offtopic, but..

If your school system has Active Directory implemented for their Windows boxes, the Macs can be included into that for user's logins. Group Policy won't apply without 3rd party stuff though. I expect that will change in Leopard.

Ontopic, if you had Apple Remote Desktop you could send UNIX commands to all the Macs at the same time.

savar
May 29, 2006, 08:54 PM
sudo chmod o-x /Applications/iChat.app/Contents/MacOS/iChat

This script works fine, but the problem is, if i was to do that at the school, i would have to write that script for every single app on every single computer.


<Sigh>

sudo chmod -R o+x

yellow
May 30, 2006, 08:53 AM
No one said it wasn't easy to defeat.. But will the average Johhny Highschool know that (or figure it out)? :)

jeremy.king
May 30, 2006, 09:00 AM
No one said it wasn't easy to defeat.. But will the average Johhny Highschool know that (or figure it out)? :)

Very true Y, but I am curious why Johnny should be changing permissions in the first place...Seems like an admin task easily accomplished through shell scripts or the previously mentioned server based approach.

yellow
May 30, 2006, 09:18 AM
IMO, Johnny shouldn't be, nor should Johnny be part of the admin group to be able to use sudo..

mkrishnan
May 30, 2006, 09:31 AM
IMO, Johnny shouldn't be, nor should Johnny be part of the admin group to be able to use sudo..

Y can't Johnny B good? :o

I just wanted to add.... isn't it better, if you do have permissions to change these things (assuming you got the administrator password through "authorized" channels) isn't it better to change what a user is allowed to use from the system preferences (I presume these student accounts are limited accounts)?

Cuz otherwise, correct me if I'm wrong, but...what exactly happens when you have the sys prefs telling the computer that user X cannot use applications Y and Z, but you use sudo chmod to change the permissions to allow that user to execute it?