
User Manager
48
•• How to create timed Voucher?
•• Cannot access User Manager WEB interface
•• Incorrect time shown for sessions and credits
•• User Manager does not allow to login due to expired uptime
•• How to debug PayPal payments
•• How to send logs to a remote host, using SysLog
API PHP package
Client
The examples on this page use the PEAR2_Net_RouterOS
[1]
package. You can install it with Pyrus, PEAR,
Composer or just download the ".phar" file and include it from your PHP file.
NOTE: Despite the name, PEAR(2) itself is NOT required.
NOTE: The client requires PHP 5.3.0 or later.
NOTE: The client should, in theory, work without any problems for large replies and commands, as well as any and
all RouterBOARD devices, but has not been extensively tested with such. Please report any such experiences
(positive or negative ones) at the forums
[2]
.
Credits and legal stuff
Author: Vasil Rangelov, a.k.a. boen_robot (boen [dot] robot [at] gmail [dot] com)
License: LGPL 2.1
[3]
(Summary: Use the library as you like, no requirements or restrictions; If you modify the library and publish an
application using that library, also publish the modified library itself with the original credits preserved and under the
same license)
Examples
All examples assume that you used Pyrus or PEAR for installation and have installed PEAR2_Autoload. Also, the
router is assumed to be accessible with a local IP to the device PHP runs from. The client itself could work without
these restrictions - they are specified here for clarity and consistency.
NOTE: You should be able to replace "PEAR2/Autoload.php" with the path to the ".phar" file, and have everything
"just work".
Print router logs
The following example shows the router's log into a table. You should make sure this is not publicly visible, as it
may give potential attackers useful info (especially the parts about a username having logged in by a particular
protocol).
<?php
use PEAR2\Net\RouterOS;
require_once 'PEAR2/Autoload.php';
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
Comentários a estes Manuais