mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-03-11 14:53:34 +08:00
Hotspot Radius Voucher Only done
This commit is contained in:
parent
7a40fe6e11
commit
9d564f55ec
11 changed files with 60 additions and 40 deletions
|
@ -67,8 +67,7 @@ try {
|
|||
$v = ORM::for_table('tbl_voucher')->where('code', $username)->where('routers', 'radius')->find_one();
|
||||
if ($v) {
|
||||
if ($v['status'] == 0) {
|
||||
// voucher activation
|
||||
if (Package::rechargeUser(0, $v['routers'], $v1['id_plan'], "Voucher", $username)) {
|
||||
if (Package::rechargeUser(0, $v['routers'], $v['id_plan'], "Voucher", $username)) {
|
||||
$v->status = "1";
|
||||
$v->save();
|
||||
$tur = ORM::for_table('tbl_user_recharges')->where('username', $username)->find_one();
|
||||
|
@ -90,6 +89,7 @@ try {
|
|||
show_radius_result(['Reply-Message' => 'Internet Plan Expired..'], 401);
|
||||
}
|
||||
}
|
||||
die("hehe");
|
||||
break;
|
||||
case 'accounting':
|
||||
$username = _req('username');
|
||||
|
@ -126,6 +126,7 @@ try {
|
|||
$e->getTraceAsString(),
|
||||
$config['telegram_topik_error']
|
||||
);
|
||||
show_radius_result(['Reply-Message' => 'Command Failed : '.$action], 401);
|
||||
} catch (Exception $e) {
|
||||
Message::sendTelegram(
|
||||
"Sistem Error.\n" .
|
||||
|
@ -133,8 +134,9 @@ try {
|
|||
$e->getTraceAsString(),
|
||||
$config['telegram_topik_error']
|
||||
);
|
||||
show_radius_result(['Reply-Message' => 'Command Failed : '.$action], 401);
|
||||
}
|
||||
show_radius_result(['Reply-Message' => 'Invalid Command'], 401);
|
||||
show_radius_result(['Reply-Message' => 'Invalid Command : '.$action], 401);
|
||||
|
||||
function process_radiust_rest($tur, $code)
|
||||
{
|
||||
|
|
|
@ -27,11 +27,12 @@ class Package
|
|||
$time = date("H:i:s");
|
||||
$inv = "";
|
||||
$isVoucher = false;
|
||||
$c = [];
|
||||
|
||||
if ($id_customer == '' or $router_name == '' or $plan_id == '') {
|
||||
return false;
|
||||
}
|
||||
if($channel == 'Voucher' && $id_customer = 0){
|
||||
if(trim($gateway) == 'Voucher' && $id_customer == 0){
|
||||
$isVoucher = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ class Dummy {
|
|||
'author' => 'ibnu maksum',
|
||||
'url' => [
|
||||
'Github' => 'https://github.com/hotspotbilling/phpnuxbill/',
|
||||
'Telegram' => 'https://t.me/ibnux',
|
||||
'Telegram' => 'https://t.me/phpnuxbill',
|
||||
'Donate' => 'https://paypal.me/ibnux'
|
||||
]
|
||||
];
|
||||
|
|
|
@ -22,7 +22,7 @@ class MikrotikHotspot
|
|||
'author' => 'ibnux',
|
||||
'url' => [
|
||||
'Github' => 'https://github.com/hotspotbilling/phpnuxbill/',
|
||||
'Telegram' => 'https://t.me/ibnux',
|
||||
'Telegram' => 'https://t.me/phpnuxbill',
|
||||
'Donate' => 'https://paypal.me/ibnux'
|
||||
]
|
||||
];
|
||||
|
|
|
@ -21,7 +21,7 @@ class MikrotikPppoe
|
|||
'author' => 'ibnux',
|
||||
'url' => [
|
||||
'Github' => 'https://github.com/hotspotbilling/phpnuxbill/',
|
||||
'Telegram' => 'https://t.me/ibnux',
|
||||
'Telegram' => 'https://t.me/phpnuxbill',
|
||||
'Donate' => 'https://paypal.me/ibnux'
|
||||
]
|
||||
];
|
||||
|
|
|
@ -20,7 +20,7 @@ class Radius
|
|||
'author' => 'ibnux',
|
||||
'url' => [
|
||||
'Github' => 'https://github.com/hotspotbilling/phpnuxbill/',
|
||||
'Telegram' => 'https://t.me/ibnux',
|
||||
'Telegram' => 'https://t.me/phpnuxbill',
|
||||
'Donate' => 'https://paypal.me/ibnux'
|
||||
]
|
||||
];
|
||||
|
|
|
@ -11,7 +11,7 @@ class RadiusRest {
|
|||
'author' => 'ibnu maksum',
|
||||
'url' => [
|
||||
'Wiki Tutorial' => 'https://github.com/hotspotbilling/phpnuxbill/wiki/FreeRadius-Rest',
|
||||
'Telegram' => 'https://t.me/ibnux',
|
||||
'Telegram' => 'https://t.me/phpnuxbill',
|
||||
'Donate' => 'https://paypal.me/ibnux'
|
||||
]
|
||||
];
|
||||
|
|
|
@ -562,5 +562,6 @@
|
|||
"Phone_number_updated_successfully": "Nomor telepon berhasil diperbarui",
|
||||
"You_cannot_use_your_current_phone_number": "Anda tidak dapat menggunakan nomor telepon Anda saat ini",
|
||||
"Devices": "Perangkat",
|
||||
"Voucher_Prefix": "Awalan Voucher"
|
||||
"Voucher_Prefix": "Awalan Voucher",
|
||||
"This_account_status": "Status akun ini"
|
||||
}
|
|
@ -248,20 +248,24 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-login / on-up</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code" name="on_login" style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_login']}</textarea>
|
||||
{if !$d['is_radius']}
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-login / on-up</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code" name="on_login"
|
||||
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_login']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-logout / on-down</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code2" name="on_logout"
|
||||
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_logout']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-logout / on-down</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code2" name="on_logout" style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_logout']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-9">
|
||||
|
@ -306,11 +310,17 @@
|
|||
{/literal}
|
||||
{/if}
|
||||
|
||||
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/mode/perl/perl.min.js"></script>
|
||||
<script language="javascript" type="text/javascript"
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.js"></script>
|
||||
<script language="javascript" type="text/javascript"
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/mode/perl/perl.min.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.css"></link>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/abbott.min.css"></link>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.css">
|
||||
</link>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/abbott.min.css">
|
||||
</link>
|
||||
|
||||
<script>
|
||||
CodeMirror.fromTextArea(document.getElementById('code'), {
|
||||
|
|
|
@ -184,22 +184,24 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-login / on-up</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code" name="on_login"
|
||||
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_login']}</textarea>
|
||||
{if !$d['is_radius']}
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-login / on-up</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code" name="on_login"
|
||||
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_login']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-logout / on-down</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code2" name="on_logout"
|
||||
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_logout']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-logout / on-down</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code2" name="on_logout"
|
||||
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_logout']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
|
|
|
@ -65,6 +65,10 @@
|
|||
</table>
|
||||
</div>
|
||||
{include file="pagination.tpl"}
|
||||
<div class="bs-callout bs-callout-info" id="callout-navbar-role">
|
||||
<h4>RADIUS REST</h4>
|
||||
<p>For Radius REST, you don't need to add NAS, NAS need to add to client.conf manually</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue