Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 434 lines (352 sloc) 18.675 kb
e14f244 removed CRs
Kenzaburo Ito authored
1 <?php
4d63b48 @siebrand Mantis -> MantisBT in file headers, comments, and elsewhere.
siebrand authored
2 # MantisBT - a php based bugtracking system
72da4a7 @grangeway PHPDOC changes
grangeway authored
3
4d63b48 @siebrand Mantis -> MantisBT in file headers, comments, and elsewhere.
siebrand authored
4 # MantisBT is free software: you can redistribute it and/or modify
2669909 @giallu Merge back to HEAD the changes between tags:
giallu authored
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 2 of the License, or
7 # (at your option) any later version.
8 #
4d63b48 @siebrand Mantis -> MantisBT in file headers, comments, and elsewhere.
siebrand authored
9 # MantisBT is distributed in the hope that it will be useful,
2669909 @giallu Merge back to HEAD the changes between tags:
giallu authored
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
4d63b48 @siebrand Mantis -> MantisBT in file headers, comments, and elsewhere.
siebrand authored
15 # along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
cfd6797 @vboctor - Replaced the use of / by DIRECTORY_SEPARATOR in a couple of places.
vboctor authored
16
429d79a @grangeway Next batch of phpdoc changes
grangeway authored
17 /**
18 * @package MantisBT
19 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
c757c81 @dregad Update copyright year to 2012
dregad authored
20 * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.net
429d79a @grangeway Next batch of phpdoc changes
grangeway authored
21 * @link http://www.mantisbt.org
22 */
b4cf797 @grangeway Remove remaining closing tags
grangeway authored
23
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
24 error_reporting( E_ALL );
f46fe18 @vboctor Fixed #8291: check.php: Use of undefined constant db_is_connected - a…
vboctor authored
25
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
26 $g_skip_open_db = true; # don't open the database in database_api.php
e14f244 removed CRs
Kenzaburo Ito authored
27
429d79a @grangeway Next batch of phpdoc changes
grangeway authored
28 /**
4d63b48 @siebrand Mantis -> MantisBT in file headers, comments, and elsewhere.
siebrand authored
29 * MantisBT Core API's
429d79a @grangeway Next batch of phpdoc changes
grangeway authored
30 */
3f4914c @siebrand Consistency updates
siebrand authored
31 require_once( dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'core.php' );
07753da * admin/check.php: load obsolete.php
Julian Fitzell authored
32
c36df5b @grangeway following giallu's change to use set_include_path to set first requir…
grangeway authored
33 require_once( 'email_api.php' );
34 require_once( 'database_api.php' );
e14f244 removed CRs
Kenzaburo Ito authored
35
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
36 $f_showall = gpc_get_int( 'showall', false );
e14f244 removed CRs
Kenzaburo Ito authored
37
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
38 $g_failed_test = false;
36e64b3 @grangeway Add WARN option for checks
grangeway authored
39
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
40 function print_test_result( $p_result ) {
41 global $g_failed_test;
42 switch ( $p_result ) {
43 case BAD:
44 echo '<td bgcolor="#ff0088">BAD</td>';
45 $g_failed_test = true;
46 break;
47 case GOOD:
48 echo '<td bgcolor="#00ff88">GOOD</td>';
49 break;
50 case WARN:
51 echo '<td bgcolor="#E56717">WARN</td>';
52 break;
36e64b3 @grangeway Add WARN option for checks
grangeway authored
53 }
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
54 }
e14f244 removed CRs
Kenzaburo Ito authored
55
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
56 function print_info_row( $p_description, $p_info = null ) {
57 if( $p_info == null ) {
58 echo '<tr><td bgcolor="#ffffff" colspan="2">' . $p_description . '</td></tr>';
59 } else {
60 echo '<tr><td bgcolor="#ffffff">' . $p_description . '</td>';
61 echo '<td bgcolor="#ffffff">' . $p_info . '</td></tr>';
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
62 }
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
63 }
64
b5414ad @grangeway Fix #0009997: Add check for Zend Optimizer version
grangeway authored
65 function print_test_row( $p_description, $p_pass, $p_info = null ) {
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
66 global $f_showall;
67 if ( $f_showall == false && $p_pass == true ) {
68 return $p_pass;
69 }
70 echo '<tr><td bgcolor="#ffffff">' .$p_description;
b5414ad @grangeway Fix #0009997: Add check for Zend Optimizer version
grangeway authored
71 if( $p_info != null) {
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
72 if( is_array( $p_info ) ) {
647cf03 @Kirill Fix #11294: System notice undefined offset in print_test_row (check.php)
Kirill authored
73 if( isset( $p_info[$p_pass] ) ) {
74 echo '<br /><i>' . $p_info[$p_pass] . '</i>';
75 }
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
76 } else {
77 echo '<br /><i>' . $p_info . '</i>';
78 }
b5414ad @grangeway Fix #0009997: Add check for Zend Optimizer version
grangeway authored
79 }
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
80 echo '</td>';
81
3f4914c @siebrand Consistency updates
siebrand authored
82 if( $p_pass ) {
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
83 print_test_result( GOOD );
a8f55d5 @grangeway Inconsistent if-else block format.
grangeway authored
84 } else {
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
85 print_test_result( BAD );
86 }
87
88 echo '</tr>';
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
89
90 return $p_pass;
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
91 }
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
92
36e64b3 @grangeway Add WARN option for checks
grangeway authored
93 function print_test_warn_row( $p_description, $p_pass, $p_info = null ) {
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
94 global $f_showall;
95 if ( $f_showall == false && $p_pass == true ) {
96 return $p_pass;
97 }
98 echo '<tr><td bgcolor="#ffffff">' . $p_description;
36e64b3 @grangeway Add WARN option for checks
grangeway authored
99 if( $p_info != null) {
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
100 if( is_array( $p_info ) ) {
101 echo '<br /><i>' . $p_info[$p_pass] . '</i>';
102 } else {
103 echo '<br /><i>' . $p_info . '</i>';
104 }
36e64b3 @grangeway Add WARN option for checks
grangeway authored
105 }
106 echo '</td>';
107
108 if( $p_pass ) {
109 print_test_result( GOOD );
110 } else {
111 print_test_result( WARN );
112 }
113
114 echo '</tr>';
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
115
116 return $p_pass;
36e64b3 @grangeway Add WARN option for checks
grangeway authored
117 }
118
684b278 @grangeway Revert part of previous formatting commit: Array( ) should be array()
grangeway authored
119 function test_bug_download_threshold() {
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
120 $t_pass = true;
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
121
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
122 $t_view_threshold = config_get_global( 'view_attachments_threshold' );
123 $t_download_threshold = config_get_global( 'download_attachments_threshold' );
124 $t_delete_threshold = config_get_global( 'delete_attachments_threshold' );
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
125
3f4914c @siebrand Consistency updates
siebrand authored
126 if( $t_view_threshold > $t_download_threshold ) {
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
127 $t_pass = false;
a8f55d5 @grangeway Inconsistent if-else block format.
grangeway authored
128 } else {
3f4914c @siebrand Consistency updates
siebrand authored
129 if( $t_download_threshold > $t_delete_threshold ) {
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
130 $t_pass = false;
131 }
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
132 }
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
133
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
134 print_test_row( 'Bug attachments download thresholds (view_attachments_threshold, ' .
3f4914c @siebrand Consistency updates
siebrand authored
135 'download_attachments_threshold, delete_attachments_threshold)', $t_pass );
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
136
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
137 return $t_pass;
138 }
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
139
684b278 @grangeway Revert part of previous formatting commit: Array( ) should be array()
grangeway authored
140 function test_bug_attachments_allow_flags() {
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
141 $t_pass = true;
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
142
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
143 $t_own_view = config_get_global( 'allow_view_own_attachments' );
144 $t_own_download = config_get_global( 'allow_download_own_attachments' );
145 $t_own_delete = config_get_global( 'allow_delete_own_attachments' );
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
146
3f4914c @siebrand Consistency updates
siebrand authored
147 if(( $t_own_delete == ON ) && ( $t_own_download == FALSE ) ) {
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
148 $t_pass = false;
a8f55d5 @grangeway Inconsistent if-else block format.
grangeway authored
149 } else {
3f4914c @siebrand Consistency updates
siebrand authored
150 if(( $t_own_download == ON ) && ( $t_own_view == OFF ) ) {
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
151 $t_pass = false;
152 }
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
153 }
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
154
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
155 print_test_row( 'Bug attachments allow own flags (allow_view_own_attachments, ' .
3f4914c @siebrand Consistency updates
siebrand authored
156 'allow_download_own_attachments, allow_delete_own_attachments)', $t_pass );
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
157
e2102e3 @siebrand * remove trailing whitespace, double newlines
siebrand authored
158 return $t_pass;
159 }
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
160
b5414ad @grangeway Fix #0009997: Add check for Zend Optimizer version
grangeway authored
161 function check_zend_optimiser_version() {
a41aeea @davidhicks Fix #11797: Zend Optimizer version check fails for v4+
davidhicks authored
162 $t_pass = false;
b5414ad @grangeway Fix #0009997: Add check for Zend Optimizer version
grangeway authored
163
164 ob_start();
165 phpinfo(INFO_GENERAL);
166 $t_output = ob_get_contents();
167 ob_end_clean();
168
a256ece @siebrand * Replace &nbsp; with HTML5 compliant &#160;
siebrand authored
169 $t_output = str_replace(array("&gt;", "&lt;", "&quot;", "&amp;", "&#039;", "&#160;"), array(">", "<", "\"", "&", "'", " "), $t_output);
b5414ad @grangeway Fix #0009997: Add check for Zend Optimizer version
grangeway authored
170
a41aeea @davidhicks Fix #11797: Zend Optimizer version check fails for v4+
davidhicks authored
171 $t_zend_optimizer_min_version = '3.3.3';
b5414ad @grangeway Fix #0009997: Add check for Zend Optimizer version
grangeway authored
172
f7004c2 @vboctor Fixes: 11098: Zend check is not correct IMHO. - also fixes other chec…
vboctor authored
173 $t_info = '';
174
a41aeea @davidhicks Fix #11797: Zend Optimizer version check fails for v4+
davidhicks authored
175 if ( preg_match( '/with Zend Optimizer\+? v([\d\.]*)/', $t_output, $t_matches ) === 1 ) {
176 if ( version_compare( $t_matches[1], $t_zend_optimizer_min_version, '>=' ) ) {
177 $t_pass = true;
178 } else {
179 $t_info = 'Fail - Installed Version: ' . $t_matches[1] . '. Zend Optimizer should be version be version ' . $t_zend_optimizer_min_version . ' or greater! Some old versions cause the view issues page not to display completely. The latest version of Zend Optimizer can be found at www.zend.com';
b5414ad @grangeway Fix #0009997: Add check for Zend Optimizer version
grangeway authored
180 }
181 } else {
a41aeea @davidhicks Fix #11797: Zend Optimizer version check fails for v4+
davidhicks authored
182 $t_pass = true;
183 $t_info = 'Zend Optimizer not detected.';
b5414ad @grangeway Fix #0009997: Add check for Zend Optimizer version
grangeway authored
184 }
185
a41aeea @davidhicks Fix #11797: Zend Optimizer version check fails for v4+
davidhicks authored
186 print_test_row( 'Checking Zend Optimizer version (if installed)...', $t_pass, $t_info );
b5414ad @grangeway Fix #0009997: Add check for Zend Optimizer version
grangeway authored
187
188 return $t_pass;
189 }
190
cb8575f @grangeway Add checks to check.php to check that database is set up for utf8:
grangeway authored
191 function test_database_utf8() {
192 if ( !db_is_mysql() ) {
193 return;
194 }
195
196 // table collation/character set check
197 $result = db_query_bound( 'SHOW TABLE STATUS' );
198 while( $row = db_fetch_array( $result ) ) {
18e3821 @davidhicks Fix #12033: admin/check utility treats MySQL views like tables
davidhicks authored
199 if( $row['Comment'] !== 'VIEW' ) {
200 print_test_row( 'Checking Table Collation is utf8 for ' . $row['Name'] . '....', substr( $row['Collation'], 0, 5 ) === 'utf8_', $row['Collation'] );
201 }
cb8575f @grangeway Add checks to check.php to check that database is set up for utf8:
grangeway authored
202 }
203
204 foreach( db_get_table_list() as $t_table ) {
205 if( db_table_exists( $t_table ) ) {
206 $result = db_query_bound( 'SHOW FULL FIELDS FROM ' . $t_table );
207 while( $row = db_fetch_array( $result ) ) {
208 if ( $row['Collation'] === null ) {
209 continue;
210 }
211 print_test_row( 'Checking Non-null Column Collation in ' . $t_table . ' is utf8 for ' . $row['Field'] . '....', substr( $row['Collation'], 0, 5 ) === 'utf8_', $row['Collation'] . ' ( ' . $row['Type'] . ')' );
212 }
213 }
214 }
215 }
216
e14f244 removed CRs
Kenzaburo Ito authored
217
07753da * admin/check.php: load obsolete.php
Julian Fitzell authored
218
a22e4e9 @grangeway Initial start of work to make /admin pages part of the standard manti…
grangeway authored
219 html_page_top( 'MantisBT Administration - Check Installation' );
220
221 ?>
222 <table class="width75" align="center" cellspacing="1">
e14f244 removed CRs
Kenzaburo Ito authored
223 <tr>
a22e4e9 @grangeway Initial start of work to make /admin pages part of the standard manti…
grangeway authored
224 <td class="form-title" width="30%" colspan="2"><?php echo 'Checking your installation' ?></td>
e14f244 removed CRs
Kenzaburo Ito authored
225 </tr>
226
dbbd3cf @dregad Removed trailing whitespace
dregad authored
227 <?php
e14f244 removed CRs
Kenzaburo Ito authored
228
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
229 print_test_row( 'MantisBT requires at least <b>PHP ' . PHP_MIN_VERSION . '</b>. You are running <b>PHP ' . phpversion(), $result = version_compare( phpversion(), PHP_MIN_VERSION, '>=' ) );
a22e4e9 @grangeway Initial start of work to make /admin pages part of the standard manti…
grangeway authored
230
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
231 if ( !print_test_row( 'Checking Config File Exists', file_exists( $g_absolute_path . 'config_inc.php' ), array( false => 'Please use install.php to perform initial installation <a href="install.php">Click here</a>' ) ) ) {
232 die;
3f4914c @siebrand Consistency updates
siebrand authored
233 }
2cd81af This is a quick cleanup of the admin_check script. I'm going to cont…
Julian Fitzell authored
234
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
235 print_test_row( 'Opening connection to database [' . config_get_global( 'database_name' ) . '] on host [' . config_get_global( 'hostname' ) . '] with username [' . config_get_global( 'db_username' ) . ']', @db_connect( config_get_global( 'dsn', false ), config_get_global( 'hostname' ), config_get_global( 'db_username' ), config_get_global( 'db_password' ), config_get_global( 'database_name' ) ) != false );
236 if( !db_is_connected() ) {
237 print_info_row( 'Database is not connected - Can not continue checks' );
3f4914c @siebrand Consistency updates
siebrand authored
238 }
2cd81af This is a quick cleanup of the admin_check script. I'm going to cont…
Julian Fitzell authored
239
5e9b834 @dregad Perform obsolete check against db config also
dregad authored
240 require_once( 'obsolete.php' );
241
76cd989 @davidhicks Fix #11560: ADOdb version check in check.php is incorrect
davidhicks authored
242 if( isset( $ADODB_vers ) ) {
243 # ADOConnection::Version() is broken as it treats v5.1 the same as v5.10
244 # Therefore we must extract the correct version ourselves
245 # Upstream bug report: http://phplens.com/lens/lensforum/msgs.php?id=18320
065e5f7 @dregad Cosmetic changes and comments in admin/check.php
dregad authored
246 # This bug has been fixed in ADOdb 5.11 (May 5, 2010) but we still
247 # need to use the backwards compatible approach to detect ADOdb <5.11.
76cd989 @davidhicks Fix #11560: ADOdb version check in check.php is incorrect
davidhicks authored
248 if( preg_match( '/^[Vv]([0-9\.]+)/', $ADODB_vers, $t_matches ) == 1 ) {
249 $t_adodb_version_check_ok = version_compare( $t_matches[1], '5.10', '>=' );
250 }
251 }
065e5f7 @dregad Cosmetic changes and comments in admin/check.php
dregad authored
252 print_test_warn_row( 'Checking ADOdb version...', $t_adodb_version_check_ok, $ADODB_vers );
e5b0087 @grangeway Add check to display adodb version - currently just check >5
grangeway authored
253
eb02696 @dregad Fix #14552: Update admin checks to make sure ADOdb extension is not used
dregad authored
254 # Making sure we're not using the ADOdb extension (see #14552)
255 print_test_row(
256 'Checking use of the <a href="http://adodb.sourceforge.net/#extension">ADOdb extension</a>',
257 !extension_loaded( 'ADOdb' ),
258 "The 'ADOdb' extension is not supported and must be disabled"
259 );
260
065e5f7 @dregad Cosmetic changes and comments in admin/check.php
dregad authored
261 print_test_row( 'Checking using bundled ADOdb with some drivers...', !(db_is_pgsql() || db_is_mssql() || db_is_db2()) || strstr($ADODB_vers, 'MantisBT Version') !== false );
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
262 $t_serverinfo = $g_db->ServerInfo();
dbbd3cf @dregad Removed trailing whitespace
dregad authored
263
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
264 print_info_row( 'Database Type (adodb)', $g_db->databaseType );
265 print_info_row( 'Database Provider (adodb)', $g_db->dataProvider );
266 print_info_row( 'Database Server Description (adodb)', $t_serverinfo['description'] );
267 print_info_row( 'Database Server Description (version)', $t_serverinfo['version'] );
f5fcaed @grangeway Display adodb/database server information in check.php output.
grangeway authored
268
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
269 print_test_row( 'Checking to see if your absolute_path config option has a trailing slash: "' . config_get_global( 'absolute_path' ) . '"', ( "\\" == substr( config_get_global( 'absolute_path' ), -1, 1 ) ) || ( "/" == substr( config_get_global( 'absolute_path' ), -1, 1 ) ) );
2cd81af This is a quick cleanup of the admin_check script. I'm going to cont…
Julian Fitzell authored
270
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
271 // Windows-only checks
f496f44 @grangeway Validate email on windows also.
grangeway authored
272 if( is_windows_server() ) {
46b2fc2 @grangeway Fix mail check changes to allow validate_email =OFF to pass
grangeway authored
273 print_test_row( 'validate_email (if ON) requires php 5.3 on windows...',
274 OFF == config_get_global( 'validate_email' ) || ON == config_get_global( 'validate_email' ) && version_compare( phpversion(), '5.3.0', '>=' ) );
275 print_test_row( 'check_mx_record (if ON) requires php 5.3 on windows...',
276 OFF == config_get_global( 'check_mx_record' ) || ON == config_get_global( 'check_mx_record' ) && version_compare( phpversion(), '5.3.0', '>=' ) );
3f4914c @siebrand Consistency updates
siebrand authored
277 }
278
279 $t_vars = array(
280 'magic_quotes_gpc',
281 'include_path',
282 );
283
284 while( list( $t_foo, $t_var ) = each( $t_vars ) ) {
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
285 print_info_row( $t_var, ini_get( $t_var ) );
3f4914c @siebrand Consistency updates
siebrand authored
286 }
6239113 @vboctor Enh #3662: Provide more config vars to control viewing/downloading/de…
vboctor authored
287
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
288 if ( db_is_mssql() ) {
88274c9 @dregad Add support for SQL Server Native driver
dregad authored
289 if( 'mssql' == config_get_global( 'db_type' ) ) {
290 print_test_warn_row( 'Checking PHP support for Microsoft SQL Server driver',
291 version_compare( phpversion(), '5.3' ) < 0,
292 "'mssql' driver is no longer supported in PHP >= 5.3, please use 'mssqlnative' instead"
293 );
294 }
295
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
296 if ( print_test_row( 'check mssql textsize in php.ini...', ini_get( 'mssql.textsize' ) != 4096, ini_get( 'mssql.textsize' ) ) ) {
297 print_test_warn_row( 'check mssql textsize in php.ini...', ini_get( 'mssql.textsize' ) == 2147483647, ini_get( 'mssql.textsize' ) );
298 }
299 if ( print_test_row( 'check mssql textsize in php.ini...', ini_get( 'mssql.textlimit' ) != 4096 , ini_get( 'mssql.textlimit' ) ) ) {
300 print_test_warn_row( 'check mssql textsize in php.ini...', ini_get( 'mssql.textsize' ) == 2147483647, ini_get( 'mssql.textsize' ) );
301 }
302 }
88274c9 @dregad Add support for SQL Server Native driver
dregad authored
303
60d5c86 @grangeway Add check for valid variables_order
grangeway authored
304 print_test_row( 'check variables_order includes GPCS', stristr( ini_get( 'variables_order' ), 'G' ) && stristr( ini_get( 'variables_order' ), 'P' ) && stristr( ini_get( 'variables_order' ), 'C' ) && stristr( ini_get( 'variables_order' ), 'S' ), ini_get( 'variables_order' ) );
305
306
684b278 @grangeway Revert part of previous formatting commit: Array( ) should be array()
grangeway authored
307 test_bug_download_threshold();
308 test_bug_attachments_allow_flags();
3f4914c @siebrand Consistency updates
siebrand authored
309
310 print_test_row( 'check mail configuration: send_reset_password = ON requires allow_blank_email = OFF',
311 ( ( OFF == config_get_global( 'send_reset_password' ) ) || ( OFF == config_get_global( 'allow_blank_email' ) ) ) );
312 print_test_row( 'check mail configuration: send_reset_password = ON requires enable_email_notification = ON',
313 ( OFF == config_get_global( 'send_reset_password' ) ) || ( ON == config_get_global( 'enable_email_notification' ) ) );
314 print_test_row( 'check mail configuration: allow_signup = ON requires enable_email_notification = ON',
315 ( OFF == config_get_global( 'allow_signup' ) ) || ( ON == config_get_global( 'enable_email_notification' ) ) );
316 print_test_row( 'check mail configuration: allow_signup = ON requires send_reset_password = ON',
317 ( OFF == config_get_global( 'allow_signup' ) ) || ( ON == config_get_global( 'send_reset_password' ) ) );
318 print_test_row( 'check language configuration: fallback_language is not \'auto\'',
319 'auto' <> config_get_global( 'fallback_language' ) );
320 print_test_row( 'check configuration: allow_anonymous_login = ON requires anonymous_account to be set',
321 ( OFF == config_get_global( 'allow_anonymous_login' ) ) || ( strlen( config_get_global( 'anonymous_account') ) > 0 ) );
322
323 $t_anon_user = false;
324
325 print_test_row( 'check configuration: anonymous_account is a valid username if set',
326 ( (strlen( config_get_global( 'anonymous_account') ) > 0 ) ? ( ($t_anon_user = user_get_id_by_name( config_get_global( 'anonymous_account') ) ) !== false ) : TRUE ) );
327 print_test_row( 'check configuration: anonymous_account should not be an administrator',
5824bb7 @davidhicks Remove hardcoded uses of ADMINISTRATOR constant
davidhicks authored
328 ( $t_anon_user ? ( !user_is_administrator( $t_anon_user ) ) : TRUE ) );
3f4914c @siebrand Consistency updates
siebrand authored
329 print_test_row( '$g_bug_link_tag is not empty ("' . config_get_global( 'bug_link_tag' ) . '")',
330 '' <> config_get_global( 'bug_link_tag' ) );
331 print_test_row( '$g_bugnote_link_tag is not empty ("' . config_get_global( 'bugnote_link_tag' ) . '")',
332 '' <> config_get_global( 'bugnote_link_tag' ) );
333 print_test_row( 'filters: dhtml_filters = ON requires use_javascript = ON',
334 ( OFF == config_get_global( 'dhtml_filters' ) ) || ( ON == config_get_global( 'use_javascript' ) ) );
1016312 @grangeway fix; 0009114: SYSTEM WARNING: escapeshellcmd() has been disabled for …
grangeway authored
335 print_test_row( 'Phpmailer sendmail configuration requires escapeshellcmd. Please use a different phpmailer method if this is blocked.',
336 ( PHPMAILER_METHOD_SENDMAIL != config_get( 'phpMailer_method' ) || ( PHPMAILER_METHOD_SENDMAIL == config_get( 'phpMailer_method' ) ) && function_exists( 'escapeshellcmd' ) ) );
337 print_test_row( 'Phpmailer sendmail configuration requires escapeshellarg. Please use a different phpmailer method if this is blocked.',
338 ( PHPMAILER_METHOD_SENDMAIL != config_get( 'phpMailer_method' ) || ( PHPMAILER_METHOD_SENDMAIL == config_get( 'phpMailer_method' ) ) && function_exists( 'escapeshellarg' ) ) );
339
b5414ad @grangeway Fix #0009997: Add check for Zend Optimizer version
grangeway authored
340 check_zend_optimiser_version();
341
157048e @grangeway Update graph plugin.
grangeway authored
342 if( plugin_is_installed( 'MantisGraph' ) ) {
343 plugin_push_current( 'MantisGraph' );
ec4ccc9 @grangeway 0009167: GD Should check for antialiasing in JPGraph
grangeway authored
344
157048e @grangeway Update graph plugin.
grangeway authored
345 print_test_row( 'checking gd is enabled, and version 2...', get_gd_version() == 2 );
c50cfb3 @atrol Fixed #13174: Wrong error message when running admin/check.php
atrol authored
346 if ( plugin_config_get( 'eczlibrary', ON ) == OFF ) {
0cc4308 @Kirill Fix #11492: Incorrect use of BASE_PATH constant in jpgraph check
Kirill authored
347 $t_jpgraph_path = config_get( 'absolute_path' ) . 'library' . DIRECTORY_SEPARATOR . 'jpgraph' . DIRECTORY_SEPARATOR;
18179d4 @grangeway Improve checking for jpgraph config + version:
grangeway authored
348
157048e @grangeway Update graph plugin.
grangeway authored
349 if( !file_exists( $t_jpgraph_path . 'jpgraph.php') ) {
350 print_test_row( 'checking we can find jpgraph class files...', false );
351 } else {
352 require_once( $t_jpgraph_path . 'jpgraph.php' );
353 print_test_row( 'Checking Jpgraph version (if installed)...', version_compare(JPG_VERSION, '2.3.0') ? true : false, JPG_VERSION );
354 }
ec4ccc9 @grangeway 0009167: GD Should check for antialiasing in JPGraph
grangeway authored
355
157048e @grangeway Update graph plugin.
grangeway authored
356 print_test_row( 'check configuration: jpgraph (if used) requires php bundled gd for antialiasing support',
f7004c2 @vboctor Fixes: 11098: Zend check is not correct IMHO. - also fixes other chec…
vboctor authored
357 ( plugin_config_get( 'jpgraph_antialias', OFF ) == OFF || function_exists('imageantialias') ) );
5cf7970 @grangeway Consistency update
grangeway authored
358 }
157048e @grangeway Update graph plugin.
grangeway authored
359 plugin_pop_current();
18179d4 @grangeway Improve checking for jpgraph config + version:
grangeway authored
360 }
ec4ccc9 @grangeway 0009167: GD Should check for antialiasing in JPGraph
grangeway authored
361
3db07ad @grangeway Add test to check that ctype in php is enabled for rss feeds.
grangeway authored
362 print_test_row( 'Checking if ctype is enabled in php (required for rss feeds)....', extension_loaded('ctype') );
363
a22e4e9 @grangeway Initial start of work to make /admin pages part of the standard manti…
grangeway authored
364 print_test_row( 'Checking for mysql is at least version 4.1...', !(db_is_mysql() && version_compare( $t_serverinfo['version'], '4.1.0', '<' ) ) );
365 print_test_row( 'Checking for broken mysql version ( bug 10250)...', !(db_is_mysql() && $t_serverinfo['version'] == '4.1.21') );
b5414ad @grangeway Fix #0009997: Add check for Zend Optimizer version
grangeway authored
366
a058e75 @grangeway Add initial timezone selection functionality
grangeway authored
367 if ( !is_blank ( config_get_global( 'default_timezone' ) ) ) {
368 if ( print_test_row( 'Checking if a timezone is set in config.inc.php....', !is_blank ( config_get_global( 'default_timezone' ) ), config_get_global( 'default_timezone' ) ) ) {
369 print_test_row( 'Checking if timezone is valid from config.inc.php....', in_array( config_get_global( 'default_timezone' ), timezone_identifiers_list() ), config_get_global( 'default_timezone' ) );
370 }
371 } else {
372 if( print_test_row( 'Checking if timezone is set in php.ini....', ini_get( 'date.timezone' ) !== '' ) ) {
373 print_test_row( 'Checking if timezone is valid in php.ini....', in_array( ini_get( 'date.timezone' ), timezone_identifiers_list() ), ini_get( 'date.timezone' ) );
374 }
375 }
376
cb8575f @grangeway Add checks to check.php to check that database is set up for utf8:
grangeway authored
377 test_database_utf8();
378
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
379 print_test_row( 'Checking Register Globals is set to off', ! ini_get_bool( 'register_globals' ) );
cb8575f @grangeway Add checks to check.php to check that database is set up for utf8:
grangeway authored
380
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
381 print_test_row( 'Checking CRYPT_FULL_SALT is NOT logon method', ! ( CRYPT_FULL_SALT == config_get_global( 'login_method' ) ) );
2cd81af This is a quick cleanup of the admin_check script. I'm going to cont…
Julian Fitzell authored
382
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
383 print_test_warn_row( 'Warn if passwords are stored in PLAIN text', ! ( PLAIN == config_get_global( 'login_method' ) ) );
384 print_test_warn_row( 'Warn if CRYPT is used (not MD5) for passwords', ! ( CRYPT == config_get_global( 'login_method' ) ) );
13a2a71 officially remove Mantis' reliance on register_globals
Julian Fitzell authored
385
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
386 if ( config_get_global( 'allow_file_upload' ) ) {
387 print_test_row( 'Checking that fileuploads are allowed in php (enabled in mantis config)', ini_get_bool( 'file_uploads' ) );
dbbd3cf @dregad Removed trailing whitespace
dregad authored
388
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
389 print_info_row( 'PHP variable "upload_max_filesize"', ini_get_number( 'upload_max_filesize' ) );
390 print_info_row( 'PHP variable "post_max_size"', ini_get_number( 'post_max_size' ) );
391 print_info_row( 'MantisBT variable "max_file_size"', config_get_global( 'max_file_size' ) );
13a2a71 officially remove Mantis' reliance on register_globals
Julian Fitzell authored
392
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
393 print_test_row( 'Checking MantisBT upload file size is less than php', ( config_get_global( 'max_file_size' ) <= ini_get_number( 'post_max_size' ) ) && ( config_get_global( 'max_file_size' ) <= ini_get_number( 'upload_max_filesize' ) ) );
13a2a71 officially remove Mantis' reliance on register_globals
Julian Fitzell authored
394
bde53a0 @dregad Fix #13226: check.php should verify that default file upload path has…
dregad authored
395 switch( config_get_global( 'file_upload_method' ) ) {
396 case DATABASE:
397 print_info_row( 'There may also be settings in your web server and database that prevent you from uploading files or limit the maximum file size. See the documentation for those packages if you need more information.');
398 if( 500 < min( ini_get_number( 'upload_max_filesize' ), ini_get_number( 'post_max_size' ), config_get_global( 'max_file_size' ) ) ) {
399 print_info_row( '<span class="error">Your current settings will most likely need adjustments to the PHP max_execution_time or memory_limit settings, the MySQL max_allowed_packet setting, or equivalent.' );
400 }
401 break;
402 case DISK:
403 $t_upload_path = config_get_global( 'absolute_path_default_upload_folder' );
dbbd3cf @dregad Removed trailing whitespace
dregad authored
404 print_test_row( 'Checking that absolute_path_default_upload_folder has a trailing directory separator: "' . $t_upload_path . '"',
bde53a0 @dregad Fix #13226: check.php should verify that default file upload path has…
dregad authored
405 ( DIRECTORY_SEPARATOR == substr( $t_upload_path, -1, 1 ) ) );
406 break;
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
407 }
dbbd3cf @dregad Removed trailing whitespace
dregad authored
408
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
409 print_info_row( 'There may also be settings in your web server that prevent you from uploading files or limit the maximum file size. See the documentation for those packages if you need more information.');
3f4914c @siebrand Consistency updates
siebrand authored
410 }
13a2a71 officially remove Mantis' reliance on register_globals
Julian Fitzell authored
411 ?>
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
412 </table>
65d40c2 - Deprecated CRYPT_FULL_SALT
Jeroen Latour authored
413 <?php
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
414 if ( $g_failed_test ) {
65d40c2 - Deprecated CRYPT_FULL_SALT
Jeroen Latour authored
415 ?>
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
416 <table width="100%" bgcolor="#222222" border="0" cellpadding="20" cellspacing="1">
417 <tr>
418 <td bgcolor="#f4f4f4">Some Tests Failed. Please correct failed tests before using MantisBT.</td>
419 </tr>
420 </table>
421 <?php
422 } else {
423 ?>
424 <table width="100%" bgcolor="#222222" border="0" cellpadding="20" cellspacing="1">
425 <tr>
426 <td bgcolor="#f4f4f4">All Tests Passed. If you would like to view passed tests click <a href="check.php?showall=1">here</a>.</td>
427 </tr>
428 </table>
dbbd3cf @dregad Removed trailing whitespace
dregad authored
429 <?php
cb23b91 @grangeway Reorganise check.php a bit more
grangeway authored
430 }
3f4914c @siebrand Consistency updates
siebrand authored
431 ?>
e14f244 removed CRs
Kenzaburo Ito authored
432 </body>
5e3cce9 Fixed URL
int2str authored
433 </html>
Something went wrong with that request. Please try again.