Skip to content

Commit

Permalink
Merge pull request #1167 from boxbilling/revert-1055-evrifaessa-patch-1
Browse files Browse the repository at this point in the history
Revert "Adding phpinfo to the System module"
  • Loading branch information
timothygwebb committed Dec 14, 2021
2 parents ea040ce + b305527 commit 79dbadd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 103 deletions.
19 changes: 0 additions & 19 deletions src/bb-library/Box/TwigExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ public function getFilters()
'money_without_currency' => new Twig\TwigFilter('money_without_currency','twig_money_without_currency', array('needs_environment' => true, 'is_safe' => array('html'))),
'money_convert' => new Twig\TwigFilter('money_convert', 'twig_money_convert', array('needs_environment' => true, 'is_safe' => array('html'))),
'money_convert_without_currency' => new Twig\TwigFilter('money_convert_without_currency', array('needs_environment' => true, 'is_safe' => array('html'))),

'phpinfo' => new Twig\TwigFilter('phpinfo','twig_phpinfo'),
);
}

Expand Down Expand Up @@ -294,20 +292,3 @@ function twig_bbmd_filter(Twig\Environment $env, $value)
$value = twig_markdown_filter($env, $value);
return $value;
}

/**
* Returns phpinfo() without it's stylings;
* Solution from https://www.php.net/manual/en/function.phpinfo.php#87287
*/
function twig_phpinfo()
{
ob_start();
phpinfo();
$pinfo = ob_get_contents();
ob_end_clean();

// the name attribute "module_Zend Optimizer" of an anker-tag is not xhtml valide, so replace it with "module_Zend_Optimizer"
$pinfo = (str_replace("module_Zend Optimizer", "module_Zend_Optimizer", preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $pinfo)));

return $pinfo;
}
89 changes: 5 additions & 84 deletions src/bb-modules/System/html_admin/mod_system_settings.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,79 +11,6 @@
</ul>
{% endblock %}

{% block head %}
<!-- Style inherited from https://gist.github.com/350d/9703098 -->
<style type="text/css">
#box-phpinfo {
background: #fff;
margin:0;
padding:0;
color: #233452;
height: 100%;
margin: 20px 0;
display: flex; align-items: center; justify-content: center;
}

#box-phpinfo table {
width: 1300px;
border: 1px solid #ccc;
background: #fff;
padding: 1px;
}

#box-phpinfo td, th {
border: 1px solid #FFF;
font-size: 12px;
padding: 4px 8px;
}

#box-phpinfo h1 {
font-family: "Cuprum", sans-serif;
font-size: 24px;
margin: 10px;
}

#box-phpinfo h2 {
font-family: "Cuprum", sans-serif;
font-size: 22px;
color: #0B5FB4;
text-align: left;
margin: 25px auto 5px auto;
width: 1300px;
}

#box-phpinfo hr {
background-color: #A9A9A9;
color: #A9A9A9;
}

#box-phpinfo .e, .v, .vr {
color: #333;
font-size: 11px;
}
#box-phpinfo .e {
background-color: #eee;
}
#box-phpinfo .h {
background-color: #0B5FB4;
color: #fff;
}
#box-phpinfo .v {
background-color: #F1F1F1;
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
#box-phpinfo .iclogos {
display:none;
}
</style>
{{ mf.bb_editor('.bb-textarea') }}
{% endblock %}

{% block content %}

{% set new_params = admin.extension_config_get({"ext":"mod_system"}) %}
Expand All @@ -96,7 +23,6 @@
<li><a href="#tab-ftp">{% trans 'FTP layer' %}</a></li>
<li><a href="#tab-countries">{% trans 'Countries' %}</a></li>
<li><a href="#tab-cache">{% trans 'Cache' %}</a></li>
<li><a href="#tab-phpinfo">{% trans 'PHP Info' %}</a></li>
</ul>

<div class="tabs_container">
Expand Down Expand Up @@ -540,25 +466,20 @@ ZW=Zimbabwe
<h3>{% trans 'Cache control' %}</h3>
</div>
<form method="post" action="{{ 'api/admin/system/clear_cache'|link }}" class="mainForm api-form" data-api-msg="{% trans 'Cache folder cleared' %}">
<fieldset>
<div class="rowElem noborder">
<fieldset>
<div class="rowElem noborder">
<label>{% trans 'Clear' %}</label>
<div class="formRight">
<input type="submit" value="{% trans 'Invalidate cache' %}" class="greyishBtn submitForm" />
</div>
<div class="fix"></div>
</div>
</fieldset>
</form>
</div>

<div id="tab-phpinfo" class="tab_content nopadding">
<div id="box-phpinfo">
{{ x|phpinfo|raw }}
</div>
</fieldset>
</div>

</div>
</div>

{% endblock %}

{% block head %}{{ mf.bb_editor('.bb-textarea') }}{% endblock %}

0 comments on commit 79dbadd

Please sign in to comment.