Koozali.org: home of the SME Server

internet

Offline 16roi

  • 2
  • +0/-0
internet
« on: March 01, 2016, 11:41:20 AM »
bonjour
est ce que il ya un moyen de programmer Accès à internet pour les utilisateurs!?
merci
salutations distinguées

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: internet
« Reply #1 on: March 01, 2016, 11:57:03 AM »
Hi
you need a custom template for squid.conf with a time based acl

for example to allow access to internet during a certain time of the day (10:00 until 11:00 am) only on Monday (M), Wednesday (W), and Friday (F).
Code: [Select]
acl someDays time MWF 10:00-11:00
http_access allow forbidden someDays
http_access deny forbidden

read here about templating:
https://wiki.contribs.org/Template-driven_configuration_system

feel free to ask

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: internet
« Reply #2 on: March 01, 2016, 12:09:21 PM »
something like:

Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/squid/squid.conf
cd /etc/e-smith/templates-custom/etc/squid/squid.conf
nano 20ACL40daytime
fill the file with something like:
Code: [Select]
acl someDays time MWF 10:00-11:00

(adjust the days/time according to your needs)

save and close the file with Ctrl-X, Y

then (you've to be in /etc/e-smith/templates-custom/etc/squid/squid.conf)
Code: [Select]
cp /etc/e-smith/templates/etc/squid/squid.conf/40http_access75AllowLocal ./
nano 40http_access75AllowLocal

edit the content and make it like:
Code: [Select]
http_access allow localsrc someDays

save it with Ctrl-x, Y
then
Code: [Select]
expand-template /etc/squid/squid.conf
service squid restart

Note: not tested, should work