diff --git a/system/autoload/Mikrotik.php b/system/autoload/Mikrotik.php index 8d4f1802..b6707dc2 100644 --- a/system/autoload/Mikrotik.php +++ b/system/autoload/Mikrotik.php @@ -17,7 +17,8 @@ class Mikrotik $iport = explode(":", $ip); return new RouterOS\Client($iport[0], $user, $pass, ($iport[1]) ? $iport[1] : null); } catch (Exception $e) { - $ui->assign("error_meesage", "Unable to connect to the router.
" . $e->getMessage()); + $ui->assign("error_title", "Mikrotik Connection Error"); + $ui->assign("error_message", "Unable to connect to the router.
" . $e->getMessage()); $ui->display('router-error.tpl'); die(); } diff --git a/system/boot.php b/system/boot.php index bbd55f21..799324bb 100644 --- a/system/boot.php +++ b/system/boot.php @@ -290,34 +290,43 @@ $handler = $routes[0]; if ($handler == '') { $handler = 'default'; } -$sys_render = File::pathFixer('system/controllers/' . $handler . '.php'); -if (file_exists($sys_render)) { - $menus = array(); - // "name" => $name, - // "admin" => $admin, - // "position" => $position, - // "function" => $function - $ui->assign('_system_menu', $routes[0]); - foreach ($menu_registered as $menu) { - if ($menu['admin'] && _admin(false)) { - $menus[$menu['position']] .= ''; - if (!empty($menu['icon'])) { - $menus[$menu['position']] .= ''; +try { + + $sys_render = File::pathFixer('system/controllers/' . $handler . '.php'); + if (file_exists($sys_render)) { + $menus = array(); + // "name" => $name, + // "admin" => $admin, + // "position" => $position, + // "function" => $function + $ui->assign('_system_menu', $routes[0]); + foreach ($menu_registered as $menu) { + if ($menu['admin'] && _admin(false)) { + $menus[$menu['position']] .= ''; + if (!empty($menu['icon'])) { + $menus[$menu['position']] .= ''; + } + $menus[$menu['position']] .= '' . $menu['name'] . ''; + } else if (!$menu['admin'] && _auth(false)) { + $menus[$menu['position']] .= ''; + if (!empty($menu['icon'])) { + $menus[$menu['position']] .= ''; + } + $menus[$menu['position']] .= '' . $menu['name'] . ''; } - $menus[$menu['position']] .= '' . $menu['name'] . ''; - } else if (!$menu['admin'] && _auth(false)) { - $menus[$menu['position']] .= ''; - if (!empty($menu['icon'])) { - $menus[$menu['position']] .= ''; - } - $menus[$menu['position']] .= '' . $menu['name'] . ''; } + 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); - } - unset($menus, $menu_registered); - include($sys_render); -} else { - r2(U . 'dashboard', 'e', 'not found'); -} + +} catch (Exception $e) { + $ui->assign("error_title", "PHPNuxBill Crash"); + $ui->assign("error_message", $e->getMessage()); + $ui->display('router-error.tpl'); + die(); +} \ No newline at end of file diff --git a/ui/ui/community.tpl b/ui/ui/community.tpl index e685e913..c23242c6 100644 --- a/ui/ui/community.tpl +++ b/ui/ui/community.tpl @@ -130,7 +130,7 @@ -
+

PHPNUXBILL

diff --git a/ui/ui/images/error.png b/ui/ui/images/error.png new file mode 100644 index 00000000..a21c2c52 Binary files /dev/null and b/ui/ui/images/error.png differ diff --git a/ui/ui/router-error.tpl b/ui/ui/router-error.tpl index fad1e26d..59293434 100644 --- a/ui/ui/router-error.tpl +++ b/ui/ui/router-error.tpl @@ -4,7 +4,7 @@ - Router Error - PHPNuxBill + Error - PHPNuxBill @@ -32,27 +32,45 @@
-
-

- Router Error -

-
-
+
+ +
-
- {$error_meesage} +
+ +
+

+ {$error_title} +

+
+
+ +
+
+

+ {$error_message} +


+
+
- back +
+
+
-