Fix Cron for
This commit is contained in:
parent
f38da8d3c0
commit
5867a0c9ca
@ -2,6 +2,10 @@
|
||||
|
||||
# CHANGELOG
|
||||
|
||||
## 2024.1.15
|
||||
|
||||
- Fix cron job for Plan only for admin by @Focuslinkstech
|
||||
|
||||
## 2024.1.11
|
||||
|
||||
- Add Plan only for admin by @Focuslinkstech
|
||||
|
@ -118,7 +118,7 @@ try {
|
||||
$ui->assign("error_title", "PHPNuxBill Crash");
|
||||
if (isset($_SESSION['uid'])) {
|
||||
$ui->assign("error_message", $e->getMessage() . '<br>');
|
||||
}else{
|
||||
} else {
|
||||
$ui->assign("error_message", $e->getMessage() . '<br><pre>' . $e->getTraceAsString() . '</pre>');
|
||||
}
|
||||
$ui->display('router-error.tpl');
|
||||
@ -130,13 +130,13 @@ function _notify($msg, $type = 'e')
|
||||
$_SESSION['ntype'] = $type;
|
||||
$_SESSION['notify'] = $msg;
|
||||
}
|
||||
if(empty($config['language'])){
|
||||
if (empty($config['language'])) {
|
||||
$config['language'] = 'english';
|
||||
}
|
||||
$lan_file = File::pathFixer('system/lan/' . $config['language'] . '/common.lan.php');
|
||||
if(file_exists($lan_file)){
|
||||
if (file_exists($lan_file)) {
|
||||
require $lan_file;
|
||||
}else{
|
||||
} else {
|
||||
die("$lan_file not found");
|
||||
}
|
||||
|
||||
@ -190,7 +190,11 @@ $_notifmsg_default = json_decode(file_get_contents(File::pathFixer('system/uploa
|
||||
|
||||
//register all plugin
|
||||
foreach (glob(File::pathFixer("system/plugin/*.php")) as $filename) {
|
||||
include $filename;
|
||||
try {
|
||||
include $filename;
|
||||
} catch (Throwable $e) {
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -293,7 +297,8 @@ function time_elapsed_string($datetime, $full = false)
|
||||
}
|
||||
}
|
||||
|
||||
if (!$full) $string = array_slice($string, 0, 1);
|
||||
if (!$full)
|
||||
$string = array_slice($string, 0, 1);
|
||||
return $string ? implode(', ', $string) . ' ago' : 'just now';
|
||||
}
|
||||
|
||||
@ -340,7 +345,7 @@ try {
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
if (!isset($_SESSION['aid']) || empty($_SESSION['aid'])) {
|
||||
r2(U . 'home' , 'e', $e->getMessage());
|
||||
r2(U . 'home', 'e', $e->getMessage());
|
||||
}
|
||||
$ui->assign("error_message", $e->getMessage() . '<br><pre>' . $e->getTraceAsString() . '</pre>');
|
||||
$ui->assign("error_title", "PHPNuxBill Crash");
|
||||
|
@ -35,16 +35,16 @@ if (php_sapi_name() !== 'cli') {
|
||||
echo "<pre>";
|
||||
}
|
||||
|
||||
if(!file_exists('../config.php')){
|
||||
if (!file_exists('../config.php')) {
|
||||
die("config.php file not found");
|
||||
}
|
||||
|
||||
|
||||
if(!file_exists('orm.php')){
|
||||
if (!file_exists('orm.php')) {
|
||||
die("orm.php file not found");
|
||||
}
|
||||
|
||||
if(!file_exists('uploads/notifications.default.json')){
|
||||
if (!file_exists('uploads/notifications.default.json')) {
|
||||
die("uploads/notifications.default.json file not found");
|
||||
}
|
||||
|
||||
@ -68,7 +68,13 @@ $_notifmsg_default = json_decode(file_get_contents('uploads/notifications.defaul
|
||||
|
||||
//register all plugin
|
||||
foreach (glob(File::pathFixer("plugin/*.php")) as $filename) {
|
||||
include $filename;
|
||||
try{
|
||||
include $filename;
|
||||
} catch(Throwable $e){
|
||||
//ignore plugin error
|
||||
}catch(Exception $e){
|
||||
//ignore plugin error
|
||||
}
|
||||
}
|
||||
|
||||
$result = ORM::for_table('tbl_appconfig')->find_many();
|
||||
@ -137,7 +143,7 @@ foreach ($d as $ds) {
|
||||
|
||||
// autorenewal from deposit
|
||||
if ($config['enable_balance'] == 'yes' && $c['auto_renewal']) {
|
||||
if ($p && $p['enabled'] && $c['balance'] >= $p['price'] && $p['allow_purchase'] =='yes') {
|
||||
if ($p && $p['enabled'] && $c['balance'] >= $p['price'] && $p['allow_purchase'] == 'yes') {
|
||||
if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) {
|
||||
// if success, then get the balance
|
||||
Balance::min($ds['customer_id'], $p['price']);
|
||||
@ -156,7 +162,8 @@ foreach ($d as $ds) {
|
||||
} else {
|
||||
echo "no renewall | balance $config[enable_balance] auto_renewal $c[auto_renewal]\n";
|
||||
}
|
||||
} else echo " : ACTIVE \r\n";
|
||||
} else
|
||||
echo " : ACTIVE \r\n";
|
||||
} else {
|
||||
$date_now = strtotime(date("Y-m-d H:i:s"));
|
||||
$expiration = strtotime($ds['expiration'] . ' ' . $ds['time']);
|
||||
@ -191,7 +198,7 @@ foreach ($d as $ds) {
|
||||
|
||||
// autorenewal from deposit
|
||||
if ($config['enable_balance'] == 'yes' && $c['auto_renewal']) {
|
||||
if ($p && $p['enabled'] && $c['balance'] >= $p['price']&& $p['allow_purchase'] =='yes') {
|
||||
if ($p && $p['enabled'] && $c['balance'] >= $p['price'] && $p['allow_purchase'] == 'yes') {
|
||||
if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) {
|
||||
// if success, then get the balance
|
||||
Balance::min($ds['customer_id'], $p['price']);
|
||||
@ -206,6 +213,7 @@ foreach ($d as $ds) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else echo " : ACTIVE \r\n";
|
||||
} else
|
||||
echo " : ACTIVE \r\n";
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,13 @@ $_notifmsg_default = json_decode(file_get_contents('uploads/notifications.defaul
|
||||
|
||||
//register all plugin
|
||||
foreach (glob(File::pathFixer("plugin/*.php")) as $filename) {
|
||||
include $filename;
|
||||
try{
|
||||
include $filename;
|
||||
} catch(Throwable $e){
|
||||
//ignore plugin error
|
||||
}catch(Exception $e){
|
||||
//ignore plugin error
|
||||
}
|
||||
}
|
||||
|
||||
$result = ORM::for_table('tbl_appconfig')->find_many();
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "2024.1.11"
|
||||
"version": "2024.1.15"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user