[squid-users] MySQL backend for time restrictions of clients
ngtech1ltd at gmail.com
ngtech1ltd at gmail.com
Tue Sep 6 18:21:55 UTC 2022
Hey Everyone,
I have seen a very nice to restrict internet access by hours.
The concept is pretty simple.
Per client you have a time table which contains the day and the hour in the day as integers.
For example the next table:
##
user_id, day, hour, allow
1, 0, 8, 0
1, 0, 9, 1
…
1, 0, 20, 1
1, 0, 21, 0
##
So the client with user_id 1 which is being resolved in another table can use the Internet at 09:00 until 21:00 on Sunday (day 0)
I wrote a helper that runs a query against the DB and resolve the right user_id for the IP and decides whether to allow or deny internet access.
There are other ideas on how to implement a similar solution and if someone implemented any other solution with a DB backend please share.
Thanks,
Eliezer
----
Eliezer Croitoru
NgTech, Tech Support
Mobile: +972-5-28704261
Email: <mailto:ngtech1ltd at gmail.com> ngtech1ltd at gmail.com
Web: <https://ngtech.co.il/> https://ngtech.co.il/
My-Tube: <https://tube.ngtech.co.il/> https://tube.ngtech.co.il/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20220906/845617ea/attachment-0001.htm>
More information about the squid-users
mailing list