com web/bugs: Integrate the phpinfo() page in the layout: www/admin/index.php
| From: | Kalle Sommer Nielsen | Date: | Thu, 24 Aug 2017 07:17:27 +0000 |
| Subject: | com web/bugs: Integrate the phpinfo() page in the layout: www/admin/index.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-26338@lists.php.net to get a copy of this message | ||
Commit: d6ea2e4a291ab56343fecc5bc339e5b29878696a
Author: Kalle Sommer Nielsen <kalle@php.net> Thu, 24 Aug 2017 09:17:27 +0200
Parents: 4f6482fb335fac2354cc40f24d5d783873b3bfe2
Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=d6ea2e4a291ab56343fecc5bc339e5b29878696a
Log:
Integrate the phpinfo() page in the layout
Changed paths:
M www/admin/index.php
Diff:
diff --git a/www/admin/index.php b/www/admin/index.php
index c2b13a3..9656eb2 100644
--- a/www/admin/index.php
+++ b/www/admin/index.php
@@ -19,6 +19,9 @@ $actions = array(
$action = !empty($_GET['action']) && isset($actions[$_GET['action']])
? $_GET['action'] : 'list_lists';
+response_header("Bugs admin suite");
+inline_content_menu('/admin/', $action, $actions);
+
if ($action === 'phpinfo') {
ob_start();
phpinfo();
@@ -32,16 +35,15 @@ if ($action === 'phpinfo') {
getenv('USER_PWD_SALT')
);
- echo str_replace($vars, '<hidden>', $phpinfo);
-
- exit;
-}
+ $phpinfo = str_replace($vars, '<hidden>', $phpinfo);
-response_header("Bugs admin suite");
+ // Semi stolen from php-web
+ $m = array();
-inline_content_menu('/admin/', $action, $actions);
+ preg_match('!<body.*?>(.*)</body>!ims', $phpinfo, $m);
+ echo preg_replace('!<a href="http://www.php.net/"><img.*?></a>!ims',
'', $m[1]);
-if ($action === 'list_lists') {
+} elseif ($action === 'list_lists') {
$res = $dbh->query("
SELECT name, list_email
@@ -56,9 +58,7 @@ if ($action === 'list_lists') {
echo "<dt>", $row['name'], ": </dt>\n<dd>",
mailto_list(explode(',', $row['list_email'])), "</dd>\n";
}
echo "</dl>\n";
-}
-
-if ($action === 'list_responses') {
+} elseif ($action === 'list_responses') {
$res = $dbh->query("
SELECT *
@@ -72,9 +72,7 @@ if ($action === 'list_responses') {
}
echo "</pre>\n";
-}
-
-if ($action === 'mysql') {
+} elseif ($action === 'mysql') {
$res = $dbh->query("SHOW TABLES");
$sql = "SELECT version() mysql_version\n";