Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0b8298e
Choose a base ref
...
head repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 991e54b
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Nov 19, 2011

  1. Removed trailing whitespace

    dregad committed Nov 19, 2011
    Copy the full SHA
    dbbd3cf View commit details

Commits on Nov 20, 2011

  1. Perform obsolete check against db config also

    Previously the check for usage of obsolete configuration variables was
    only performed against global variables (defined in config_inc.php).
    With this change, a more thorough verification is done, including
    values with an override in mantis_config_table.
    
    Detailed information about where the config option is used is printed
    with the warning message.
    
    Fixes #13435
    dregad committed Nov 20, 2011
    Copy the full SHA
    5e9b834 View commit details
  2. Remove "$g_" prefix from obsolete config warning messages

    Designating config options using the "$g_" prefix in the warning
    messages when checking for obsolete configurations does not make sense
    when they are defined in the database.
    
    Removing this previx also makes the messages consistent with the new
    admin checks interface in 1.3.
    
    Affects issue #13435
    dregad committed Nov 20, 2011
    Copy the full SHA
    991e54b View commit details
Showing with 36 additions and 14 deletions.
  1. +8 −8 admin/check.php
  2. +28 −6 core/config_api.php
16 changes: 8 additions & 8 deletions admin/check.php
Original file line number Diff line number Diff line change
@@ -224,9 +224,7 @@ function test_database_utf8() {
<td class="form-title" width="30%" colspan="2"><?php echo 'Checking your installation' ?></td>
</tr>

<?php

require_once( 'obsolete.php' );
<?php

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, '>=' ) );

@@ -239,6 +237,8 @@ function test_database_utf8() {
print_info_row( 'Database is not connected - Can not continue checks' );
}

require_once( 'obsolete.php' );

if( isset( $ADODB_vers ) ) {
# ADOConnection::Version() is broken as it treats v5.1 the same as v5.10
# Therefore we must extract the correct version ourselves
@@ -251,7 +251,7 @@ function test_database_utf8() {

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 );
$t_serverinfo = $g_db->ServerInfo();

print_info_row( 'Database Type (adodb)', $g_db->databaseType );
print_info_row( 'Database Provider (adodb)', $g_db->dataProvider );
print_info_row( 'Database Server Description (adodb)', $t_serverinfo['description'] );
@@ -368,7 +368,7 @@ function test_database_utf8() {

if ( config_get_global( 'allow_file_upload' ) ) {
print_test_row( 'Checking that fileuploads are allowed in php (enabled in mantis config)', ini_get_bool( 'file_uploads' ) );

print_info_row( 'PHP variable "upload_max_filesize"', ini_get_number( 'upload_max_filesize' ) );
print_info_row( 'PHP variable "post_max_size"', ini_get_number( 'post_max_size' ) );
print_info_row( 'MantisBT variable "max_file_size"', config_get_global( 'max_file_size' ) );
@@ -384,11 +384,11 @@ function test_database_utf8() {
break;
case DISK:
$t_upload_path = config_get_global( 'absolute_path_default_upload_folder' );
print_test_row( 'Checking that absolute_path_default_upload_folder has a trailing directory separator: "' . $t_upload_path . '"',
print_test_row( 'Checking that absolute_path_default_upload_folder has a trailing directory separator: "' . $t_upload_path . '"',
( DIRECTORY_SEPARATOR == substr( $t_upload_path, -1, 1 ) ) );
break;
}

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.');
}
?>
@@ -409,7 +409,7 @@ function test_database_utf8() {
<td bgcolor="#f4f4f4">All Tests Passed. If you would like to view passed tests click <a href="check.php?showall=1">here</a>.</td>
</tr>
</table>
<?php
<?php
}
?>
</body>
34 changes: 28 additions & 6 deletions core/config_api.php
Original file line number Diff line number Diff line change
@@ -522,24 +522,46 @@ function config_flush_cache( $p_option = '', $p_user = ALL_USERS, $p_project = A
# Checks if an obsolete configuration variable is still in use. If so, an error
# will be generated and the script will exit. This is called from admin_check.php.
function config_obsolete( $p_var, $p_replace = '' ) {
global $g_cache_config;

# @@@ we could trigger a WARNING here, once we have errors that can
# have extra data plugged into them (we need to give the old and
# new config option names in the warning text)

if( config_is_set( $p_var ) ) {
$t_description = '<p><b>Warning:</b> The configuration option <tt>$g_' . $p_var . '</tt> is now obsolete</p>';
$t_description = '<p><b>Warning:</b> The configuration option <tt>' . $p_var . '</tt> is now obsolete</p>';
$t_info = '';

// Check if set in the database
if( is_array( $g_cache_config ) && array_key_exists( $p_var, $g_cache_config ) ) {
$t_info .= 'it is currently defined in ';
if( isset( $GLOBALS['g_' . $p_var] ) ) {
$t_info .= 'config_inc.php, as well as in ';
}
$t_info .= 'the database configuration for: <ul>';

foreach( $g_cache_config[$p_var] as $t_user_id => $t_user ) {
$t_info .= '<li>'
. (($t_user_id == 0)? lang_get('all_users') : user_get_name( $t_user_id ))
. ': ';
foreach ( $t_user as $t_project_id => $t_project ) {
$t_info .= project_get_name( $t_project_id ) . ', ';
}
$t_info = rtrim( $t_info, ', ') . '</li>';
}
$t_info .= '</ul>';
}

// Replacement defined
if( is_array( $p_replace ) ) {
$t_info = 'please see the following options: <ul>';
$t_info .= 'please see the following options: <ul>';
foreach( $p_replace as $t_option ) {
$t_info .= '<li>$g_' . $t_option . '</li>';
$t_info .= '<li>' . $t_option . '</li>';
}
$t_info .= '</ul>';
}
else if( !is_blank( $p_replace ) ) {
$t_info = 'please use <tt>$g_' . $p_replace . '</tt> instead.';
} else {
$t_info = '';
$t_info .= 'please use <tt>' . $p_replace . '</tt> instead.';
}

print_test_warn_row( $t_description, false, $t_info );