mitrobill/system/devices/RadiusRest.php

74 lines
1.8 KiB
PHP
Raw Normal View History

<?php
class RadiusRest {
// show Description
function description()
{
return [
'title' => 'Radius Rest API',
'description' => 'This devices will handle Radius Connection using Rest API',
'author' => 'ibnu maksum',
'url' => [
2024-07-06 22:49:02 +07:00
'Wiki Tutorial' => 'https://github.com/hotspotbilling/phpnuxbill/wiki/FreeRadius-Rest',
2024-07-10 15:47:31 +07:00
'Telegram' => 'https://t.me/phpnuxbill',
'Donate' => 'https://paypal.me/ibnux'
]
];
}
// Add Customer to Mikrotik/Device
function add_customer($customer, $plan)
{
}
// Remove Customer to Mikrotik/Device
function remove_customer($customer, $plan)
{
2024-08-09 14:41:06 +07:00
// set zero data usage
if ($plan['typebp'] == "Limited" && ($plan['limit_type'] == "Data_Limit" || $plan['limit_type'] == "Both_Limit")) {
$cs = ORM::for_table("rad_acct")->where('username', $customer['username'])->findMany();
foreach ($cs as $c) {
$c->acctOutputOctets = 0;
$c->acctInputOctets = 0;
$c->save();
}
}
}
2024-07-18 09:48:22 +07:00
// customer change username
2024-08-07 10:52:31 +07:00
public function change_username($plan, $from, $to)
2024-07-18 09:48:22 +07:00
{
}
// Add Plan to Mikrotik/Device
function add_plan($plan)
{
}
// Update Plan to Mikrotik/Device
function update_plan($old_name, $plan)
{
}
// Remove Plan from Mikrotik/Device
function remove_plan($plan)
{
}
// check if customer is online
function online_customer($customer, $router_name)
{
}
// make customer online
function connect_customer($customer, $ip, $mac_address, $router_name)
{
}
// make customer disconnect
function disconnect_customer($customer, $router_name)
{
}
}