Click here to view code image
acl freetime time MTWHFAS 18:00-23:59
This time, the category is called freetime and the condition is time,
which means you need to specify what time the category should contain. The
seven characters following that are the days of the week: Monday, Tuesday,
Wednesday, tHursday, Friday, sAturday, and Sunday. Thursday and Saturday
use capital H and A so they do not clash with Tuesday and Sunday.
With that category defined, you can change the http_access line to
include it, like this:
Click here to view code image
http_access allow newssites freetime
For Squid to allow access now, it must match both conditions—the request
must be for either *.bbc.co.uk or slashdot.org, and it must be
during the time specified. If either condition does not match, the line is not
matched, and Squid continues looking for other matching rules beneath it.
The times you specify here are inclusive on both sides, which means users in
the freetime category are able to surf from 18:00:00 until 23:59:59.
You can add as many rules as you like, although you should be careful to try
to order them so that they make sense. Keep in mind that all conditions in a
line must be matched for the line to be matched. Here is a more complex
example:
You want a category newssites that contains serious websites people
need for their work.
You want a category playsites that contains websites people do not
need for their work.
You want a category worktime that stretches from 09:00 to 18:00.
You want a category freetime that stretches from 18:00 to 20:00,
when the office closes.
You want people to be able to access the news sites but not the play sites
during working hours.
You want people to be able to access both the news sites and the play
sites during the free-time hours.
To do all this, you need the following rules:
Click here to view code image
acl newssites dstdomain .bbc.co.uk .slashdot.org