show error stacktrace

This commit is contained in:
Ibnu Maksum
2023-10-12 15:47:45 +07:00
parent 7e00feb02f
commit 95097e4512
5 changed files with 29 additions and 21 deletions

View File

@ -1,8 +1,11 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
* by @ibnux
**/
_auth();
$ui->assign('_title', $_L['My_Account']);
$ui->assign('_system_menu', 'accounts');
@ -11,10 +14,6 @@ $action = $routes['1'];
$user = User::_info();
$ui->assign('_user', $user);
use PEAR2\Net\RouterOS;
require_once 'system/autoload/PEAR2/Autoload.php';
switch ($action) {
case 'change-password':

View File

@ -41,21 +41,24 @@ switch ($action) {
case 'sync':
set_time_limit(-1);
$plans = ORM::for_table('tbl_user_recharges')->where('status', 'on')->find_many();
echo count($plans);
$log = '';
$router = '';
foreach ($plans as $plan) {
if ($router != $plan['routers']) {
if ($router != $plan['routers'] && $plan['routers'] != 'radius') {
$mikrotik = Mikrotik::info($plan['routers']);
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$router = $plan['routers'];
}
$p = ORM::for_table('tbl_plans')->findOne($plan['plan_id']);
$c = ORM::for_table('tbl_customers')->findOne($plan['customer_id']);
if ($plan['type'] == 'Hotspot') {
Mikrotik::addHotspotUser($client, $p, $c);
} else if ($plan['type'] == 'PPPOE') {
Mikrotik::addPpoeUser($client, $p, $c);
if($plan['routers'] == 'radius'){
Radius::customerAddPlan($c, $p, $plans['expiration'].' '.$plans['time']);
}else{
if ($plan['type'] == 'Hotspot') {
Mikrotik::addHotspotUser($client, $p, $c);
} else if ($plan['type'] == 'PPPOE') {
Mikrotik::addPpoeUser($client, $p, $c);
}
}
$log .= "DONE : $plan[username], $plan[namebp], $plan[type], $plan[routers]<br>";
}