This commit is contained in:
Ibnu Maksum 2023-09-27 15:01:48 +07:00
parent a313d45b03
commit 321ac3a35a
No known key found for this signature in database
GPG key ID: 7FC82848810579E5
16 changed files with 33 additions and 44 deletions

View file

@ -18,7 +18,9 @@ class Http
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
if(is_array($headers) && count($headers)>0){
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if (!empty($http_proxy)) {
curl_setopt($ch, CURLOPT_PROXY, $http_proxy);
@ -55,7 +57,9 @@ class Http
}
}
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($array_post));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
if(is_array($headers) && count($headers)>0){
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
}
if (!empty($basic)) {
curl_setopt($ch, CURLOPT_USERPWD, $basic);
}
@ -90,7 +94,9 @@ class Http
}
}
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_post));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
if(is_array($headers) && count($headers)>0){
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
}
if (!empty($basic)) {
curl_setopt($ch, CURLOPT_USERPWD, $basic);
}

View file

@ -140,5 +140,5 @@ switch ($action) {
break;
default:
echo 'action not defined';
$ui->display('a404.tpl');
}

View file

@ -67,5 +67,5 @@ switch ($action) {
die();
break;
default:
echo 'action not defined';
$ui->display('a404.tpl');
}

View file

@ -30,5 +30,5 @@ switch ($action) {
}
break;
default:
echo 'action not defined';
$ui->display('404.tpl');
}

View file

@ -135,5 +135,5 @@ switch ($action) {
break;
default:
echo 'action not defined';
$ui->display('a404.tpl');
}

View file

@ -348,5 +348,5 @@ EOF;
break;
default:
echo 'action not defined';
$ui->display('a404.tpl');
}

View file

@ -439,5 +439,5 @@ switch ($action) {
}
break;
default:
echo 'action not defined';
$ui->display('a404.tpl');
}

View file

@ -25,10 +25,12 @@ switch ($action) {
$nas = ORM::for_table('nas', 'radius')->find_many();
$ui->assign('nas', $nas);
$ui->display('radius-nas.tpl');
break;
case 'nas-add':
$ui->assign('_system_menu', 'network');
$ui->assign('_title', "Network Access Server");
$ui->display('radius-nas-add.tpl');
break;
case 'nas-add-post':
$shortname = _post('shortname');
$nasname = _post('nasname');
@ -79,6 +81,7 @@ switch ($action) {
}else{
r2(U . 'radius/nas-add', 'e', $msg);
}
break;
default:
$ui->display('a404.tpl');
}

View file

@ -80,5 +80,5 @@ switch ($action) {
break;
default:
echo 'action not defined';
$ui->display('a404.tpl');
}

View file

@ -619,5 +619,5 @@ switch ($action) {
}
break;
default:
echo 'action not defined';
$ui->display('a404.tpl');
}

View file

@ -716,5 +716,5 @@ switch ($action) {
break;
default:
echo 'action not defined';
$ui->display('a404.tpl');
}

View file

@ -54,5 +54,5 @@ switch ($action) {
break;
default:
$ui->display('404.tpl');
$ui->display('a404.tpl');
}

View file

@ -403,3 +403,4 @@ $_L['Deactivate'] = 'Deactivate';
$_L['Sync'] = 'Sync';
$_L['Failed_to_create_PaymeTrust_transaction'] = 'Failed to create PaymeTrust transaction.';
$_L['Location'] = 'Location';
$_L['Radius_Plans'] = 'Radius Plans';

View file

@ -1,27 +0,0 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
if(php_sapi_name() !== 'cli'){
die("RUN ON COMMAND LINE ONLY BY RADIUS ENGINE");
}
require_once __DIR__.File::pathFixer('/../config.php');
require_once __DIR__.File::pathFixer('orm.php');
require_once __DIR__.File::pathFixer('/autoload/PEAR2/Autoload.php');
include __DIR__.File::pathFixer("/autoload/Hookers.php");
use PEAR2\Net\RouterOS;
ORM::configure("mysql:host=$db_host;dbname=$db_name");
ORM::configure('username', $db_user);
ORM::configure('password', $db_password);
ORM::configure('return_result_sets', true);
ORM::configure('logging', true);
$result = ORM::for_table('tbl_appconfig')->find_many();
foreach($result as $value){
$config[$value['setting']]=$value['value'];
}
date_default_timezone_set($config['timezone']);

View file

@ -21,5 +21,9 @@
"2023.9.5" : [
"DROP TABLE `tbl_language`;",
"ALTER TABLE `tbl_plans` ADD `pool_expired` varchar(40) NOT NULL DEFAULT '' AFTER `pool`;"
],
"2023.9.27" : [
"ALTER TABLE `tbl_plans` CHANGE `type` `type` ENUM('Hotspot','PPPOE','Balance','Radius') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;",
"ALTER TABLE `tbl_transactions` CHANGE `type` `type` ENUM('Hotspot','PPPOE','Balance','Radius') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;"
]
}

View file

@ -163,6 +163,8 @@
href="{$_url}services/hotspot">{$_L['Hotspot_Plans']}</a></li>
<li {if $_routes[1] eq 'pppoe'}class="active" {/if}><a
href="{$_url}services/pppoe">{$_L['PPPOE_Plans']}</a></li>
<li {if $_routes[1] eq 'radius'}class="active" {/if}><a
href="{$_url}services/radius">{Lang::T('Radius Plans')}</a></li>
<li {if $_routes[1] eq 'list'}class="active" {/if}><a
href="{$_url}bandwidth/list">{$_L['Bandwidth_Plans']}</a></li>
<li {if $_routes[1] eq 'balance'}class="active" {/if}><a
@ -199,8 +201,8 @@
<ul class="treeview-menu">
<li {if $_routes[0] eq 'routers' and $_routes[1] eq 'list'}class="active" {/if}><a
href="{$_url}routers/list">{$_L['Routers']}</a></li>
<li {if $_routes[1] eq 'nas-list' and $_routes[1] eq 'list'}class="active" {/if}><a
href="{$_url}radius/nas-list">Radius NAS</a></li>
<li {if $_routes[0] eq 'radius' and $_routes[1] eq 'nas-list'}class="active" {/if}><a
href="{$_url}radius/nas-list">Radius NAS</a></li>
<li {if $_routes[0] eq 'pool' and $_routes[1] eq 'list'}class="active" {/if}><a
href="{$_url}pool/list">{$_L['Pool']}</a></li>
{$_MENU_NETWORK}
@ -222,9 +224,9 @@
<li {if $_routes[1] eq 'Announcement'}class="active" {/if}><a
href="{$_url}pages/Announcement">{$_L['Announcement']}</a></li>
<li {if $_routes[1] eq 'Registration_Info'}class="active" {/if}><a
href="{$_url}pages/Registration_Info">{$_L['Registration_Info']}</a></li>
href="{$_url}pages/Registration_Info">{$_L['Registration_Info']}</a></li>
<li {if $_routes[1] eq 'Privacy_Policy'}class="active" {/if}><a
href="{$_url}pages/Privacy_Policy">Privacy Policy</a></li>
href="{$_url}pages/Privacy_Policy">Privacy Policy</a></li>
<li {if $_routes[1] eq 'Terms_and_Conditions'}class="active" {/if}><a
href="{$_url}pages/Terms_and_Conditions">Terms and Conditions</a></li>
{$_MENU_PAGES}