diff --git a/admin_settings.php b/admin_settings.php index 6c16cc7a..47d61fef 100644 --- a/admin_settings.php +++ b/admin_settings.php @@ -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( + '#(?:

(?:)?(.*?)(?:)?

)|(?:(.*?)\s*(?:(.*?)\s*(?:(.*?)\s*)?)?)#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') { diff --git a/lib/navigation/00.froxlor.main.php b/lib/navigation/00.froxlor.main.php index 2466dd46..266ce010 100644 --- a/lib/navigation/00.froxlor.main.php +++ b/lib/navigation/00.froxlor.main.php @@ -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'], diff --git a/lng/english.lng.php b/lng/english.lng.php index be471b70..3138a704 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -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.

e.g. a request to http://domain.tld/ will redirect you to https://domain.tld/'; +$lng['admin']['phpinfo'] = 'PHPinfo()'; diff --git a/templates/Froxlor/admin/settings/phpinfo.tpl b/templates/Froxlor/admin/settings/phpinfo.tpl new file mode 100644 index 00000000..5bb2c46c --- /dev/null +++ b/templates/Froxlor/admin/settings/phpinfo.tpl @@ -0,0 +1,14 @@ +$header +
+
+

+   + {$lng['admin']['phpinfo']} +

+
+ +
+ {$phpinfo} +
+
+$footer diff --git a/templates/Froxlor/admin/settings/phpinfo/phpinfo_1.tpl b/templates/Froxlor/admin/settings/phpinfo/phpinfo_1.tpl new file mode 100644 index 00000000..9ecc60a8 --- /dev/null +++ b/templates/Froxlor/admin/settings/phpinfo/phpinfo_1.tpl @@ -0,0 +1,3 @@ + + {$val} + diff --git a/templates/Froxlor/admin/settings/phpinfo/phpinfo_2.tpl b/templates/Froxlor/admin/settings/phpinfo/phpinfo_2.tpl new file mode 100644 index 00000000..c6bb33d0 --- /dev/null +++ b/templates/Froxlor/admin/settings/phpinfo/phpinfo_2.tpl @@ -0,0 +1,4 @@ + + {$key} + {$val} + diff --git a/templates/Froxlor/admin/settings/phpinfo/phpinfo_3.tpl b/templates/Froxlor/admin/settings/phpinfo/phpinfo_3.tpl new file mode 100644 index 00000000..907d4fb9 --- /dev/null +++ b/templates/Froxlor/admin/settings/phpinfo/phpinfo_3.tpl @@ -0,0 +1,5 @@ + + {$key} + {$val[0]} + {$val[1]} + diff --git a/templates/Froxlor/admin/settings/phpinfo/phpinfo_table.tpl b/templates/Froxlor/admin/settings/phpinfo/phpinfo_table.tpl new file mode 100644 index 00000000..fd2df4c3 --- /dev/null +++ b/templates/Froxlor/admin/settings/phpinfo/phpinfo_table.tpl @@ -0,0 +1,10 @@ + + + + + + + + {$phpinfoentries} + +
{$name}
diff --git a/templates/Sparkle/admin/settings/phpinfo.tpl b/templates/Sparkle/admin/settings/phpinfo.tpl new file mode 100644 index 00000000..5bb2c46c --- /dev/null +++ b/templates/Sparkle/admin/settings/phpinfo.tpl @@ -0,0 +1,14 @@ +$header +
+
+

+   + {$lng['admin']['phpinfo']} +

+
+ +
+ {$phpinfo} +
+
+$footer diff --git a/templates/Sparkle/admin/settings/phpinfo/phpinfo_1.tpl b/templates/Sparkle/admin/settings/phpinfo/phpinfo_1.tpl new file mode 100644 index 00000000..9ecc60a8 --- /dev/null +++ b/templates/Sparkle/admin/settings/phpinfo/phpinfo_1.tpl @@ -0,0 +1,3 @@ + + {$val} + diff --git a/templates/Sparkle/admin/settings/phpinfo/phpinfo_2.tpl b/templates/Sparkle/admin/settings/phpinfo/phpinfo_2.tpl new file mode 100644 index 00000000..c6bb33d0 --- /dev/null +++ b/templates/Sparkle/admin/settings/phpinfo/phpinfo_2.tpl @@ -0,0 +1,4 @@ + + {$key} + {$val} + diff --git a/templates/Sparkle/admin/settings/phpinfo/phpinfo_3.tpl b/templates/Sparkle/admin/settings/phpinfo/phpinfo_3.tpl new file mode 100644 index 00000000..907d4fb9 --- /dev/null +++ b/templates/Sparkle/admin/settings/phpinfo/phpinfo_3.tpl @@ -0,0 +1,5 @@ + + {$key} + {$val[0]} + {$val[1]} + diff --git a/templates/Sparkle/admin/settings/phpinfo/phpinfo_table.tpl b/templates/Sparkle/admin/settings/phpinfo/phpinfo_table.tpl new file mode 100644 index 00000000..fd2df4c3 --- /dev/null +++ b/templates/Sparkle/admin/settings/phpinfo/phpinfo_table.tpl @@ -0,0 +1,10 @@ + + + + + + + + {$phpinfoentries} + +
{$name}