dengan
sistem registrasi dan
penjualan voucher
(sumber: http://wiki.mikrotik.com/wiki/Manual:Hotspot_Introduction )
USER MANAGER
Mikrotik menyediakan antarmuka radius server
yaitu UserManager (UserMan)
Dengan userman dapat dilakukan manajemen
sistem diantaranya :
1. Hotspot user dan payment system (sistem
pembayaran)
2. PPP user
3. DHCP user
4. Wireless user
5. RouterOS user
(sumber:http://wiki.mikrotik.com/wiki/User_Manager/Introduction#What_is_User_Manager)
LATAR BELAKANG DIBUAT SISTEM
REGISTRASI DAN PENJUALAN
VOUCHER
Payment yang disupport Mikrotik adalah
hanya Paypal dan Authorize.net.
(http://wiki.mikrotik.com/wiki/User_Manager/User_payments)
PAYMENT GATEWAY
Denis Basta
KONSEP SISTEM
Mikrotik API mutlak diperlukan untuk membuat
sistem registrasi user hotspot ini, service API dapat
diaktifkan di menu winbox – IP – Service – API. Di
Mikrotik v.6.2 service API sudah default enabled.
API (Application Programming Interface), adalah
antarmuka pemrograman aplikasi, biasanya berupa
sekumpulan fungsi, perintah maupun protokol untuk
berinteraksi dengan sistem operasi atau aplikasi lain.
Webserver dan Mikrotik Hotspot Server dihubungkan
dengan menggunakan library ROS_API PHP.
Untuk mengakses Mikrotik melalui API diperlukan IP
address, username dan password.
ROUTEROS PHP API CLASS
V1.4
http://wiki.mikrotik.com/wiki/API_PHP_class
API - RESPONSE
Contoh fungsi API (GetSystemResource) Mikrotik
function GetSystemResource(){
foreach($this->GetServerAPI() as $row){
$API = new routeros_api();
//$API->debug = true;
if ($API->connect($row->ServerIP, $row->User, $row->Password))
{
return $API->comm('/system/resource/print');
}
$API->disconnect();
}
}
API – RESPONSE – (debug
mode)
Response
Connection attempt #1 to 192.168.100.77:8728... <<< [6] /login >>> [5/5] bytes read.
>>> [5, 39]!done >>> [37/37] bytes read. >>> [37,
1]=ret=08a2ff433feaa27e16f9800b7a76720c <<< [6] /login <<< [9] =name=cwx
<<< [44] =response=00754f9fbe6f6bc662370fdd1ca62a11fc >>> [5/5] bytes read.
>>> [5, 1]!done Connected... <<< [22] /system/resource/print >>> [3/3] bytes read.
>>> [3, 369]!re >>> [20/20] bytes read. >>> [20, 348]=uptime=1w1d00:14:58 >>>
[12/12] bytes read. >>> [12, 335]=version=6.4 >>> [32/32] bytes read. >>> [32,
302]=build-time=Sep/12/2013 13:52:41 >>> [21/21] bytes read. >>> [21, 280]=free-
memory=46874624 >>> [22/22] bytes read. >>> [22, 257]=total-memory=67108864
>>> [19/19] bytes read. >>> [19, 237]=cpu=MIPS 24Kc V7.4 >>> [12/12] bytes
read. >>> [12, 224]=cpu-count=1 >>> [18/18] bytes read. >>> [18, 205]=cpu-
frequency=300 >>> [11/11] bytes read. >>> [11, 193]=cpu-load=2 >>> [24/24]
bytes read. >>> [24, 168]=free-hdd-space=48586752 >>> [25/25] bytes read. >>>
[25, 142]=total-hdd-space=66846720 >>> [30/30] bytes read. >>> [30, 111]=write-
sect-since-reboot=43699 >>> [25/25] bytes read. >>> [25, 85]=write-sect-
total=1785982 >>> [13/13] bytes read. >>> [13, 71]=bad-blocks=0 >>> [25/25]
bytes read. >>> [25, 45]=architecture-name=mipsbe >>> [17/17] bytes read. >>>
[17, 27]=board-name=RB450 >>> [18/18] bytes read. >>> [18,
8]=platform=MikroTik >>> [5/5] bytes read. >>> [5, 1]!done
API – RESPONSE
CONTOH LAIN API -
RESPONSE
Contoh lain fungsi API (GetHotspotUser)
Mikrotik
function GetHotspotUser(){
foreach($this->fungsi->GetServerAPI() as $row){
$API = new routeros_api();
$API->debug = true;
if($API->connect($row->ServerIP, $row->User, $row->Password)){
return $ARRAY = $API->comm('/tool/user-manager/user/print'); }
$API->disconnect();
}
}
API – RESPONSE
CONTOH TOPOLOGI
HALAMAN LOGIN
ALUR DIAGRAM PROSES REGISTRASI
(sisi klien)
ALUR PROSES – PEMBELIAN VOUCHER
“DEMO-MUM-AGUS-IRIAWAN”
Ada pertanyaan?