Blame Extras/Mantis/1.1.2-1.fc9/adm_config_report.php

4c79b5
4c79b5
# Mantis - a php based bugtracking system
4c79b5
4c79b5
# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
4c79b5
# Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
4c79b5
4c79b5
# Mantis is free software: you can redistribute it and/or modify
4c79b5
# it under the terms of the GNU General Public License as published by
4c79b5
# the Free Software Foundation, either version 2 of the License, or
4c79b5
# (at your option) any later version.
4c79b5
#
4c79b5
# Mantis is distributed in the hope that it will be useful,
4c79b5
# but WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4c79b5
# GNU General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
4c79b5
4c79b5
	# --------------------------------------------------------
4c79b5
	# $Id: adm_config_report.php,v 1.9.2.1 2007-10-13 22:32:25 giallu Exp $
4c79b5
	# --------------------------------------------------------
4c79b5
4c79b5
	require_once( 'core.php' );
4c79b5
4c79b5
	access_ensure_project_level( config_get( 'view_configuration_threshold' ) );
4c79b5
4c79b5
	$t_core_path = config_get( 'core_path' );
4c79b5
4c79b5
	html_page_top1( lang_get( 'configuration_report' ) );
4c79b5
	html_page_top2();
4c79b5
4c79b5
	print_manage_menu( 'adm_config_report.php' );
4c79b5
	print_manage_config_menu( 'adm_config_report.php' );
4c79b5
4c79b5
	function get_config_type( $p_type ) {
4c79b5
		switch( $p_type ) {
4c79b5
			case CONFIG_TYPE_INT:
4c79b5
				return "integer";
4c79b5
			case CONFIG_TYPE_COMPLEX:
4c79b5
				return "complex";
4c79b5
			case CONFIG_TYPE_STRING:
4c79b5
			default:
4c79b5
				return "string";
4c79b5
		}
4c79b5
	}
4c79b5
4c79b5
	function print_config_value_as_string( $p_type, $p_value ) {
4c79b5
		switch( $p_type ) {
4c79b5
			case CONFIG_TYPE_INT:
4c79b5
				$t_value = (integer)$p_value;
4c79b5
				echo $t_value;
4c79b5
				return;
4c79b5
			case CONFIG_TYPE_STRING:
4c79b5
				$t_value = config_eval( $p_value );
4c79b5
				echo string_nl2br( string_html_specialchars( "'$t_value'" ) );
4c79b5
				return;
4c79b5
			case CONFIG_TYPE_COMPLEX:
4c79b5
				$t_value = unserialize( $p_value );
4c79b5
				break;
4c79b5
			default:
4c79b5
				$t_value = config_eval( $p_value );
4c79b5
				break;
4c79b5
		}
4c79b5
		
4c79b5
		echo '
';
4c79b5
		if ( function_exists( 'var_export' ) ) {
4c79b5
			var_export( $t_value );
4c79b5
		} else {
4c79b5
			print_r( $t_value );
4c79b5
		}
4c79b5
		echo '';
4c79b5
	}
4c79b5
4c79b5
	$t_config_table = config_get_global( 'mantis_config_table' );
4c79b5
	$query = "SELECT config_id, user_id, project_id, type, value, access_reqd FROM $t_config_table ORDER BY user_id, project_id, config_id";
4c79b5
	$result = db_query( $query );
4c79b5
?>
4c79b5

4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
4c79b5
		
4c79b5
			
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
			
4c79b5
		
4c79b5
4c79b5
	while ( $row = db_fetch_array( $result ) ) {
4c79b5
		extract( $row, EXTR_PREFIX_ALL, 'v' );
4c79b5
4c79b5
?>
4c79b5
4c79b5
		 valign="top">
4c79b5
			
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
					if ( config_can_delete( $v_config_id ) ) {
4c79b5
						print_button( 'adm_config_delete.php?user_id=' . $v_user_id . '&project_id=' . $v_project_id . '&config_option=' . $v_config_id, lang_get( 'delete_link' ) );
4c79b5
					} else {
4c79b5
						echo ' ';
4c79b5
					}
4c79b5
				?>
4c79b5
			
4c79b5
		
4c79b5
4c79b5
	} # end for loop
4c79b5
?>
4c79b5
4c79b5
4c79b5
    if ( access_has_global_level( config_get('set_configuration_threshold' ) ) ) {
4c79b5
?>
4c79b5

4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
4c79b5
		<form method="post" action="adm_config_set.php">
4c79b5
 valign="top">
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<select name="user_id">
4c79b5
			<option value="0" selected="selected"></option>
4c79b5
			
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
 valign="top">
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<select name="project_id">
4c79b5
			<option value="0" selected="selected"></option>
4c79b5
			" />
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
 valign="top">
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
			<input type="text" name="config_option" value="" size="64" maxlength="64" />
4c79b5
	
4c79b5
4c79b5
 valign="top">
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<select name="type">
4c79b5
			<option value="default" selected="selected">default</option>
4c79b5
			<option value="string">string</option>
4c79b5
			<option value="integer">integer</option>
4c79b5
			<option value="complex">complex</option>
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
 valign="top">
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
			<textarea name="value" cols="80" rows="10"></textarea>
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
			<input type="submit" name="config_set" class="button" value="<?php echo lang_get( 'set_configuration_option' ) ?>" />
4c79b5
	
4c79b5
4c79b5
		</form>
4c79b5
4c79b5
4c79b5
	} # end user can change config
4c79b5
?>
4c79b5
4c79b5
4c79b5
	html_page_bottom1( __FILE__ );
4c79b5
?>