From b0b49b3763c945334c9aa85f29f75e1b77794554 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Sun, 16 Jun 2024 16:19:55 +0700 Subject: [PATCH] fix error make loop --- system/boot.php | 36 ++---------------------------------- system/controllers/login.php | 8 ++++---- 2 files changed, 6 insertions(+), 38 deletions(-) diff --git a/system/boot.php b/system/boot.php index 3359d90f..01ffe8b4 100644 --- a/system/boot.php +++ b/system/boot.php @@ -8,41 +8,9 @@ try { require_once 'init.php'; } catch (Throwable $e) { - $ui = new Smarty(); - $ui->setTemplateDir([ - 'custom' => File::pathFixer($UI_PATH . '/ui_custom/'), - 'default' => File::pathFixer($UI_PATH . '/ui/') - ]); - $ui->assign('_url', APP_URL . '/index.php?_route='); - $ui->setCompileDir(File::pathFixer($UI_PATH . '/compiled/')); - $ui->setConfigDir(File::pathFixer($UI_PATH . '/conf/')); - $ui->setCacheDir(File::pathFixer($UI_PATH . '/cache/')); - $ui->assign("error_title", "PHPNuxBill Crash"); - if (_auth()) { - $ui->assign("error_message", $e->getMessage() . '
'); - } else { - $ui->assign("error_message", $e->getMessage() . '
' . $e->getTraceAsString() . '
'); - } - $ui->display('router-error.tpl'); - die(); + die($e->getMessage() . '
' . $e->getTraceAsString() . '
'); } catch (Exception $e) { - $ui = new Smarty(); - $ui->setTemplateDir([ - 'custom' => File::pathFixer($UI_PATH . '/ui_custom/'), - 'default' => File::pathFixer($UI_PATH . '/ui/') - ]); - $ui->assign('_url', APP_URL . '/index.php?_route='); - $ui->setCompileDir(File::pathFixer($UI_PATH . '/compiled/')); - $ui->setConfigDir(File::pathFixer($UI_PATH . '/conf/')); - $ui->setCacheDir(File::pathFixer($UI_PATH . '/cache/')); - $ui->assign("error_title", "PHPNuxBill Crash"); - if (_auth()) { - $ui->assign("error_message", $e->getMessage() . '
'); - } else { - $ui->assign("error_message", $e->getMessage() . '
' . $e->getTraceAsString() . '
'); - } - $ui->display('router-error.tpl'); - die(); + die($e->getMessage() . '
' . $e->getTraceAsString() . '
'); } function _notify($msg, $type = 'e') diff --git a/system/controllers/login.php b/system/controllers/login.php index f86f752d..9bf565ba 100644 --- a/system/controllers/login.php +++ b/system/controllers/login.php @@ -5,10 +5,10 @@ * by https://t.me/ibnux **/ - $maintenance_mode = $config['maintenance_mode']; - if ($maintenance_mode == true){ - displayMaintenanceMessage(); - } +$maintenance_mode = $config['maintenance_mode']; +if ($maintenance_mode == true) { + displayMaintenanceMessage(); +} if (User::getID()) { r2(U . 'home');