/
index.php
172 lines (141 loc) · 4.94 KB
/
index.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?php
# MantisBT - A PHP based bugtracking system
# MantisBT 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.
#
# MantisBT 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 MantisBT. If not, see <http://www.gnu.org/licenses/>.
/**
* Mantis Configuration Checks
*
* This process runs a number of configuration checks against the mantis configuration to find
* common issues.
*
* @package MantisBT
* @copyright Copyright 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
* @copyright Copyright 2002 MantisBT Team - mantisbt-dev@lists.sourceforge.net
* @link http://www.mantisbt.org
*
* @uses check_api.php
* @uses gpc_api.php
* @uses html_api.php
*/
# Load the MantisDB core in maintenance mode. This mode will assume that
# config_inc.php hasn't been specified. Thus the database will not be opened
# and plugins will not be loaded.
define( 'MANTIS_MAINTENANCE_MODE', true );
# Disable output buffering and compression so that test results are returned to
# the user in near real time. This ensures that the user can see the progress
# of the tests, ensuring that the testing process hasn't frozen.
define( 'COMPRESSION_DISABLED', true );
require_once( dirname( dirname( dirname( __FILE__ ) ) ) . '/core.php' );
require_once( 'check_api.php' );
require_api( 'gpc_api.php' );
require_api( 'html_api.php' );
require_api( 'http_api.php' );
# Initialise a special error handler for use with check.php so that errors are
# not treated as being fatal. Instead, integrate error handling inline with the
# test results.
check_init_error_handler();
# Increase the time limit for this script to 5 minutes execution time as some
# of the tests may take a long time to complete.
set_time_limit( 60 * 5 );
$g_show_all = gpc_get_bool( 'show_all', false );
$g_show_errors = gpc_get_bool( 'show_errors', false );
$t_url = basename( __FILE__ ) . '?' . http_build_query(
array(
'show_all' => (int)!$g_show_all,
'show_errors' => (int)!$g_show_errors,
)
);
$t_link = '<a href="%s">%s %s</a>';
$t_show_all_mode_link = sprintf( $t_link, $t_url, ($g_show_all ? 'Hide' : 'Show'), 'passed tests' );
$t_show_errors_mode_link = sprintf( $t_link, $t_url, ($g_show_errors ? 'Hide' : 'Show'), 'verbose error messages' );
http_content_headers();
html_begin();
html_head_begin();
html_css_link( 'admin.css' );
html_content_type();
html_title( 'MantisBT Administration - Check Installation' );
html_head_end();
?>
<body>
<?php html_top_banner(); ?>
<p class="notice">Verbosity: <?php echo $t_show_all_mode_link ?> | <?php echo $t_show_errors_mode_link ?></p>
<table id="check-results">
<thead>
<tr>
<th colspan="2" class="thead1">
<strong>Checking your MantisBT installation...</strong>
</th>
</tr>
</thead>
<?php
define( 'CHECK_PHP_INC_ALLOW', true );
include( 'check_php_inc.php' );
if( !$g_failed_test ) {
define( 'CHECK_DATABASE_INC_ALLOW', true );
include( 'check_database_inc.php' );
}
if( !$g_failed_test ) {
define( 'CHECK_CONFIG_INC_ALLOW', true );
include( 'check_config_inc.php' );
}
if( !$g_failed_test ) {
define( 'CHECK_PATHS_INC_ALLOW', true );
include( 'check_paths_inc.php' );
}
if( !$g_failed_test ) {
define( 'CHECK_WEBSERVICE_INC_ALLOW', true );
include( 'check_webservice_inc.php' );
}
if( !$g_failed_test ) {
define( 'CHECK_INTEGRITY_INC_ALLOW', true );
include( 'check_integrity_inc.php' );
}
if( !$g_failed_test ) {
define( 'CHECK_CRYPTO_INC_ALLOW', true );
include( 'check_crypto_inc.php' );
}
if( !$g_failed_test ) {
define( 'CHECK_I18N_INC_ALLOW', true );
include( 'check_i18n_inc.php' );
}
if( !$g_failed_test ) {
define( 'CHECK_L10N_INC_ALLOW', true );
include( 'check_L10n_inc.php' );
}
if( !$g_failed_test ) {
define( 'CHECK_EMAIL_INC_ALLOW', true );
include( 'check_email_inc.php' );
}
if( !$g_failed_test ) {
define( 'CHECK_ANONYMOUS_INC_ALLOW', true );
include( 'check_anonymous_inc.php' );
}
if( !$g_failed_test ) {
define( 'CHECK_ATTACHMENTS_INC_ALLOW', true );
include( 'check_attachments_inc.php' );
}
if( !$g_failed_test ) {
define( 'CHECK_DISPLAY_INC_ALLOW', true );
include( 'check_display_inc.php' );
}
?>
</table>
<?php if( $g_failed_test ) { ?>
<p class="notice fail2" id="check-notice-failed">Some tests failed. Please review and correct these failed tests before using MantisBT.</p>
<?php } else if( $g_passed_test_with_warnings ) { ?>
<p class="notice warn2" id="check-notice-warnings">Some warnings were encountered. Please review and consider correcting these warnings before using MantisBT.</p>
<?php } else { ?>
<p class="notice pass2" id="check-notice-passed">All tests passed.</p>
<?php } ?>
</body>
</html>