-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgminfo.php
128 lines (109 loc) · 4.24 KB
/
gminfo.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
/**
* Displays information on the PHP installation
*
* Provides links for administrators to get to other administrative areas of the site
*
* Genmod: Genealogy Viewer
* Copyright (C) 2005 - 2012 Genmod Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @package Genmod
* @subpackage Admin
* @version $Id: gminfo.php 29 2022-07-17 13:18:20Z Boudewijn $
*/
/**
* Inclusion of the configuration file
*/
require "config.php";
if (!$gm_user->userGedcomAdmin()) {
if (LOGIN_URL == "") header("Location: login.php?url=gminfo.php?action=".$action);
else header("Location: ".LOGIN_URL."?url=gminfo.php?action=".$action);
exit;
}
if (!isset($action)) $action = "";
if ($action == "phpinfo") PrintHeader(GM_LANG_phpinfo);
else PrintHeader(GM_LANG_help_config);
?><!-- Setup the left box -->
<div id="AdminColumnLeft">
<?php
AdminFunctions::AdminLink("admin.php", GM_LANG_admin);
?>
</div>
<!-- Setup the right box -->
<div id="AdminColumnRight">
</div>
<div id="AdminColumnMiddle">
<?php
if ($action == "phpinfo") {
$helpindex = "phpinfo_help";
?>
<?php
ob_start();
phpinfo();
$php_info = ob_get_contents();
ob_end_clean();
$php_info = str_replace(" width=\"600\"", " width=\"\"", $php_info);
$php_info = str_replace("</div></body></html>", "", $php_info);
$php_info = str_replace("<table", "<table class=\"GMInfoTable\"", $php_info);
$php_info = str_replace("td class=\"e\"", "td class=\"NavBlockLabel GMInfoLabel\"", $php_info);
$php_info = str_replace("td class=\"v\"", "td class=\"NavBlockField GMInfoField\"", $php_info);
$php_info = str_replace("tr class=\"v\"", "tr", $php_info);
$php_info = str_replace("tr class=\"h\"", "tr", $php_info);
$php_info = str_replace("<th>", "<th class=\"NavBlockColumnHeader\">", $php_info);
$php_info = str_replace(";", "; ", $php_info);
$php_info = str_replace(",", ", ", $php_info);
function strip_spaces($match) {
return "<a name=\"".str_replace(" ", "_", $match[1])."\"";
}
$php_info = preg_replace_callback("/\<a name=\"(.*)\"/", "strip_spaces", $php_info);
// Put logo in table header
$logo_offset = strpos($php_info, "<td>");
$php_info = substr_replace($php_info, "<td colspan=\"3\" class=\"NavBlockHeader AdminNavBlockHeader\">", $logo_offset, 4);
$logo_width_offset = strpos($php_info, "width=\"\"");
$php_info = substr_replace($php_info, "width=\"800\"", $logo_width_offset, 8);
$php_info = str_replace(" width=\"\"", "", $php_info);
$offset = strpos($php_info, "<table");
$php_info = substr($php_info, $offset);
print $php_info;
?>
<?php
}
if ($action=="confighelp") {
print "<div class=\"NavBlockHeader AdminNavBlockHeader\"><span class=\"AdminNavBlockTitle\">".Str2Upper(GM_LANG_help_config)."</span></div>";
$language_array = array();
$language_array = LanguageFunctions::LoadLanguage($LANGUAGE,true, true);
$english_array = LanguageFunctions::LoadLanguage("english",true, true);
print "<div class=\"NavBlockField GMInfoHelpList\">";
print "<ol>";
foreach ($language_array as $string => $text) {
if (stristr($text, "~#gm_lang")) {
print "<li>";
print stripslashes(PrintText($text,0,2)) . "<br /><br /></li>\r\n";
}
else {
if (stristr($english_array[$string], "~#gm_lang")) {
print "<li>";
print stripslashes(PrintText($english_array[$string],0,2)) . "<br /><br /></li>\r\n";
}
}
}
print "</ol>";
print "</div>";
}
print "</div>";
PrintFooter();
?>