check error Database
This commit is contained in:
parent
e64527cee2
commit
a85ccf06fa
@ -10,6 +10,7 @@
|
|||||||
- Fix Customer counter in dashboard
|
- Fix Customer counter in dashboard
|
||||||
- Show Customer Balance in header
|
- Show Customer Balance in header
|
||||||
- Fix Plugin Manager using Http::Get
|
- Fix Plugin Manager using Http::Get
|
||||||
|
- Show Some error page when crash
|
||||||
## 2023.9.7
|
## 2023.9.7
|
||||||
|
|
||||||
- Fix PPPOE Delete Customer
|
- Fix PPPOE Delete Customer
|
||||||
|
@ -73,39 +73,52 @@ function _get($param, $defvalue = '')
|
|||||||
return safedata($_GET[$param]);
|
return safedata($_GET[$param]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
|
||||||
require_once File::pathFixer('system/orm.php');
|
require_once File::pathFixer('system/orm.php');
|
||||||
|
|
||||||
ORM::configure("mysql:host=$db_host;dbname=$db_name");
|
ORM::configure("mysql:host=$db_host;dbname=$db_name");
|
||||||
ORM::configure('username', $db_user);
|
ORM::configure('username', $db_user);
|
||||||
ORM::configure('password', $db_password);
|
ORM::configure('password', $db_password);
|
||||||
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
|
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
|
||||||
ORM::configure('return_result_sets', true);
|
ORM::configure('return_result_sets', true);
|
||||||
if ($_app_stage != 'Live') {
|
if ($_app_stage != 'Live') {
|
||||||
ORM::configure('logging', true);
|
ORM::configure('logging', true);
|
||||||
}
|
|
||||||
|
|
||||||
$result = ORM::for_table('tbl_appconfig')->find_many();
|
|
||||||
foreach ($result as $value) {
|
|
||||||
$config[$value['setting']] = $value['value'];
|
|
||||||
}
|
|
||||||
|
|
||||||
date_default_timezone_set($config['timezone']);
|
|
||||||
$_c = $config;
|
|
||||||
|
|
||||||
// check if proxy setup in database
|
|
||||||
if(empty($http_proxy) && !empty($config['http_proxy'])){
|
|
||||||
$http_proxy = $config['http_proxy'];
|
|
||||||
if(empty($http_proxyauth) && !empty($config['http_proxyauth'])){
|
|
||||||
$http_proxyauth = $config['http_proxyauth'];
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ($config['radius_mode']) {
|
$result = ORM::for_table('tbl_appconfig')->find_many();
|
||||||
ORM::configure("mysql:host=$radius_host;dbname=$radius_name", null, 'radius');
|
foreach ($result as $value) {
|
||||||
ORM::configure('username', $radius_user, 'radius');
|
$config[$value['setting']] = $value['value'];
|
||||||
ORM::configure('password', $radius_password, 'radius');
|
}
|
||||||
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'), 'radius');
|
|
||||||
ORM::configure('return_result_sets', true, 'radius');
|
date_default_timezone_set($config['timezone']);
|
||||||
|
$_c = $config;
|
||||||
|
|
||||||
|
// check if proxy setup in database
|
||||||
|
if (empty($http_proxy) && !empty($config['http_proxy'])) {
|
||||||
|
$http_proxy = $config['http_proxy'];
|
||||||
|
if (empty($http_proxyauth) && !empty($config['http_proxyauth'])) {
|
||||||
|
$http_proxyauth = $config['http_proxyauth'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($config['radius_mode']) {
|
||||||
|
ORM::configure("mysql:host=$radius_host;dbname=$radius_name", null, 'radius');
|
||||||
|
ORM::configure('username', $radius_user, 'radius');
|
||||||
|
ORM::configure('password', $radius_password, 'radius');
|
||||||
|
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'), 'radius');
|
||||||
|
ORM::configure('return_result_sets', true, 'radius');
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$ui = new Smarty();
|
||||||
|
$ui->setTemplateDir(['custom' => File::pathFixer('ui/ui_custom/'), 'default' => File::pathFixer('ui/ui/')]);
|
||||||
|
$ui->assign('_url', APP_URL . '/index.php?_route=');
|
||||||
|
$ui->setCompileDir(File::pathFixer('ui/compiled/'));
|
||||||
|
$ui->setConfigDir(File::pathFixer('ui/conf/'));
|
||||||
|
$ui->setCacheDir(File::pathFixer('ui/cache/'));
|
||||||
|
$ui->assign("error_title", "PHPNuxBill Crash");
|
||||||
|
$ui->assign("error_message", $e->getMessage());
|
||||||
|
$ui->display('router-error.tpl');
|
||||||
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
function _notify($msg, $type = 'e')
|
function _notify($msg, $type = 'e')
|
||||||
@ -323,10 +336,9 @@ try {
|
|||||||
} else {
|
} else {
|
||||||
r2(U . 'dashboard', 'e', 'not found');
|
r2(U . 'dashboard', 'e', 'not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$ui->assign("error_title", "PHPNuxBill Crash");
|
$ui->assign("error_title", "PHPNuxBill Crash");
|
||||||
$ui->assign("error_message", $e->getMessage());
|
$ui->assign("error_message", $e->getMessage());
|
||||||
$ui->display('router-error.tpl');
|
$ui->display('router-error.tpl');
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user