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 @@ Order Allow,Deny Allow from all - \ No newline at end of file + + +RewriteEngine On +RewriteBase / +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f +RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d +RewriteRule ^(.*)$ index.php [QSA,L] \ No newline at end of file diff --git a/README.md b/README.md index 1c087fe3..918ca8cc 100644 --- a/README.md +++ b/README.md @@ -100,3 +100,10 @@ a.n Ibnu Maksum - [mlink.id](https://mlink.id) - [https://github.com/sonyinside](https://github.com/sonyinside) + +## Thanks +We appreciate all people who are participating in this project. + + + + 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 @@ {foreach $masters as $data} - {nl2br($data['commit']['message'])} - {Lang::dateTimeFormat(str_replace(['Z','T'],'',$data['commit']['author']['date']))} + {Lang::dateTimeFormat(str_replace(['Z','T'],'',$data['commit']['author']['date']))} - update + install + {nl2br($data['commit']['message'])} {/foreach} @@ -40,14 +40,14 @@ {foreach $devs as $data} - {nl2br($data['commit']['message'])} - {Lang::dateTimeFormat(str_replace(['Z','T'],'',$data['commit']['author']['date']))} + {Lang::dateTimeFormat(str_replace(['Z','T'],'',$data['commit']['author']['date']))} - update + install + {nl2br($data['commit']['message'])} {/foreach} diff --git a/ui/ui/community.tpl b/ui/ui/community.tpl index b8260a26..4f96379d 100644 --- a/ui/ui/community.tpl +++ b/ui/ui/community.tpl @@ -1,9 +1,24 @@ {include file="sections/header.tpl"} -
+


+
+ +
+
+

Contributors

+
+
+ + + +
+
+
@@ -20,8 +35,6 @@
-
-

Feedback

@@ -144,7 +157,9 @@

PHPNUXBILL

- PHPNuxBill is a billing Hotspot and PPPOE for Mikrotik using PHP and Mikrotik API to comunicate with router. If you get more profit with this application, please donate us.
Watch project in here + PHPNuxBill is a billing Hotspot and PPPOE for Mikrotik using PHP and Mikrotik API to comunicate + with router. If you get more profit with this application, please donate us.
Watch project in here
@@ -154,7 +169,8 @@ Download Latest Version
-
Select Old Version
+
Select Old Version +
diff --git a/ui/ui/sections/footer.tpl b/ui/ui/sections/footer.tpl index 8d1cd480..5df993ad 100644 --- a/ui/ui/sections/footer.tpl +++ b/ui/ui/sections/footer.tpl @@ -7,12 +7,12 @@ target="_blank">AdminLTE - - - - - - + + + + + + {if isset($xfooter)} {$xfooter} diff --git a/ui/ui/sections/header.tpl b/ui/ui/sections/header.tpl index cd337197..e7d3ac49 100644 --- a/ui/ui/sections/header.tpl +++ b/ui/ui/sections/header.tpl @@ -5,18 +5,18 @@ {$_title} - {$_c['CompanyName']} - + - + - - - - - - - - + + + + + + + +