forked from kevinowino869/mitrobill
Show some error page when crash
This commit is contained in:
parent
fc5aa083a1
commit
e64527cee2
@ -17,7 +17,8 @@ class Mikrotik
|
|||||||
$iport = explode(":", $ip);
|
$iport = explode(":", $ip);
|
||||||
return new RouterOS\Client($iport[0], $user, $pass, ($iport[1]) ? $iport[1] : null);
|
return new RouterOS\Client($iport[0], $user, $pass, ($iport[1]) ? $iport[1] : null);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$ui->assign("error_meesage", "Unable to connect to the router.<br>" . $e->getMessage());
|
$ui->assign("error_title", "Mikrotik Connection Error");
|
||||||
|
$ui->assign("error_message", "Unable to connect to the router.<br>" . $e->getMessage());
|
||||||
$ui->display('router-error.tpl');
|
$ui->display('router-error.tpl');
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
@ -290,34 +290,43 @@ $handler = $routes[0];
|
|||||||
if ($handler == '') {
|
if ($handler == '') {
|
||||||
$handler = 'default';
|
$handler = 'default';
|
||||||
}
|
}
|
||||||
$sys_render = File::pathFixer('system/controllers/' . $handler . '.php');
|
try {
|
||||||
if (file_exists($sys_render)) {
|
|
||||||
$menus = array();
|
$sys_render = File::pathFixer('system/controllers/' . $handler . '.php');
|
||||||
// "name" => $name,
|
if (file_exists($sys_render)) {
|
||||||
// "admin" => $admin,
|
$menus = array();
|
||||||
// "position" => $position,
|
// "name" => $name,
|
||||||
// "function" => $function
|
// "admin" => $admin,
|
||||||
$ui->assign('_system_menu', $routes[0]);
|
// "position" => $position,
|
||||||
foreach ($menu_registered as $menu) {
|
// "function" => $function
|
||||||
if ($menu['admin'] && _admin(false)) {
|
$ui->assign('_system_menu', $routes[0]);
|
||||||
$menus[$menu['position']] .= '<li' . (($routes[1] == $menu['function']) ? ' class="active"' : '') . '><a href="' . U . 'plugin/' . $menu['function'] . '">';
|
foreach ($menu_registered as $menu) {
|
||||||
if (!empty($menu['icon'])) {
|
if ($menu['admin'] && _admin(false)) {
|
||||||
$menus[$menu['position']] .= '<i class="' . $menu['icon'] . '"></i>';
|
$menus[$menu['position']] .= '<li' . (($routes[1] == $menu['function']) ? ' class="active"' : '') . '><a href="' . U . 'plugin/' . $menu['function'] . '">';
|
||||||
|
if (!empty($menu['icon'])) {
|
||||||
|
$menus[$menu['position']] .= '<i class="' . $menu['icon'] . '"></i>';
|
||||||
|
}
|
||||||
|
$menus[$menu['position']] .= '<span class="text">' . $menu['name'] . '</span></a></li>';
|
||||||
|
} else if (!$menu['admin'] && _auth(false)) {
|
||||||
|
$menus[$menu['position']] .= '<li' . (($routes[1] == $menu['function']) ? ' class="active"' : '') . '><a href="' . U . 'plugin/' . $menu['function'] . '">';
|
||||||
|
if (!empty($menu['icon'])) {
|
||||||
|
$menus[$menu['position']] .= '<i class="' . $menu['icon'] . '"></i>';
|
||||||
|
}
|
||||||
|
$menus[$menu['position']] .= '<span class="text">' . $menu['name'] . '</span></a></li>';
|
||||||
}
|
}
|
||||||
$menus[$menu['position']] .= '<span class="text">' . $menu['name'] . '</span></a></li>';
|
|
||||||
} else if (!$menu['admin'] && _auth(false)) {
|
|
||||||
$menus[$menu['position']] .= '<li' . (($routes[1] == $menu['function']) ? ' class="active"' : '') . '><a href="' . U . 'plugin/' . $menu['function'] . '">';
|
|
||||||
if (!empty($menu['icon'])) {
|
|
||||||
$menus[$menu['position']] .= '<i class="' . $menu['icon'] . '"></i>';
|
|
||||||
}
|
|
||||||
$menus[$menu['position']] .= '<span class="text">' . $menu['name'] . '</span></a></li>';
|
|
||||||
}
|
}
|
||||||
|
foreach ($menus as $k => $v) {
|
||||||
|
$ui->assign('_MENU_' . $k, $v);
|
||||||
|
}
|
||||||
|
unset($menus, $menu_registered);
|
||||||
|
include($sys_render);
|
||||||
|
} else {
|
||||||
|
r2(U . 'dashboard', 'e', 'not found');
|
||||||
}
|
}
|
||||||
foreach ($menus as $k => $v) {
|
|
||||||
$ui->assign('_MENU_' . $k, $v);
|
} catch (Exception $e) {
|
||||||
}
|
$ui->assign("error_title", "PHPNuxBill Crash");
|
||||||
unset($menus, $menu_registered);
|
$ui->assign("error_message", $e->getMessage());
|
||||||
include($sys_render);
|
$ui->display('router-error.tpl');
|
||||||
} else {
|
die();
|
||||||
r2(U . 'dashboard', 'e', 'not found');
|
}
|
||||||
}
|
|
@ -130,7 +130,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6" id="update">
|
||||||
<div class="box box-primary box-hovered mb20 activities">
|
<div class="box box-primary box-hovered mb20 activities">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">PHPNUXBILL</h3>
|
<h3 class="box-title">PHPNUXBILL</h3>
|
||||||
|
BIN
ui/ui/images/error.png
Normal file
BIN
ui/ui/images/error.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 342 KiB |
@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
<title>Router Error - PHPNuxBill</title>
|
<title>Error - PHPNuxBill</title>
|
||||||
<link rel="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" />
|
<link rel="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" />
|
||||||
|
|
||||||
<link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css">
|
<link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css">
|
||||||
@ -32,27 +32,45 @@
|
|||||||
|
|
||||||
<body class="hold-transition skin-blue">
|
<body class="hold-transition skin-blue">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<section class="content-header">
|
|
||||||
<h1 class="text-center">
|
|
||||||
Router Error
|
|
||||||
</h1>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3"></div>
|
<div class="col-md-3">
|
||||||
|
<img src="./ui/ui/images/error.png" class="img-responsive hidden-sm hidden-xs">
|
||||||
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="alert alert-danger text-center">
|
<div class="box box-danger box-solid text-center">
|
||||||
{$error_meesage}
|
|
||||||
|
<section class="content-header">
|
||||||
|
<h1 class="text-center">
|
||||||
|
{$error_title}
|
||||||
|
</h1>
|
||||||
|
</section>
|
||||||
|
<div class="box-title" style="font-size:xx-large; color:red">
|
||||||
|
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
|
||||||
|
</div>
|
||||||
|
<div class="box-body" style="font-size: larger;">
|
||||||
|
<br><br>
|
||||||
|
{$error_message}
|
||||||
|
<br><br><br>
|
||||||
|
</div>
|
||||||
|
<div class="box-footer">
|
||||||
|
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||||
|
<a href="./update.php?step=4" class="btn btn-info btn-sm btn-block">Update Database</a>
|
||||||
|
<a href="{$_url}community#update" class="btn btn-primary btn-sm btn-block">Update
|
||||||
|
PHPNuxBill</a>
|
||||||
|
</div>
|
||||||
|
<br><br>
|
||||||
|
<a href="javascript::history.back()" onclick="history.back()"
|
||||||
|
class="btn btn-warning btn-block">back</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a href="javascript::history.back()" onclick="history.back()" class="btn btn-warning btn-block">back</a>
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<img src="./ui/ui/images/error.png" class="img-responsive hidden-md hidden-lg">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<footer class="footer text-center">
|
|
||||||
PHPNuxBill by <a href="https://github.com/hotspotbilling/phpnuxbill" rel="nofollow noreferrer noopener"
|
|
||||||
target="_blank">iBNuX</a>
|
|
||||||
</footer>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user