diff --git a/system/controllers/settings.php b/system/controllers/settings.php index 949ec7d9..4096a8d7 100644 --- a/system/controllers/settings.php +++ b/system/controllers/settings.php @@ -12,6 +12,33 @@ $action = $routes['1']; $ui->assign('_admin', $admin); switch ($action) { + case 'devices': + $files = scandir($DEVICE_PATH); + $devices = []; + foreach ($files as $file) { + $ext = pathinfo($file, PATHINFO_EXTENSION); + if ($ext == 'php') { + $dev = pathinfo($file, PATHINFO_FILENAME); + require_once $DEVICE_PATH . DIRECTORY_SEPARATOR . $file; + $dvc = new $dev; + if(method_exists($dvc, 'description')){ + $arr = $dvc->description(); + $arr['file'] = $dev; + $devices[] = $arr; + }else{ + $devices[] = [ + 'title' => $dev, + 'description' => '', + 'author' => 'unknown', + 'url' => [], + 'file' => $dev + ]; + } + } + } + $ui->assign('devices', $devices); + $ui->display('app-devices.tpl'); + break; case 'app': if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); diff --git a/system/devices/MikrotikHotspot.php b/system/devices/MikrotikHotspot.php index 63fe2d5b..8ebb79b4 100644 --- a/system/devices/MikrotikHotspot.php +++ b/system/devices/MikrotikHotspot.php @@ -13,6 +13,22 @@ use PEAR2\Net\RouterOS; class MikrotikHotspot { + // show Description + function description() + { + return [ + 'title' => 'Mikrotik Hotspot', + 'description' => 'To handle connection between PHPNuxBill with Mikrotik Hotspot', + 'author' => 'ibnux', + 'url' => [ + 'Github' => 'https://github.com/hotspotbilling/phpnuxbill/', + 'Telegram' => 'https://t.me/ibnux', + 'Donate' => 'https://paypal.me/ibnux' + ] + ]; + } + + function add_customer($customer, $plan) { $mikrotik = $this->info($plan['routers']); diff --git a/system/devices/MikrotikPppoe.php b/system/devices/MikrotikPppoe.php index b9817a7d..6c311b3d 100644 --- a/system/devices/MikrotikPppoe.php +++ b/system/devices/MikrotikPppoe.php @@ -12,6 +12,20 @@ use PEAR2\Net\RouterOS; class MikrotikPppoe { + // show Description + function description() + { + return [ + 'title' => 'Mikrotik PPPOE', + 'description' => 'To handle connection between PHPNuxBill with Mikrotik PPPOE', + 'author' => 'ibnux', + 'url' => [ + 'Github' => 'https://github.com/hotspotbilling/phpnuxbill/', + 'Telegram' => 'https://t.me/ibnux', + 'Donate' => 'https://paypal.me/ibnux' + ] + ]; + } function add_customer($customer, $plan) { diff --git a/system/devices/Radius.php b/system/devices/Radius.php index df209e60..dd7087fb 100644 --- a/system/devices/Radius.php +++ b/system/devices/Radius.php @@ -11,6 +11,21 @@ class Radius { + // show Description + function description() + { + return [ + 'title' => 'Radius', + 'description' => 'Radius system with database Mysql/Mariadb as database', + 'author' => 'ibnux', + 'url' => [ + 'Github' => 'https://github.com/hotspotbilling/phpnuxbill/', + 'Telegram' => 'https://t.me/ibnux', + 'Donate' => 'https://paypal.me/ibnux' + ] + ]; + } + function add_customer($customer, $plan) { global $b; diff --git a/system/devices/readme.md b/system/devices/readme.md index 8188cef7..52551ef0 100644 --- a/system/devices/readme.md +++ b/system/devices/readme.md @@ -7,6 +7,22 @@ just follow the template class FileName { + // show Description + function description() + { + return [ + 'title' => 'Device', + 'description' => '', + 'author' => 'ibnu maksum', + 'url' => [ + 'Github' => 'https://github.com/hotspotbilling/phpnuxbill/', + 'Telegram' => 'https://t.me/ibnux', + 'Donate' => 'https://paypal.me/ibnux', + 'any text' => 'Any Url' + ] + ]; + } + // Add Customer to Mikrotik/Device function add_customer($customer, $plan) { diff --git a/system/lan/indonesia.json b/system/lan/indonesia.json index 11266189..61a5fa43 100644 --- a/system/lan/indonesia.json +++ b/system/lan/indonesia.json @@ -560,5 +560,6 @@ "Please_wait_1039_seconds_before_sending_another_SMS": "Harap tunggu 1039 detik sebelum mengirim SMS lainnya", "Please_wait_1015_seconds_before_sending_another_SMS": "Harap tunggu 1015 detik sebelum mengirim SMS lainnya", "Phone_number_updated_successfully": "Nomor telepon berhasil diperbarui", - "You_cannot_use_your_current_phone_number": "Anda tidak dapat menggunakan nomor telepon Anda saat ini" + "You_cannot_use_your_current_phone_number": "Anda tidak dapat menggunakan nomor telepon Anda saat ini", + "Devices": "Perangkat" } \ No newline at end of file diff --git a/ui/ui/app-devices.tpl b/ui/ui/app-devices.tpl new file mode 100644 index 00000000..1943cf22 --- /dev/null +++ b/ui/ui/app-devices.tpl @@ -0,0 +1,31 @@ +{include file="sections/header.tpl"} + +
+
+ Installed Devices +
+
+
+ {foreach $devices as $d} +
+
+
{$d['title']} by {$d['author']}
+
+
{nl2br(strip_tags($d['description']))}
+
+ +
+
+ {/foreach} +
+
+
+ +{include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/sections/header.tpl b/ui/ui/sections/header.tpl index ae519bad..dbcb6673 100644 --- a/ui/ui/sections/header.tpl +++ b/ui/ui/sections/header.tpl @@ -433,6 +433,8 @@ href="{$_url}settings/maintenance">{Lang::T('Maintenance Mode')}
  • {Lang::T('User Notification')}
  • +
  • {Lang::T('Devices')}
  • {/if} {if in_array($_admin['user_type'],['SuperAdmin','Admin','Agent'])}