diff --git a/.gitignore b/.gitignore
index c14fa910..99dbdb61 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,4 +51,5 @@ system/devices/**
docker-compose.yml
docs/**
!docs/*.html
-!docs/*.md
\ No newline at end of file
+!docs/*.md
+.htaccess
\ No newline at end of file
diff --git a/.htaccess_firewall b/.htaccess_firewall
index 5d37c58f..e0a5bd5f 100644
--- a/.htaccess_firewall
+++ b/.htaccess_firewall
@@ -11,4 +11,12 @@
+
diff --git a/radius.php b/radius.php
index 24fb5784..183f2e0c 100644
--- a/radius.php
+++ b/radius.php
@@ -233,7 +233,7 @@ try {
$v->status = "1";
$v->used_date = date('Y-m-d H:i:s');
$v->save();
- $tur = ORM::for_table('tbl_user_recharges')->whereRaw("BINARY `code` = '$username'")->find_one();
+ $tur = ORM::for_table('tbl_user_recharges')->whereRaw("BINARY `username` = '$username'")->find_one();
if ($tur) {
process_radiust_rest($tur, $code);
} else {
@@ -264,7 +264,7 @@ try {
}
header("HTTP/1.1 200 ok");
$d = ORM::for_table('rad_acct')
- ->whereRaw("BINARY `code` = '$username'")
+ ->whereRaw("BINARY `username` = '$username'")
->where('acctstatustype', _post('acctStatusType'))
->findOne();
if (!$d) {
@@ -275,7 +275,7 @@ try {
if (_post('acctStatusType') == 'Stop') {
// log in the Start only
$start = ORM::for_table('rad_acct')
- ->whereRaw("BINARY `code` = '$username'")
+ ->whereRaw("BINARY `username` = '$username'")
->where('acctstatustype', 'Start')
->findOne();
if (!$start) {
@@ -288,6 +288,17 @@ try {
$start->acctOutputOctets = 0;
$start->acctInputOctets = 0;
}
+ $start->acctsessionid = _post('acctSessionId');
+ $start->username = $username;
+ $start->realm = _post('realm');
+ $start->nasipaddress = _post('nasip');
+ $start->nasid = _post('nasid');
+ $start->nasportid = _post('nasPortId');
+ $start->nasporttype = _post('nasPortType');
+ $start->framedipaddress = _post('framedIPAddress');
+ $start->acctstatustype = _post('acctStatusType');
+ $start->macaddr = _post('macAddr');
+ $start->dateAdded = date('Y-m-d H:i:s');
$start->save();
$d->acctOutputOctets = 0;
$d->acctInputOctets = 0;
@@ -313,7 +324,7 @@ try {
$d->dateAdded = date('Y-m-d H:i:s');
$d->save();
if ($d->acctstatustype == 'Start') {
- $tur = ORM::for_table('tbl_user_recharges')->whereRaw("BINARY `code` = '$username'")->where('status', 'on')->where('routers', 'radius')->find_one();
+ $tur = ORM::for_table('tbl_user_recharges')->whereRaw("BINARY `username` = '$username'")->where('status', 'on')->where('routers', 'radius')->find_one();
$plan = ORM::for_table('tbl_plans')->where('id', $tur['plan_id'])->find_one();
if ($plan['limit_type'] == "Data_Limit" || $plan['limit_type'] == "Both_Limit") {
$totalUsage = $d['acctOutputOctets'] + $d['acctInputOctets'];
@@ -392,7 +403,7 @@ function process_radiust_rest($tur, $code)
if ($plan['typebp'] == "Limited") {
if ($plan['limit_type'] == "Data_Limit" || $plan['limit_type'] == "Both_Limit") {
- $raddact = ORM::for_table('rad_acct')->whereRaw("BINARY `code` = '$tur[username]'")->where('acctstatustype', 'Start')->find_one();
+ $raddact = ORM::for_table('rad_acct')->whereRaw("BINARY `username` = '$tur[username]'")->where('acctstatustype', 'Start')->find_one();
$totalUsage = intval($raddact['acctOutputOctets']) + intval($raddact['acctInputOctets']);
$attrs['reply:Mikrotik-Total-Limit'] = Text::convertDataUnit($plan['data_limit'], $plan['data_unit']) - $totalUsage;
if ($attrs['reply:Mikrotik-Total-Limit'] < 0) {
diff --git a/system/boot.php b/system/boot.php
index 45f1781e..67101234 100644
--- a/system/boot.php
+++ b/system/boot.php
@@ -43,7 +43,7 @@ $ui->setConfigDir(File::pathFixer($UI_PATH . '/conf/'));
$ui->setCacheDir(File::pathFixer($UI_PATH . '/cache/'));
$ui->assign('app_url', APP_URL);
$ui->assign('_domain', str_replace('www.', '', parse_url(APP_URL, PHP_URL_HOST)));
-$ui->assign('_url', APP_URL . '/index.php?_route=');
+$ui->assign('_url', APP_URL . '/?_route=');
$ui->assign('_path', __DIR__);
$ui->assign('_c', $config);
$ui->assign('UPLOAD_PATH', str_replace($root_path, '', $UPLOAD_PATH));
@@ -66,8 +66,12 @@ if (isset($_SESSION['notify'])) {
unset($_SESSION['ntype']);
}
-// Routing Engine
-$req = _get('_route');
+if(!isset($_GET['_route'])) {
+ $req = ltrim(parse_url($_SERVER['REQUEST_URI'])['path'], '/');
+}else{
+ // Routing Engine
+ $req = _get('_route');
+}
$routes = explode('/', $req);
$ui->assign('_routes', $routes);
$handler = $routes[0];
diff --git a/system/lan/english.json b/system/lan/english.json
index 6fa32501..9337da6a 100644
--- a/system/lan/english.json
+++ b/system/lan/english.json
@@ -701,5 +701,6 @@
"Failed_to_buy_package": "Failed to buy package",
"New_Voucher_Created": "New Voucher Created",
"New_Voucher_for_10mbps_Created": "New Voucher for 10mbps Created",
- "Show_Chart": "Show Chart"
+ "Show_Chart": "Show Chart",
+ "": ""
}
\ No newline at end of file
diff --git a/ui/ui/community-rollback.tpl b/ui/ui/community-rollback.tpl
index 02a59c9d..3e039e03 100644
--- a/ui/ui/community-rollback.tpl
+++ b/ui/ui/community-rollback.tpl
@@ -15,14 +15,14 @@