diff -Naur mantis/adm_config_edit.php mantis-test/adm_config_edit.php --- mantis/adm_config_edit.php 1970-01-01 01:00:00.000000000 +0100 +++ mantis-test/adm_config_edit.php 2011-10-06 09:28:55.000000000 +0200 @@ -0,0 +1,176 @@ +. + + /** + * @package MantisBT + * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org + * @copyright Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net + * @link http://www.mantisbt.org + */ + /** + * MantisBT Core API's + */ + require_once( 'core.php' ); + + access_ensure_project_level( config_get( 'set_configuration_threshold' ) ); + + html_page_top( lang_get( 'configuration_report' ) ); + + print_manage_menu( 'adm_config_report.php' ); + print_manage_config_menu( 'adm_config_report.php' ); + + function print_config_value_as_string( $p_type, $p_value ) { + $t_corrupted = false; + + switch( $p_type ) { + case CONFIG_TYPE_FLOAT: + $t_value = (float)$p_value; + echo $t_value; + return; + case CONFIG_TYPE_INT: + $t_value = (integer)$p_value; + echo $t_value; + return; + case CONFIG_TYPE_STRING: + $t_value = config_eval( $p_value ); + echo string_html_specialchars( "$t_value" ); + return; + case CONFIG_TYPE_COMPLEX: + $t_value = @unserialize( $p_value ); + if ( $t_value === false ) { + $t_corrupted = true; + } + break; + default: + $t_value = config_eval( $p_value ); + break; + } + + if ( $t_corrupted ) { + echo lang_get( 'configuration_corrupted' ); + } else { + if ( function_exists( 'var_export' ) ) { + var_export( $t_value ); + } else { + print_r( $t_value ); + } + } + + } + + $f_config_user_id = gpc_get_int( 'user_id' ); + $f_config_project_id = gpc_get_int( 'project_id' ); + $f_config_option = gpc_get_string( 'config_option' ); + + $t_config_table = db_get_table( 'mantis_config_table' ); + $query = "SELECT type, value, access_reqd FROM $t_config_table + WHERE config_id = " . db_param() . " AND + project_id = " . db_param() . " AND + user_id = " . db_param(); + $result = db_query_bound( $query, Array( $f_config_option, $f_config_project_id, $f_config_user_id ) ); + + # make sure that configuration option specified is found in database + if ( db_num_rows( $result ) != 1 ) { + $t_not_found_value = '***CONFIG OPTION NOT FOUND***'; + error_parameters( $f_config_option ); + trigger_error( ERROR_CONFIG_OPT_NOT_FOUND, ERROR ); + } + + $row = db_fetch_array( $result ); + + $t_config_type_id = $row['type']; + $t_config_value = $row['value']; + +?> +
+
+ +
+ + + + + + + + valign="top"> + + + + valign="top"> + + + + valign="top"> + + + + valign="top"> + + + + valign="top"> + + + + + + +
+ +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+
+ diff -Naur mantis/core/config_api.php mantis-test/core/config_api.php --- mantis/core/config_api.php 2011-07-26 15:49:10.000000000 +0200 +++ mantis-test/core/config_api.php 2011-10-05 16:45:21.000000000 +0200 @@ -435,6 +435,12 @@ } # ------------------ +# Checks if the specific configuration option can be edited in the database. +function config_can_edit( $p_option ) { + return( utf8_strtolower( $p_option ) != 'database_version' ); +} + +# ------------------ # delete the config entry function config_delete( $p_option, $p_user = ALL_USERS, $p_project = ALL_PROJECTS ) { global $g_cache_config, $g_cache_config_access; diff -Naur mantis/lang/strings_english.txt mantis-test/lang/strings_english.txt --- mantis/lang/strings_english.txt 2011-07-26 15:49:10.000000000 +0200 +++ mantis-test/lang/strings_english.txt 2011-10-05 17:21:04.000000000 +0200 @@ -841,6 +841,7 @@ $s_configuration_option_value = 'Value'; $s_all_users = 'All Users'; $s_set_configuration_option = 'Set Configuration Option'; +$s_edit_configuration_option = 'Edit Configuration Option'; $s_delete_config_sure_msg = 'Are you sure you wish to delete this configuration option?'; $s_configuration_corrupted = 'The configuration in the database is corrupted.'; diff -Naur mantis/lang/strings_german.txt mantis-test/lang/strings_german.txt --- mantis/lang/strings_german.txt 2011-07-26 15:49:10.000000000 +0200 +++ mantis-test/lang/strings_german.txt 2011-10-05 17:23:01.000000000 +0200 @@ -696,6 +696,7 @@ $s_configuration_option_value = 'Wert'; $s_all_users = 'Alle Benutzer'; $s_set_configuration_option = 'Speichere Konfigurations-Option'; +$s_edit_configuration_option = 'Bearbeite Konfigurations-Option'; $s_delete_config_sure_msg = 'Sind Sie sicher, dass Sie diese Konfigurationsoption löschen möchten?'; $s_configuration_corrupted = 'Ungültige Konfiguration in der Datenbank'; $s_plugin = 'Plugin';