I am new in PHP API command, please I need an example to disable an user in HotSpot that login by MAC
Please let`s think that the MAC is 00:00:00:00:00.
Also I need to remove the MAC 00:00:00:00:00 in /ip hotspot host .
To disable:
ip hot use set [find name=00:02:55:BF:07:59] disable=yes
To enable
ip hot use set [find name=00:02:55:BF:07:59] disable=no
To remove
ip hot use remove [find name=00:02:55:BF:07:59]
I have seen some samples but I dont understan the las part (both cases enable/disable and remove ) when you refer to the .id , When I write my program in PHP, I dont have the .id ; so what exactly Do I have to put in my PHP program (Sorry my question I think that I dont understan for my english) If you could show me exactly what do I have to put in my PHP program I will really apreciate it.
Sorry ( I dont know how to say in englis closed, no smart,… but I dont get it. )
I will put in my PHP API program all these and in that same form:
/ip/hotspot/user/print
=.proplist=.id
?name=00:02:55:BF:07:59
/ip/hotspot/user/set
=.id=your_id_here What does mean “your_id_here”, I am doing a program to enable or disable any MAC, so now is
?disabled=yes
I am doing a program to enable or disable any MAC, so now is 00:02:55:BF:07:59 ,but then will be another so will be another MAC and another .id.. It is a program in PHP I want that work for any time just I put the any MAC
I am asking because I am doing a aplication in PHP to disable or enable the MAC .. so my program will ask me .. introduce the MAC TO DISABLE, I will put the MAC, my program take these , put into a variable and the send the comands to the router to disable that MAC.
so what’s problem?.. you send ‘/print’ command with any MAC you want, receive its .id, then do with it what you want: disable, remove, even change MAC =)
So. to get the .id I have to run the funtion read() and put into a variable what is sending the router , then send the command to disable/enable with that varibale,
If I am Ok.. please could you show me with all lines commands that i have to use (I am using the funtion that are in wiki.mikrotik.api ) please using that funtion. could you write me how to do that..
I am using $v_mac as the variable that have the MAC
\
<?php
require('routeros_api.class.php');
$API = new routeros_api();
$API->debug = true;
if ($API->connect('111.111.111.111', 'LOGIN', 'PASSWORD')) {
$API->write('/ip/hotspot/user/print');
$API->write('=.proplist=.id');
$API->write('?name='.$v_mac); ...????????it is ok?
THEN????
\
\
$API->disconnect();
}
?>
1 ) One more question. I will use it to enable/disable, add/ remove user a lot of other things etc etc etc.., Do I have to be carefull with something, or waht will I could not do or waht command are possible to execute or which ones not..
If I use a User Manager ..
2.1 Could I use these API command to enable/disable user that are in User manager
2.2 If I use User Manager DO I have to have the user in the User Manager and in each
router too ?
2.1 Does User Manager have a walled garden…like HotSpot
2.1 Have a profile (to use diferentes Band with) to apli to diferents user
Please I did read about User Manager but In some place I read that I have to delete all configuration of the Hotspot in each router to be able to use the User Manager:
Note, first local HotSpot database is consulted, then User Manager database.
It means that if you have configuration in ‘/ ip hotspot user print’, users will be able to authenticate in HotSpot using these data. Delete users configuration from ‘/ ip hotspot print’ to stop using local HotSpot database for authentication. To move batch of local HotSpot users to the User Manager database use export/import . Use text editor program to create appropriate file to import local users to the User Manager database.
Sorry I dont Understand, If I have to keep the local configuration of each user ( to be able to use the "advertising and script " that have the profile user. So How can I use the profile user If I cant say to each user in USERMANAGER what is its profile.
Even more.. If I want to create new User DO I have to creat in local Hotspot or in USERMANAGER or both.
Hi Normis, and every one here.
Please i need some help on userman and hotspot is there a way i could make some users created on hotspot userman such that the name could only be active from 6pm till 7am the following day and then be disable from 7am till 6pm agin i.e they can only be use at night?