Index: core/admin_templates/error_fatal.tpl =================================================================== --- core/admin_templates/error_fatal.tpl +++ core/admin_templates/error_fatal.tpl @@ -0,0 +1,55 @@ + + + + + + + + + + + + +
+ + +
+ +
+
+ Opps, something went wrong ... + +

+
+
+
+
+
+ + Index: core/install/install_data.sql =================================================================== --- core/install/install_data.sql +++ core/install/install_data.sql @@ -37,14 +37,15 @@ INSERT INTO SystemSettings VALUES(DEFAULT, 'ForceModRewriteUrlEnding', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceModRewriteUrlEnding', 'checkbox', '', NULL, 10.012, 0, 0, 'hint:la_config_ForceModRewriteUrlEnding'); INSERT INTO SystemSettings VALUES(DEFAULT, 'UseContentLanguageNegotiation', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_UseContentLanguageNegotiation', 'checkbox', '', '', 10.013, 0, 0, NULL); INSERT INTO SystemSettings VALUES(DEFAULT, 'cms_DefaultDesign', '#default_design#', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_DefaultDesignTemplate', 'text', NULL, NULL, 10.02, 0, 0, NULL); -INSERT INTO SystemSettings VALUES(DEFAULT, 'ErrorTemplate', 'error_notfound', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_error_template', 'text', '', '', 10.03, 0, 0, NULL); +INSERT INTO SystemSettings VALUES(DEFAULT, 'NotFoundErrorTemplate', 'error_notfound', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_error_template', 'text', '', '', 10.03, 0, 0, NULL); INSERT INTO SystemSettings VALUES(DEFAULT, 'NoPermissionTemplate', 'no_permission', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_nopermission_template', 'text', '', '', 10.04, 0, 0, NULL); -INSERT INTO SystemSettings VALUES(DEFAULT, 'UsePageHitCounter', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_UsePageHitCounter', 'checkbox', '', '', 10.05, 0, 0, NULL); -INSERT INTO SystemSettings VALUES(DEFAULT, 'ForceImageMagickResize', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceImageMagickResize', 'checkbox', '', '', 10.06, 0, 0, NULL); -INSERT INTO SystemSettings VALUES(DEFAULT, 'CheckStopWords', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_CheckStopWords', 'checkbox', '', '', 10.07, 0, 0, NULL); -INSERT INTO SystemSettings VALUES(DEFAULT, 'UseVisitorTracking', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_UseVisitorTracking', 'checkbox', '', '', 10.08, 0, 0, NULL); -INSERT INTO SystemSettings VALUES(DEFAULT, 'cms_DefaultTrackingCode', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_DefaultTrackingCode', 'textarea', NULL, 'COLS=40 ROWS=5', 10.09, 0, 0, NULL); -INSERT INTO SystemSettings VALUES(DEFAULT, 'PerformExactSearch', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_PerformExactSearch', 'checkbox', '', '', '10.10', 0, 0, 'hint:la_config_PerformExactSearch'); +INSERT INTO SystemSettings VALUES(DEFAULT, 'FatalErrorTemplate', 'error_fatal', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_FatalErrorTemplate', 'text', '', '', 10.05, 0, 0, null); +INSERT INTO SystemSettings VALUES(DEFAULT, 'UsePageHitCounter', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_UsePageHitCounter', 'checkbox', '', '', 10.06, 0, 0, NULL); +INSERT INTO SystemSettings VALUES(DEFAULT, 'ForceImageMagickResize', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceImageMagickResize', 'checkbox', '', '', 10.07, 0, 0, NULL); +INSERT INTO SystemSettings VALUES(DEFAULT, 'CheckStopWords', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_CheckStopWords', 'checkbox', '', '', 10.08, 0, 0, NULL); +INSERT INTO SystemSettings VALUES(DEFAULT, 'UseVisitorTracking', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_UseVisitorTracking', 'checkbox', '', '', 10.09, 0, 0, NULL); +INSERT INTO SystemSettings VALUES(DEFAULT, 'cms_DefaultTrackingCode', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_DefaultTrackingCode', 'textarea', NULL, 'COLS=40 ROWS=5', '10.10', 0, 0, NULL); +INSERT INTO SystemSettings VALUES(DEFAULT, 'PerformExactSearch', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_PerformExactSearch', 'checkbox', '', '', 10.11, 0, 0, 'hint:la_config_PerformExactSearch'); INSERT INTO SystemSettings VALUES(DEFAULT, 'MaintenanceMessageFront', 'Website is currently undergoing the upgrades. Please come back shortly!', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_MaintenanceMessageFront', 'textarea', '', 'style="width: 100%; height: 100px;"', '15.01', 0, 0, 'hint:la_config_MaintenanceMessageFront'); INSERT INTO SystemSettings VALUES(DEFAULT, 'MaintenanceMessageAdmin', 'Website is currently undergoing the upgrades. Please come back shortly!', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_MaintenanceMessageAdmin', 'textarea', '', 'style="width: 100%; height: 100px;"', '15.02', 0, 0, 'hint:la_config_MaintenanceMessageAdmin'); INSERT INTO SystemSettings VALUES(DEFAULT, 'SoftMaintenanceTemplate', 'maintenance', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_SoftMaintenanceTemplate', 'text', '', 'style="width: 200px;"', '15.03', 0, 0, 'hint:la_config_SoftMaintenanceTemplate'); @@ -1040,4 +1041,4 @@ INSERT INTO PromoBlockGroups VALUES (DEFAULT, 'Default Group', UNIX_TIMESTAMP(), '1', '7.00', '0.60', '1', 'fade', ''); INSERT INTO Modules VALUES ('Core', 'core/', 'Intechnic\\InPortal\\Core', 'adm', DEFAULT, 1, 1, '', 0, NULL); -INSERT INTO Modules VALUES ('In-Portal', 'core/', 'Intechnic\\InPortal\\Core', 'm', DEFAULT, 1, 0, '', 0, NULL); \ No newline at end of file +INSERT INTO Modules VALUES ('In-Portal', 'core/', 'Intechnic\\InPortal\\Core', 'm', DEFAULT, 1, 0, '', 0, NULL); Index: core/install/upgrades.sql =================================================================== --- core/install/upgrades.sql +++ core/install/upgrades.sql @@ -3004,3 +3004,13 @@ CHANGE SSLUrl SSLDomainName VARCHAR(255) NOT NULL DEFAULT '', CHANGE SSLUrlUsesRegExp SSLDomainNameUsesRegExp TINYINT(4) NOT NULL DEFAULT '0'; DELETE FROM UserPersistentSessionData WHERE VariableName = 'site-domain[Default]columns_.'; + +UPDATE SystemSettings +SET VariableName = 'NotFoundErrorTemplate' +WHERE VariableName = 'ErrorTemplate'; + +UPDATE SystemSettings +SET DisplayOrder = ROUND(DisplayOrder + 0.01, 2) +WHERE Section = 'in-portal:configure_advanced' and Heading = 'la_section_SettingsWebsite' AND DisplayOrder > 10.04; + +INSERT INTO SystemSettings VALUES (DEFAULT, 'FatalErrorTemplate', 'error_fatal', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_FatalErrorTemplate', 'text', '', '', 10.05, 0, 0, null); Index: core/kernel/managers/url_manager.php =================================================================== --- core/kernel/managers/url_manager.php +++ core/kernel/managers/url_manager.php @@ -492,7 +492,7 @@ $theme_id = $this->Application->GetVar('m_theme'); } - $not_found = $this->Application->ConfigValue('ErrorTemplate'); + $not_found = $this->Application->ConfigValue('NotFoundErrorTemplate'); $vars['t'] = $not_found ? $not_found : 'error_notfound'; $themes_helper = $this->Application->recallObject('ThemesHelper'); @@ -524,4 +524,4 @@ $this->Application->Done(); exit; } -} \ No newline at end of file +} Index: core/kernel/utility/logger.php =================================================================== --- core/kernel/utility/logger.php +++ core/kernel/utility/logger.php @@ -1150,10 +1150,17 @@ protected function _displayFatalError($errno) { $errno = $this->_getFatalErrorTitle($errno); + $message = $this->_logger->toString($errno); + if ( PHP_SAPI == 'cli' || !$this->Application || $this->Application->isDebugMode() || $this->Application->isAdmin ) { - $margin = $this->Application->isAdmin ? '8px' : 'auto'; + $margin = $this->Application->isAdmin ? '8px' : 'auto'; - echo '
' . $this->_logger->toString($errno) . '
'; + echo '
' . $message . '
'; - exit; + exit; + } + else { + $this->Application->StoreVar('FatalErrorMessage', $message); + $this->Application->Redirect($this->Application->ConfigValue('FatalErrorTemplate')); + } } /** @@ -1364,4 +1371,4 @@ return $res; } -} \ No newline at end of file +} Index: core/units/categories/categories_event_handler.php =================================================================== --- core/units/categories/categories_event_handler.php +++ core/units/categories/categories_event_handler.php @@ -1781,7 +1781,7 @@ } } else { - $not_found = $this->Application->ConfigValue('ErrorTemplate'); + $not_found = $this->Application->ConfigValue('NotFoundErrorTemplate'); $real_t = $not_found ? $not_found : 'error_notfound'; $themes_helper = $this->Application->recallObject('ThemesHelper'); @@ -3153,4 +3153,4 @@ $object->SetDBField('ResourceId', 0); // this will reset it } - } \ No newline at end of file + } Index: themes/advanced/error_fatal.tpl =================================================================== --- themes/advanced/error_fatal.tpl +++ themes/advanced/error_fatal.tpl @@ -0,0 +1,25 @@ + + + + + + + + + Server Error + + + + + + Opps, something went wrong ... Back + + + + + +