【问题标题】:how to earn online user with mikrotik pear2 api?如何使用 mikrotik pear2 api 赢得在线用户?
【发布时间】:2017-05-01 06:44:00
【问题描述】:

我使用 pear2 api 断开用户与 mikrotik 的连接。与

$printRequest = new RouterOS\Request('/ip/hotspot/active/print');
        $printRequest->setArgument('.proplist', '.id,mac-address');

        $printRequest->setQuery(RouterOS\Query::where('user', $username)->andWhere('mac-address',$macAddress));

        $id = $this->client->sendSync($printRequest)->getArgument('.id');


        $removeRequest = new RouterOS\Request('/ip/hotspot/active/remove');
        $removeRequest->setArgument('numbers', $id);
        $this->client->sendSync($removeRequest);

现在我想用这个 api 让所有在线用户。请指导我。

【问题讨论】:

    标签: php mikrotik router-os


    【解决方案1】:
     $printRequest = new RouterOS\Request('/ip/hotspot/active/print');
     $printRequest->setArgument('.proplist', 'address,user,.id');
    
     $id = $this->client->sendSync($printRequest)->getAllOfType(RouterOS\Response::TYPE_DATA);
     foreach ($id as $response) {
          echo $response('.id'), '--', $response('user'), '--', $response('address'), "\n";
     }
    

    【讨论】:

    • 此解决方案已弃用。您应该使用另一个 api,因为更改了登录算法。
    猜你喜欢
    • 1970-01-01
    • 2019-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多