Allow multiple devices per user but not simultaneous

Hi,

This is my first post in MT forum so you can imagine I’m a little bit new on this. I hope you can help me to do this script.

We offer internet access with a Hotspot validating users via external RADIUS. We want to limit only one connection at the same time per user but we want users to be able to connect as many devices as they want “without logging out”.

(f.e) Imagine that our user is in a hotel and has a laptop and a mobile device. When he decides to use the mobile, he should be able to logging in introducing user and password, logging out the laptop automatically.

Is that possible with PHP API? What should be best way to do it?

Regards.

you can try this [add it in hotspot user profile ON LOGIN SCRIPT]

it will automatically remove first logged in user automatically , if the same id is logged in from 2nd computer.

:local uname $user;
:local usercount 0;
:local usertime "00:00:00";
:local kickable;
:local maxuser 2;

:foreach i in=[/ip hotspot active find user=$uname] do= {
  :local curup [/ip hotspot active get $i uptime];
  :if ( $curup > $usertime ) do={
        :set usertime $curup;
        :set kickable $i;
   }
  :set usercount ($usercount+1);
}
:if ($usercount >= $maxuser) do={
  :log info "Login user: $uname ($usercount/$maxuser) - Oldest $usertime will be logout!";
  /ip hotspot active remove numbers=$kickable;
} else {
   :log info "Login user: $uname ($usercount/$maxuser)";
}

posted here first.
http://forum.mikrotik.com/t/hotspot-when-simultaneous-use-reached-kick-previous-user/58549/1

Thank you so much, I will try it and tell you.

Regards

From previous experience, this will cause a “login war” between clients and complaints to you. Best to deny second login attempt with RADIUS.

Imagine Dad and Mom in the living room logged in and watching a Netflix movie. Just as the movie reaches its climax, Junior in the bedroom connects and logs in so he can Twitter with his girlfriend, disconnecting Dad and Mom, and ruining the movie. Let the complaints begin!

Just a thought…

hahahaha nice one :wink: :laughing:

what happen when we use radius (i mean windows 2008 active directory or NPS) ??? because the user profile can not be assign to these radius users