>We use squid/squidGuard on Linux at our high school for Internet access. We >have had requests from a couple of teachers that, at their discretion, they >would like to disable Internet access for all PC's in the computer lab >during their class time. Suggestions for how to do this would be really >appreciated. > >Right now the teachers do not have userid's on the squid PC. They do have >Samba access to another Linux server on the same LAN. Here's a program I wrote awhile ago that lets you switch between squidguard configurations remotely from any web browser. I wrote it one snow day for a guy in Australia and it's a snow day again today :-) It isn't robust for multiple simultaneous requests, so consider it a starting point. The code is written in php so you will need to have php installed on your squid/web server. I know the code is correct php v4 code, but I don't know if it will work under v3. I would make the assumption but without testing it..... Also, I didn't do any checking *if* the program could restart squid, it just assumes it can, so permissions on squid and your config files will need to reflect that. Finally there is no password system on here yet, limit access to the system through apache for teacher terminals or some other login method. The script will allow you to add/remove files from your conf_files directory without altering the program. The conf-files directory then have squidquard.conf files that have rules stating High School lab deactivated, High School lab activated etc. The problem comes in if you have multiple teachers wanting to change rules for the same hour. The script isn't that clever and was designed for one lab on/off. It could be expanded at some point I suppose. Hope it helps. ScottSwitch SquidGuard Configurations Switch SquidGuard Configurations
Current configurations:
// PHP Program to choose a squidGuard configuration file from a // directory of choices. A form is created with possible configurations // the new configuration is copied over to replace the current config // file and squid is restarted. // The program does not do any checking for permissions to cp files, so it's // assumed the correct permissions are in place. There is no password // protection on this version, until there is anyone can run the program // and make the change to the config. // Change the variable $path to reflect the correct location for the install // of squidGuard. Currently set to the default /usr/local/squidGuard // Squid is assumed to be located at /usr/local/bin/squid // v1.0 Birth -- Scott Sherrill scott@hancock.k12.mi.us 01/30/2001 function find_configs() { // We create a simple form that consists of radio buttons // and a submit button. The radio buttons are built by // dynamically taking a list of files from a prechosen directory // $path/conf_files. A single radio button choice is passed back. global $PHP_SELF; global $path; echo "