I need assistance from any one who has an idea. I need to restrict the number of hours a user should be up and browsing per day. ie, if a user is to be allowed access for say, 4 hrs per day for a month. Once this uptime limit is reached, the hotspot/userman should log the user out, and allow the user access again only on the next day for another fresh 4 hours.Am running user manager and hotspot on the same router machine.
The trial user feature is what you need. You may wish to run a script at midnight to clear out trial users vs using the trail reset feature. Any MT consulant should be able to do that without an issue. They are listed here at http://www.mikrotik.com/consultants.html
Mark all user accounts this applies to with a particular comment (i.e., “4h_per_day”). Run a script every night that sets the correct attributes for those user accounts. I don’t use User Manager and don’t have access to a test box to upload it right now, so the below is just theoretical and you’ll have to adjust the commands, but I do know there’s an attribute for an uptime limit and an attribute for the timeframe within which it must be used:
:foreach USER in=[/system user-manager users find comment="4h_per_day"] do={
/system user-manager users set $USER uptime-limit=4h
/system user-manager users set $USER to-be-used-within=1d
}
Then create a scheduled job to run that script at one minute after midnight.
Hope that helps.
is it possible to use “tool” in place of “system” something like this:
:foreach user in=[/tool user-manager users find group-name="4h_per_day"] do={
/tool user-manager users set $user uptime-limit=4h
/tool user-manager users set $user to-be-used-within=1d
}
Yes. Like I said, I don’t know the specific commands. Adjust as needed.
thanks for the reply , l will try it now and give you feed back later