hacking parental controls

The Parental Controls GUI, by default, allows me to determine how long a user can spend logged in, in 30-minute increments. I want to modify whatever file backends this UI so that I can use 15-minute increments instead.


Or, if someone knows an OSX plugin/extension/whatever that allows me to do the same thing in the GUI, that would suffice.


Thanks & go!

MacBook Air, Mac OS X (10.7.2)

Posted on Jan 6, 2012 8:03 AM

Reply
3 replies

Jan 6, 2012 12:32 PM in response to Geoffrey Barnes

The settings are saved at


“/Library/Managed Preferences/$RESTRICTED_USER/com.apple.familycontrols.timelimits.plist”

where $RESTRICTED_USER is the short username of the account you want to parentally control.


You can modify this two ways.


Neither are particularly user-friendly.


I’m going to refer to that full filename path as “$PLIST” and assume the username is ‘ethan’


RESTRICTED_USER=ethan


PLIST=“/Library/Managed Preferences/$RESTRICTED_USER/com.apple.familycontrols.timelimits.plist”


in Terminal,

sudo defaults read "$PLIST"


will show you the settings, which you could modify using

sudo defaults write
but there are arrays involved and that always gets ugly IMO.


A slightly easier way is to edit the plist directly:


First, you have to convert it to XML so you can edit it:


sudo plutil -convert xml1 "$PLIST"


Then you want to edit it in a text editor. This next command will open the file in TextEdit:


sudo open -n -W -F -e "$PLIST"


When you are done editing the file, quit TextEdit, and then run


sudo plutil -convert binary1 "$PLIST"


This will change the plist back into binary form. That may not be necessary, but it won’t hurt.


NOTE: if you use BBEdit, their command line tool

bbedit
will automatically convert the plist, so you could just do this instead:


bbedit "$PLIST"


and it will prompt you to enter your admin password when needed.


The file has settings for Day 0 (Monday) to Day 4 (Friday) and then separate settings for Day 5 and 6 (Saturday and Sunday). (Only a computer scientist would start the week on Monday and number it 0.)


<key>timeLimitSeconds</key> <integer>10800</integer>


That controls how long the account can be used for. 900 seconds would be 15 minutes.


I hope that helps.


Note: you can see the script I made at http://dl.dropbox.com/u/18414/bin/pc-restrict-time.sh

Jan 6, 2012 12:43 PM in response to TJLuoma

TJ, this is great, and totally works. Thank you.


I wanted to post a third way, for people who might have XCode installed. Since XCode has plist editor baked in, you can just open the plist files and edit the node in the GUI - which will be a lot easier for nontechnical folks, with the one conspicuous exception being that nontechnical folks won't likely have XCode installed. So it goes.


First, you have to launch XCode with sudo. To do this, just open terminal and type "sudo [path toXCode]". That'll do, donkey.


Second, navigate to, and open, the plist file as described above. Simply double-clicking it will work.


Third, expand the nodes: limits-list, Item 0, allowances, and whichever time block you are editing for (0 is weekdays, 1 is weekends).


Fourth, change the value of timeLimitSeconds (using seconds, of course) to your desired value.


Fifth, save and close.


All this said, and the better part of an hour spent researching, TJ's script is probably the very easiest way to accomplish this, at this point. You have to be a particularly fussy type of parent for this to mean as much as it does to me, but again, so it goes.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

hacking parental controls

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.