Esempio n. 1
0
function config_obsolete( $p_var, $p_replace ) {

	# @@@ 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><strong>Warning:</strong> The configuration option <tt>$g_' . $p_var . '</tt> is now obsolete</p>';
		if( is_array( $p_replace ) ) {
			$t_info = 'please see the following options: <ul>';
			foreach( $p_replace as $t_option ) {
				$t_info .= '<li>$g_' . $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 = '';
		}

		print_test_warn_row( $t_description, false, $t_info );
	}
}
Esempio n. 2
0
print_test_row('Checking for mysql is at least version 4.1...', !(db_is_mysql() && version_compare($t_serverinfo['version'], '4.1.0', '<')));
print_test_row('Checking for broken mysql version ( bug 10250)...', !(db_is_mysql() && $t_serverinfo['version'] == '4.1.21'));
if (!is_blank(config_get_global('default_timezone'))) {
    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'))) {
        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'));
    }
} else {
    if (print_test_row('Checking if timezone is set in php.ini....', ini_get('date.timezone') !== '')) {
        print_test_row('Checking if timezone is valid in php.ini....', in_array(ini_get('date.timezone'), timezone_identifiers_list()), ini_get('date.timezone'));
    }
}
test_database_utf8();
print_test_row('Checking Register Globals is set to off', !ini_get_bool('register_globals'));
print_test_row('Checking CRYPT_FULL_SALT is NOT logon method', !(CRYPT_FULL_SALT == config_get_global('login_method')));
print_test_warn_row('Warn if passwords are stored in PLAIN text', !(PLAIN == config_get_global('login_method')));
print_test_warn_row('Warn if CRYPT is used (not MD5) for passwords', !(CRYPT == config_get_global('login_method')));
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'));
    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'));
    switch (config_get_global('file_upload_method')) {
        case DATABASE:
            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.');
            if (500 < min(ini_get_number('upload_max_filesize'), ini_get_number('post_max_size'), config_get_global('max_file_size'))) {
                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.');
            }
            break;
        case DISK:
            $t_upload_path = config_get_global('absolute_path_default_upload_folder');
Esempio n. 3
0
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>' . $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>';
            foreach ($p_replace as $t_option) {
                $t_info .= '<li>' . $t_option . '</li>';
            }
            $t_info .= '</ul>';
        } else {
            if (!is_blank($p_replace)) {
                $t_info .= 'please use <tt>' . $p_replace . '</tt> instead.';
            }
        }
        print_test_warn_row($t_description, false, $t_info);
    }
}