add phpinfo() in admin-panel, thx to EleRas; fixes #1270
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -115,6 +115,46 @@ if(($page == 'settings' || $page == 'overview')
|
||||
|
||||
}
|
||||
}
|
||||
elseif($page == 'phpinfo'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
ob_start();
|
||||
phpinfo();
|
||||
$phpinfo = array('phpinfo' => array());
|
||||
if (preg_match_all(
|
||||
'#(?:<h2>(?:<a name=".*?">)?(.*?)(?:</a>)?</h2>)|(?:<tr(?: class=".*?")?><t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>)?)?</tr>)#s',
|
||||
ob_get_clean(), $matches, PREG_SET_ORDER
|
||||
)
|
||||
) {
|
||||
foreach ($matches as $match) {
|
||||
$end = array_keys($phpinfo);
|
||||
$end = end($end);
|
||||
if (strlen($match[1])) {
|
||||
$phpinfo[$match[1]] = array();
|
||||
} elseif (isset($match[3])) {
|
||||
$phpinfo[$end][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3];
|
||||
} else {
|
||||
$phpinfo[$end][] = $match[2];
|
||||
}
|
||||
}
|
||||
$phpinfohtml = '';
|
||||
foreach ($phpinfo as $name => $section) {
|
||||
$phpinfoentries = "";
|
||||
foreach ($section as $key => $val) {
|
||||
if (is_array($val)) {
|
||||
eval("\$phpinfoentries .= \"" . getTemplate("settings/phpinfo/phpinfo_3") . "\";");
|
||||
} elseif (is_string($key)) {
|
||||
eval("\$phpinfoentries .= \"" . getTemplate("settings/phpinfo/phpinfo_2") . "\";");
|
||||
} else {
|
||||
eval("\$phpinfoentries .= \"" . getTemplate("settings/phpinfo/phpinfo_1") . "\";");
|
||||
}
|
||||
}
|
||||
eval("\$phpinfohtml .= \"" . getTemplate("settings/phpinfo/phpinfo_table") . "\";");
|
||||
}
|
||||
$phpinfo = $phpinfohtml;
|
||||
}
|
||||
eval("echo \"" . getTemplate("settings/phpinfo") . "\";");
|
||||
}
|
||||
elseif($page == 'rebuildconfigs'
|
||||
&& $userinfo['change_serversettings'] == '1')
|
||||
{
|
||||
|
||||
@@ -221,6 +221,11 @@ return array (
|
||||
'label' => $lng['admin']['serversettings'],
|
||||
'required_resources' => 'change_serversettings',
|
||||
),
|
||||
array (
|
||||
'url' => 'admin_settings.php?page=phpinfo',
|
||||
'label' => $lng['admin']['phpinfo'],
|
||||
'required_resources' => 'change_serversettings',
|
||||
),
|
||||
array (
|
||||
'url' => 'admin_ipsandports.php?page=ipsandports',
|
||||
'label' => $lng['admin']['ipsandports']['ipsandports'],
|
||||
|
||||
@@ -1968,3 +1968,4 @@ $lng['domains']['ipandport_multi']['description'] = 'Specify one or more IP addr
|
||||
$lng['domains']['ipandport_ssl_multi']['title'] = 'SSL IP address(es)';
|
||||
$lng['domains']['ssl_redirect']['title'] = 'SSL redirect';
|
||||
$lng['domains']['ssl_redirect']['description'] = 'This option creates redirects for non-ssl vhosts so that all requests are redirected to the SSL-vhost.<br /><br />e.g. a request to <strong>http</strong>://domain.tld/ will redirect you to <strong>https</strong>://domain.tld/';
|
||||
$lng['admin']['phpinfo'] = 'PHPinfo()';
|
||||
|
||||
14
templates/Froxlor/admin/settings/phpinfo.tpl
Normal file
14
templates/Froxlor/admin/settings/phpinfo.tpl
Normal file
@@ -0,0 +1,14 @@
|
||||
$header
|
||||
<article>
|
||||
<header>
|
||||
<h2>
|
||||
<img src="templates/{$theme}/assets/img/icons/res_recalculate_big.png" alt="" />
|
||||
{$lng['admin']['phpinfo']}
|
||||
</h2>
|
||||
</header>
|
||||
|
||||
<section class="fullform bradiusodd">
|
||||
{$phpinfo}
|
||||
</section>
|
||||
</article>
|
||||
$footer
|
||||
3
templates/Froxlor/admin/settings/phpinfo/phpinfo_1.tpl
Normal file
3
templates/Froxlor/admin/settings/phpinfo/phpinfo_1.tpl
Normal file
@@ -0,0 +1,3 @@
|
||||
<tr>
|
||||
<td colspan="3">{$val}</td>
|
||||
</tr>
|
||||
4
templates/Froxlor/admin/settings/phpinfo/phpinfo_2.tpl
Normal file
4
templates/Froxlor/admin/settings/phpinfo/phpinfo_2.tpl
Normal file
@@ -0,0 +1,4 @@
|
||||
<tr>
|
||||
<td>{$key}</td>
|
||||
<td colspan="2">{$val}</td>
|
||||
</tr>
|
||||
5
templates/Froxlor/admin/settings/phpinfo/phpinfo_3.tpl
Normal file
5
templates/Froxlor/admin/settings/phpinfo/phpinfo_3.tpl
Normal file
@@ -0,0 +1,5 @@
|
||||
<tr>
|
||||
<td>{$key}</td>
|
||||
<td>{$val[0]}</td>
|
||||
<td>{$val[1]}</td>
|
||||
</tr>
|
||||
10
templates/Froxlor/admin/settings/phpinfo/phpinfo_table.tpl
Normal file
10
templates/Froxlor/admin/settings/phpinfo/phpinfo_table.tpl
Normal file
@@ -0,0 +1,10 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">{$name}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{$phpinfoentries}
|
||||
</tbody>
|
||||
</table>
|
||||
14
templates/Sparkle/admin/settings/phpinfo.tpl
vendored
Normal file
14
templates/Sparkle/admin/settings/phpinfo.tpl
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
$header
|
||||
<article>
|
||||
<header>
|
||||
<h2>
|
||||
<img src="templates/{$theme}/assets/img/icons/res_recalculate_big.png" alt="" />
|
||||
{$lng['admin']['phpinfo']}
|
||||
</h2>
|
||||
</header>
|
||||
|
||||
<section class="fullform bradiusodd">
|
||||
{$phpinfo}
|
||||
</section>
|
||||
</article>
|
||||
$footer
|
||||
3
templates/Sparkle/admin/settings/phpinfo/phpinfo_1.tpl
vendored
Normal file
3
templates/Sparkle/admin/settings/phpinfo/phpinfo_1.tpl
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<tr>
|
||||
<td colspan="3">{$val}</td>
|
||||
</tr>
|
||||
4
templates/Sparkle/admin/settings/phpinfo/phpinfo_2.tpl
vendored
Normal file
4
templates/Sparkle/admin/settings/phpinfo/phpinfo_2.tpl
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<tr>
|
||||
<td>{$key}</td>
|
||||
<td colspan="2">{$val}</td>
|
||||
</tr>
|
||||
5
templates/Sparkle/admin/settings/phpinfo/phpinfo_3.tpl
vendored
Normal file
5
templates/Sparkle/admin/settings/phpinfo/phpinfo_3.tpl
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<tr>
|
||||
<td>{$key}</td>
|
||||
<td>{$val[0]}</td>
|
||||
<td>{$val[1]}</td>
|
||||
</tr>
|
||||
10
templates/Sparkle/admin/settings/phpinfo/phpinfo_table.tpl
vendored
Normal file
10
templates/Sparkle/admin/settings/phpinfo/phpinfo_table.tpl
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">{$name}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{$phpinfoentries}
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user