2024-06-04 18:14:04 +08:00
|
|
|
# How To add new Devices
|
|
|
|
|
|
|
|
just follow the template
|
|
|
|
|
|
|
|
```php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
class FileName {
|
|
|
|
|
2024-06-05 18:19:24 +08:00
|
|
|
function add_customer($customer, $plan)
|
2024-06-04 18:14:04 +08:00
|
|
|
{
|
|
|
|
global $_app_stage;
|
|
|
|
if ($_app_stage == 'demo') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-05 18:19:24 +08:00
|
|
|
function remove_customer($customer, $plan)
|
2024-06-04 18:14:04 +08:00
|
|
|
{
|
|
|
|
global $_app_stage;
|
|
|
|
if ($_app_stage == 'demo') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-05 18:19:24 +08:00
|
|
|
function change_customer($customer, $plan)
|
2024-06-04 18:14:04 +08:00
|
|
|
{
|
|
|
|
global $_app_stage;
|
|
|
|
if ($_app_stage == 'demo') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function add_plan($plan)
|
|
|
|
{
|
|
|
|
global $_app_stage;
|
|
|
|
if ($_app_stage == 'demo') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function update_plan($old_name, $plan)
|
|
|
|
{
|
|
|
|
global $_app_stage;
|
|
|
|
if ($_app_stage == 'demo') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function remove_plan($plan)
|
|
|
|
{
|
|
|
|
global $_app_stage;
|
|
|
|
if ($_app_stage == 'demo') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-05 18:19:24 +08:00
|
|
|
function online_customer($customer, $router_name)
|
|
|
|
{
|
2024-06-04 18:14:04 +08:00
|
|
|
global $_app_stage;
|
|
|
|
if ($_app_stage == 'demo') {
|
2024-06-05 18:19:24 +08:00
|
|
|
return;
|
2024-06-04 18:14:04 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-05 18:19:24 +08:00
|
|
|
function connect_customer($customer, $ip, $mac_address, $router_name)
|
|
|
|
{
|
2024-06-04 18:14:04 +08:00
|
|
|
global $_app_stage;
|
|
|
|
if ($_app_stage == 'demo') {
|
2024-06-05 18:19:24 +08:00
|
|
|
return;
|
2024-06-04 18:14:04 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-05 18:19:24 +08:00
|
|
|
function disconnect_customer($customer, $router_name)
|
|
|
|
{
|
2024-06-04 18:14:04 +08:00
|
|
|
global $_app_stage;
|
|
|
|
if ($_app_stage == 'demo') {
|
2024-06-05 18:19:24 +08:00
|
|
|
return;
|
2024-06-04 18:14:04 +08:00
|
|
|
}
|
|
|
|
}
|
2024-06-05 18:19:24 +08:00
|
|
|
|
2024-06-04 18:14:04 +08:00
|
|
|
}
|
|
|
|
```
|