N°2847 Add message on alpha/development fatal error pages 🤫

This commit is contained in:
Stephen Abello
2020-11-19 13:39:04 +01:00
parent 05c53d35b7
commit aef77d8f93
4 changed files with 44 additions and 0 deletions

View File

@@ -2430,4 +2430,11 @@ class utils
$e = new CoreException($sMessage, null, '', $oException);
throw $e;
}
/**
* @since 3.0.0
*/
public static function IsEasterEggAllowed(){
return (stripos(ITOP_VERSION, 'alpha') !== false) || utils::IsDevelopmentEnvironment();
}
}

8
css/errorpage.scss Normal file
View File

@@ -0,0 +1,8 @@
body{
align-items: center;
}
#ibo-page-container{
flex-grow: 0;
height: auto;
border: 3px solid #CBD2D9;
}

View File

@@ -0,0 +1,23 @@
<?php
/**
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*/
// Navigation menu
Dict::Add('EN US', 'English', 'English', array(
'UI:ErrorPage:UnstableVersion' => 'You are using an alpha version that may be unstable or include bugs and unfinished features. If you think this error occurred because of this please send us your feedback!',
));

View File

@@ -13,6 +13,7 @@ class ErrorPage extends NiceWebPage
$this->add_linked_script("../js/jquery.blockUI.js");
$this->add_linked_script("../setup/setup.js");
$this->add_saas("css/setup.scss");
$this->add_saas("css/errorpage.scss");
}
public function info($sText)
@@ -36,6 +37,11 @@ class ErrorPage extends NiceWebPage
public function error($sText)
{
$this->add("<div class=\"message message-error\">$sText</div>");
if(utils::IsEasterEggAllowed())
{
$this->add('<img src="../images/alpha-fatal-error.gif">');
$this->add('<div class="message message-valid">'.Dict::S('UI:ErrorPage:UnstableVersion').'</div>');
}
$this->log_error($sText);
}