Hello,
I’m Juliano,
I’m from Brazil,
with the PHP API, I can make this:
$API->write(“/ip/hotspot/active/remove”, false);
$API->write(“=.id=*137010A”);
$API->read();
in Winbox, I can make this:
/ip hotspot active>remove [find user=test]
I wanted remove active user, for user, using PHP API,
do you can help me ?
Sorry for my little english.
Thanks.
Chupaka
September 25, 2008, 8:40pm
2
there’s no analogue of ‘find’ in API. you should list all entries and then remove necessary item
I need remove active user hotspot for PHP API, but passing the user name and not id, do you understand?
thanks !
Chupaka
September 25, 2008, 10:37pm
4
exactly. you should ‘/ip/hotspot/active/print’, then find necessary ID for your user name, and then remove that ID
It’s a ideia, but when try to list all user with print, never get all.
I did like to make this:
$API->write(“/ip/hotspot/active/remove”, false);
$API->write(“=.id=[find user=user1]”);
but do not work.
or type:
$API->write(“/ip/hotspot/active/find”, false);
$API->write(“=where=user=user1]”);
also do not work.
an another solution, did could to be the your suggestion, but if get all users of true.
Chupaka
September 26, 2008, 6:32pm
6
did you see that? did you tried it? I think, no…
there’s no ‘find’ in API!
$API->write(“/ip/hotspot/active/print”);
[3] !re
[13] =.id=*10A040A
[15] =user=locolimpe
[18] =address=10.4.10.1
[18] =uptime=1d03:19:40
[29] =session-time-left=5d20:40:20
[24] =idle-timeout=1d12:00:00
[3] !re
[13] =.id=*137010A
[12] =user=cebola
[18] =address=10.1.55.1
[16] =uptime=00:01:56
[29] =session-time-left=6d23:58:04
[24] =idle-timeout=1d12:00:00
[3] !re
…
this I already did test, the problem is that nor always it comes all, do you know why?
Chupaka
September 26, 2008, 8:31pm
8
if you think it’s a bug - write to support@mikrotik.com
bokad
January 20, 2009, 7:27pm
11
I have something like the below where I am using the API to get a list of all hotspot active users and then selecting a single user ID to call with remove. This does not work though. It lists the users and the ID is a valid one but it does not log that person out. Is hotspot remove supported in the API?
$API->write(‘/ip/hotspot/active/print’,true);
$READ = $API->read(true);
$API->write(‘/ip/hotspot/active/remove’,false);
$API->write(‘=.id=*C0A82306’,true);
Chupaka
January 21, 2009, 7:55am
12
hmmm…
0xC0A82306 is IP address 192.168.35.6… just a coincidence, or you are confusing something?..
Same question.
I need to disconnect some user from my administration page “Active users”.
And when I say remove .id=(calculated line id number - same as telnet line id) or .id=(id from API print)…
No error and nothing happens.
Problem is maybe in API. If I understand .id must be same as line id from telnet. If not… there is no way to do something like this.
$userid = -1;
foreach ($ARRAY as $value) {
$userid = $userid + 1;
if ($value['user'] == $_GET['kill']) {
$API->write('/ip/hotspot/active/remove',false);
$API->write('.id=' . $value['.id']);
//$API->write('.id=' . $userid);
$KILL = $API->read();
}
Does anyone find solution?
I think it should be $API->write(‘= .id=’ . $value[‘.id’]);
It working!!!
Thanks very much!!!
You have a beer
hello
i’m abolfazl
how to disable hotspot server with api microtik php
help me???
How do you do it with Terminal?