Page MenuHomeIn-Portal Phabricator

D3.id27.diff
No OneTemporary

File Metadata

Created
Sat, Feb 1, 8:40 PM

D3.id27.diff

Index: core/admin_templates/error_fatal.tpl
===================================================================
--- core/admin_templates/error_fatal.tpl
+++ core/admin_templates/error_fatal.tpl
@@ -0,0 +1,55 @@
+<inp2:m_Set skip_last_template="1"/>
+<inp2:m_include t="incs/header"/>
+
+<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:root" title_preset="no_permissions" parent="0"/>
+
+<!-- ToolBar -->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+ <tbody>
+ <tr>
+ <td id="toolbar_cell">
+ <script type="text/javascript">
+ function prepareToolbar() {
+ a_toolbar = new ToolBar();
+
+ a_toolbar.AddButton(
+ new ToolBarButton(
+ 'prev',
+ '<inp2:m_phrase label="la_ToolTip_Back" escape="1"/>',
+ function() {
+ history.back();
+ }
+ )
+ );
+
+ a_toolbar.Render( $('#toolbar_cell').get(0) );
+ }
+
+ $(document).ready(
+ function() {
+ prepareToolbar();
+ Application.removeDebuggerStatistics();
+ maximizeElement('#fatal_error');
+
+ $('#fatal_error_container').css('background-color', '#F6F6F6');
+ }
+ );
+ </script>
+
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+<div id="fatal_error" class="table-color1" style="bottom: 50%; text-align: center; vertical-align: middle;">
+ <br />
+ <strong>Opps, something went wrong ...</strong>
+ <inp2:m_if check="m_Recall" name="FatalErrorMessage">
+ <br /><br />
+ <div style="text-align: left;">
+ <inp2:m_Recall name="FatalErrorMessage"/><inp2:m_RemoveVar name="FatalErrorMessage"/><br />
+ </div>
+ </inp2:m_if>
+</div>
+
+<inp2:m_include t="incs/footer"/>
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,14 @@
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 (VariableId, VariableName, VariableValue, ModuleOwner, Section, Heading, Prompt, ElementType, Validation, ValueList, DisplayOrder, GroupDisplayOrder, Install, HintLabel)
+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 ( !$this->Application->isDebugMode() && !$this->Application->isAdmin ) {
+ $this->Application->StoreVar('FatalErrorMessage', $message);
+ $this->Application->Redirect($this->Application->ConfigValue('FatalErrorTemplate'));
+ }
+ else {
- $margin = $this->Application->isAdmin ? '8px' : 'auto';
+ $margin = $this->Application->isAdmin ? '8px' : 'auto';
- echo '<div style="background-color: #FEFFBF; margin: ' . $margin . '; padding: 10px; border: 2px solid red; text-align: center">' . $this->_logger->toString($errno) . '</div>';
+ echo '<div style="background-color: #FEFFBF; margin: ' . $margin . '; padding: 10px; border: 2px solid red; text-align: center">' . $message . '</div>';
- exit;
+ exit;
+ }
}
/**
@@ -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 @@
+<!--##
+<NAME>Server Error</NAME>
+<DESC></DESC>
+<SECTION>Platform</SECTION>
+##-->
+
+<!--## SET 500 HEADER FOR RESPONSE ##-->
+<inp2:m_header data="HTTP/1.0 500 Internal Server Error"/>
+<!--## //SET 500 HEADER FOR RESPONSE ##-->
+
+<!--## PAGE TITLE ELEMENT ##-->
+<inp2:m_DefineElement name="page_title">
+ Server Error
+</inp2:m_DefineElement>
+<!--## //PAGE TITLE ELEMENT ##-->
+
+<!--## MAIN CONTENT ##-->
+<inp2:m_DefineElement name="content">
+ Opps, something went wrong ... <a href="javascript:history.back()">Back</a>
+</inp2:m_DefineElement>
+<!--## /MAIN CONTENT ##-->
+
+<!--## DESIGN TEMPLATE ##-->
+<inp2:m_include template="platform/designs/default_design.des" pass_params="1"/>
+<!--## /DESIGN TEMPLATE ##-->

Event Timeline