-
Notifications
You must be signed in to change notification settings - Fork 9
/
phpinfo.php
108 lines (79 loc) · 2.12 KB
/
phpinfo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
// This file is part of the Huygens Remote Manager
// Copyright and license notice: see license.txt
use hrm\Nav;
use hrm\Util;
require_once dirname(__FILE__) . '/inc/bootstrap.php';
session_start();
if (isset($_GET['home'])) {
header("Location: " . "home.php");
exit();
}
if (!isset($_SESSION['user']) || !$_SESSION['user']->isLoggedIn() ||
!$_SESSION['user']->isAdmin()
) {
header("Location: " . "login.php");
exit();
}
if (isset($_SERVER['HTTP_REFERER'])) {
$_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
}
$message = "";
include("header.inc.php");
// Get and parse the phpinfo() output
ob_start();
phpinfo();
$phpinfo = ob_get_contents();
ob_end_clean();
$matches = array();
// Get the body content
preg_match('%<body>(.*?)</body>%s', $phpinfo, $matches);
$info = $matches[1];
// "Resize" tables
$info = str_replace('width="600"', 'width="100%"', $info);
// Correct the HTML
$info = preg_replace('%<font(.*?)>%s', "", $info);
$info = preg_replace('%</font>%s', "", $info);
$info = preg_replace('%<img border="0" src=%s', "<img src=", $info);
?>
<div id="nav">
<div id="navleft">
<ul>
<?php
echo(Nav::linkWikiPage('HuygensRemoteManagerHelpSystemSummary'));
?>
</ul>
</div>
<div id="navright">
<ul>
<?php
echo(Nav::textUser($_SESSION['user']->name()));
echo(Nav::linkBack($_SESSION['referer']));
echo(Nav::linkHome(Util::getThisPageName()));
?>
</ul>
</div>
<div class="clear"></div>
</div>
<div id="content">
<h3><img alt="Summary" src="./images/system_title.png" width="40"/>
Extended system summary</h3>
<div id="phpinfo">
<?php echo $info; ?>
</div> <!-- system -->
</div> <!-- content -->
<div id="rightpanel">
<div id="info">
<h3>Quick help</h3>
<p>This page displays extended information about your PHP
installation.</p>
</div>
<div id="message">
<?php
echo "<p>$message</p>";
?>
</div>
</div> <!-- rightpanel -->
<?php
include("footer.inc.php");
?>