PDA

View Full Version : Please help me with my first mac programming.




buskid1
Mar 12, 2008, 12:00 AM
I would like to have a way to password protect the internet at my business computers. I have done a bit of research and can't really find a good solutions. I have looked into applescript and after a whole 4 hours of self-training, came up with the following:

if text returned of (display dialog "Admin Only. Enter Safari password:" default answer "" buttons "OK" default button 1) is "password" then
tell application "Safari"
activate
end tell
end if

The problem here is the multiple icons on the desktop. My employees will eventually get savvy and notice that they can add safari to the dock or desktop.:confused:

I tried masking the icon by changing the name of safari.app and calling the script app "Safari". I also changed the script icon to match Safari. Now I have two icons and i figure that after a while they'll notice this and access safari direct. :confused:

Unless there is a different solution you know, is there I way I can get around this?

I was wondering if there was a way to make the script app, have it rename and bring up safari, delete itself from the dock, then when safari quits, or the mac is restarted, have the script return itself to the dock? :eek:

Maybe I am making this to complicated. Wadda ya think?

:cool:The Cool One:cool:

You people Rock.



mason.kramer
Mar 12, 2008, 12:39 AM
I think that by far, the cleanest way to do this is to use separate accounts. If you let a user interface with your computer as an administrator user, there is no way that you're going to be able to lock them out of doing something, short of building an entire security system on top of Mac OS's built in system.

Situations like this are exactly the the reason that separate accounts exist at all. Here's what I would do: Create an Employee account with limited access and then enable Parental Controls and block Employee's web access.

Apple Menu -> System Preferences -> Accounts -> Create a limited account for your employees. (In order to do this, you might have to "click the lock to make changes" and authenticate). While you are there, click Login Options and enable Fast User Switching.

Then, click on your Employee account -> Enable Parental Controls ->Go to Parental Controls -> click the Content tab -> check Only Allow Aaccess to These Websites -> delete all the default websites.

Give the employees the password to the regular account and change the administrator's password to something only you know. Use Fast User Switching to switch to your account when you want to use the computer, and don't forget to log out when you're done.

Edit, I haven't tested this.

buskid1
Mar 12, 2008, 12:57 AM
I know I can setup different user accounts and deny access to the web; but at this point this is not something I think is viable for what I am trying to accomplish. This is why I am looking into this script.

Don't get me wrong, I appreciate the idea, but it's already been discussed. If I can't do it, then I can't do it. If I can, i figure this is the place to ask!:apple:

mason.kramer
Mar 12, 2008, 08:03 AM
I don't know another way to do this. I'm fairly certain it can't be applescripted.

robbieduncan
Mar 12, 2008, 08:12 AM
If you don't trust your employees why are you employing them?

If you do trust your employees why do you need to limit them?

lazydog
Mar 12, 2008, 08:20 AM
How about this way:-

Create an account and disable Safari for that account. Then in something like RealBasic, create your own browser. This sounds like a big job but actually can be done in very few lines of code. In fact one of the tutorials I believe does just this. You can then easily add a password. The browser will won't be very sophisticated though… so it might not be a practical solution.

Another option is to install a proxy server.

b e n