diff -N -a --unified -r mantisbt/account_page.php mantisbt-file_avatar/account_page.php
--- mantisbt/account_page.php	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-file_avatar/account_page.php	2008-12-01 11:43:10.032455300 -0500
@@ -50,6 +50,9 @@
 	$t_core_path = config_get( 'core_path' );
 
 	require_once( $t_core_path.'current_user_api.php' );
+	require_once( $t_core_path.'avatar_api.php' );
+	
+	$t_use_gravatar = config_get( 'use_gravatar', false, auth_get_current_user_id(), ALL_PROJECTS );
 
 	#============ Parameters ============
 	# (none)
@@ -94,7 +97,7 @@
 <br />
 <?php } ?>
 <div align="center">
-<form method="post" action="account_update.php">
+<form method="post" action="account_update.php" enctype="multipart/form-data">
 <?php  echo form_security_field( 'account_update' )?>
 <?php if ( isset( $g_session_pass_id ) ) { ?>
 <input type="hidden" name="session_id" value="<?php echo session_id() ?>"/>
@@ -209,6 +212,40 @@
 		</td>
 	</tr>
 
+	<!-- Avatar -->
+ 	<tr <?php echo helper_alternate_class() ?>>
+		<td class="category">
+			<?php echo lang_get( 'use_gravatar' ) ?>:
+		</td>
+		<td>
+			<input type="checkbox" name="use_gravatar" <?php check_checked( $t_use_gravatar, ON ); ?> />
+		</td>
+	</tr>
+	<tr <?php echo helper_alternate_class() ?> >
+		<td class="category">
+			<?php echo lang_get( 'avatar' ) ?>:
+		</td>
+		<td>
+			<?php $t_avatar_exist = avatar_print( $u_id, null, "manage_avatar" ); echo NBSP; ?>
+			<?php if ($t_avatar_exist and !config_get( 'use_gravatar', false, $u_id, ALL_PROJECTS )) { ?>
+		  	<input class="button-small" type="submit" name="delete_avatar" value="<?php echo lang_get( 'delete_avatar' ) ?>" />
+	  	<?php } ?>
+		</td>
+	</tr>
+<?php 
+	$t_max_file_size = (int) config_get( 'max_avatar_file_size' );
+?>
+	<tr <?php echo helper_alternate_class() ?> >
+		<td class="category">
+			<?php echo lang_get( 'upload_avatar' ) ?>
+			<?php echo '<span class="small">(' . lang_get( 'max_file_size' ) . ': ' . number_format( $t_max_file_size/1000 ) . 'k)</span>'?>
+		</td>
+		<td>
+			<input type="hidden" name="max_file_size" value="<?php echo $t_max_file_size ?>" />
+			<input <?php echo helper_get_tab_index() ?> name="avatar_file" type="file" size="60" />
+		</td>
+	</tr>
+
 	<!-- Access level -->
 	<tr <?php echo helper_alternate_class() ?>>
 		<td class="category">
diff -N -a --unified -r mantisbt/account_update.php mantisbt-file_avatar/account_update.php
--- mantisbt/account_update.php	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-file_avatar/account_update.php	2008-12-01 11:44:17.262957600 -0500
@@ -32,6 +32,7 @@
 	$t_core_path = config_get( 'core_path' );
 
 	require_once( $t_core_path.'email_api.php' );
+	require_once( $t_core_path.'avatar_api.php' );
 
 	form_security_validate('account_update');
 
@@ -43,6 +44,7 @@
 	$f_realname        	= gpc_get_string( 'realname', '' );
 	$f_password        	= gpc_get_string( 'password', '' );
 	$f_password_confirm	= gpc_get_string( 'password_confirm', '' );
+	$f_use_gravatar	    = gpc_get_bool( 'use_gravatar' );
 
 	$f_email = email_append_domain( $f_email );
 
@@ -57,6 +59,7 @@
 	$t_email_updated = false;
 	$t_password_updated = false;
 	$t_realname_updated = false;
+	$t_avatar_updated = false;
 
 	# @@@ Listing what fields were updated is not standard behaviour of Mantis
 	#     it also complicates the code.
@@ -88,6 +91,24 @@
 		}
 	}
 
+	# avatar
+	$t_username = user_get_field( $t_user_id, 'username' );
+	# store use_avatar in config
+	if( config_get('use_gravatar', false) != $f_use_gravatar )
+		$t_avatar_updated = true;
+
+	config_set('use_gravatar', $f_use_gravatar, $t_user_id, ALL_PROJECTS);
+
+	$f_delete_avatar = gpc_get_string( 'delete_avatar', '' );
+	if( is_blank( $f_delete_avatar ) ) {
+		if( isset( $_FILES['avatar_file'] ) && !is_blank($_FILES['avatar_file']['name']) ) {
+			avatar_upload( $t_username, $_FILES['avatar_file']['name'], $_FILES['avatar_file']['tmp_name'] );
+			$t_avatar_updated = true;
+		}
+	} else {
+		avatar_delete( $t_username );
+	}
+
 	form_security_purge('account_update');
 
 	html_page_top1();
@@ -107,6 +128,10 @@
 	if ( $t_realname_updated ) {
 		echo lang_get( 'realname_updated' ) . '<br />';
 	}
+	
+	if ( $t_avatar_updated ) {
+		echo lang_get( 'avatar_updated' ) . '<br />';
+	}
 
 	echo lang_get( 'operation_successful' ) . '<br />';
 	print_bracket_link( $t_redirect, lang_get( 'proceed' ) );
diff -N -a --unified -r mantisbt/bugnote_view_inc.php mantisbt-file_avatar/bugnote_view_inc.php
--- mantisbt/bugnote_view_inc.php	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-file_avatar/bugnote_view_inc.php	2008-12-01 11:45:55.851028600 -0500
@@ -30,6 +30,7 @@
  * Requires bugnote API
  */
 require_once( $t_core_path.'current_user_api.php' );
+require_once( $t_core_path.'avatar_api.php' );
 
 # grab the user id currently logged in
 $t_user_id = auth_get_current_user_id();
@@ -113,7 +114,7 @@
 ?>
 <tr class="bugnote" id="c<?php echo $t_bugnote->id ?>">
         <td class="<?php echo $t_bugnote_css ?>">
-		<?php if ( ON  == config_get("show_avatar") ) print_avatar( $t_bugnote->reporter_id ); ?>
+		<?php if ( ON  == config_get("show_avatar") ) avatar_print( $t_bugnote->reporter_id ); ?>
 		<span class="small">(<?php echo $t_bugnote_id_formatted ?>)</span><br />
 		<?php
 			echo print_user( $t_bugnote->reporter_id );
@@ -121,7 +122,11 @@
 		<span class="small"><?php
 			if ( user_exists( $t_bugnote->reporter_id ) ) {
 				$t_access_level = access_get_project_level( null, (int)$t_bugnote->reporter_id );
-				echo '(', get_enum_element( 'access_levels', $t_access_level ), ')';
+				if( $t_access_level == ANYBODY ) {
+					echo '(no access)';
+				} else {
+					echo '(', get_enum_element( 'access_levels', $t_access_level ), ')';
+				}
 			} 
 		?></span>
 		<?php if ( VS_PRIVATE == $t_bugnote->view_state ) { ?>
diff -N -a --unified -r mantisbt/config_defaults_inc.php mantisbt-file_avatar/config_defaults_inc.php
--- mantisbt/config_defaults_inc.php	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-file_avatar/config_defaults_inc.php	2008-12-01 12:00:05.739572200 -0500
@@ -635,8 +635,19 @@
 	# Only users above this threshold will have their avatar shown
 	$g_show_avatar_threshold = DEVELOPER;
 
-	# Default avatar for users without a gravatar account
-	$g_default_avatar = "%path%images/no_avatar.png";
+	# local directory to store avatar
+	$g_directory_avatar = 'avatar';
+
+        # Default avatar for users without a gravatar account
+	$g_default_avatar = "images/no_avatar.png";
+	
+	$g_avatar_max_width = 96;
+	$g_avatar_max_height = 96;
+
+	$g_max_avatar_file_size = 1048576; // 1 MB, will be resized anyway.
+	
+	# Show avatar in manage_user_list
+	$g_show_avatar_in_manage_user_list = OFF;
 
 	# Show release dates on roadmap/changelog
 	$g_show_changelog_dates = ON;
diff -N -a --unified -r mantisbt/core/avatar_api.php mantisbt-file_avatar/core/avatar_api.php
--- mantisbt/core/avatar_api.php	1969-12-31 19:00:00.000000000 -0500
+++ mantisbt-file_avatar/core/avatar_api.php	2008-12-01 12:02:45.355377800 -0500
@@ -0,0 +1,115 @@
+<?php
+	function avatar_upload( $p_username, $p_name, $p_filename )
+	{
+		global $g_avatar_max_width, $g_avatar_max_height;
+		$target_path = config_get('directory_avatar') . '/';
+		
+		# upload avatar
+		$avatar_file_name = $p_name;
+		$ext = end(explode('.', $p_name));
+		$target_file = $target_path . $p_username . '.png';
+		if( get_imagick_version() != 0 ) {
+			$t_avatar_image = new Imagick($p_filename);
+			$t_avatar_image->thumbnailImage( $g_avatar_max_width, 0 ); // 0 to keep aspect ratio.
+			$t_avatar_image->borderImage( new ImagickPixel("black"), 1, 1 );
+			$t_avatar_image->setImageFormat("png");
+			$t_avatar_image->writeImage( $target_file );
+		}
+		else if( get_gd_version() != 0 )
+		{
+			$ext = end(explode('.', $p_name)); 
+			$t_image = gd_open_image($p_filename, '.' . $ext);
+			if( $t_image === false ) {
+				trigger_error( "Bad image file." );
+			}
+
+			// Get original width and height
+			$t_width = imagesx($t_image);
+			$t_height = imagesy($t_image);
+			
+			// New width and height
+			$t_new_width = $g_avatar_max_width;
+			$t_new_height = $g_avatar_max_height;
+
+			// Resample
+			if( $t_width > $t_height ) {
+				$t_new_height = $t_height * ($t_new_width/$t_width);
+			} else {
+				$t_new_width = $t_width * ($t_new_height/$t_height);
+			}
+
+			$image_resized = imagecreatetruecolor($t_new_width, $t_new_height);
+			imagecopyresampled($image_resized, $t_image, 0, 0, 0, 0, $t_new_width, $t_new_height, $t_width, $t_height);
+			
+			imagepng( $image_resized, $target_file );
+		} else
+			move_uploaded_file($p_filename, $target_file);
+	}
+	
+	function avatar_delete( $p_username )
+	{
+		$target_path = config_get('directory_avatar') . '/';
+		
+		# delete avatar
+		$avatar_file = $target_path . '/' . $p_username . '.gif';
+		$fh = fopen($avatar_file, 'w') or die("can't open file");
+		fclose($fh);
+		
+		unlink($avatar_file);
+
+		$avatar_file = $target_path . '/' . $p_username . '.jpg';
+		$fh = fopen($avatar_file, 'w') or die("can't open file");
+		fclose($fh);
+
+		unlink($avatar_file);
+		
+		$avatar_file = $target_path . '/' . $p_username . '.png';
+		$fh = fopen($avatar_file, 'w') or die("can't open file");
+		fclose($fh);
+
+		unlink($avatar_file);
+	}
+	
+	# Print avatar image for the given user ID
+	function avatar_print( $p_user_id, $p_size = 80, $t_class = "avatar" ) {
+		global $g_default_avatar;
+		
+		$t_avatar_exist = false;
+		if ( !user_exists( $p_user_id ) ) {
+			return false;
+		}
+
+		if ( access_has_project_level( config_get( 'show_avatar_threshold' ), null ) ) {
+			$t_use_gravatar = config_get( 'use_gravatar', false, $p_user_id, ALL_PROJECTS );
+			if ($t_use_gravatar) {
+				$t_avatar = user_get_avatar( $p_user_id, $p_size );
+				if ( false !== $t_avatar ) {
+					$t_avatar_url = $t_avatar[0];
+					$t_width = $t_avatar[1];
+					$t_height = $t_avatar[2];
+					echo '<a rel="nofollow" href="http://site.gravatar.com">' .
+						'<img class="avatar" src="' . $t_avatar_url . '" alt="User avatar"' .
+						' width="' . $t_width . '" height="' . $t_height . '" /></a>';
+				}
+			} else {
+				$t_avatar = user_get_local_avatar( $p_user_id );
+				$t_avatar_url = $t_avatar[0];
+				$t_width = $t_avatar[1];
+				$t_height = $t_avatar[2];
+					
+				$t_avatar_exist = $t_avatar[3];
+
+				if ($t_avatar_exist) {
+					echo '<img class="' . $t_class. '" src="' . $t_avatar_url . '" alt="User avatar"' .
+					' width="' . $t_width . '" height="' . $t_height . '" />';
+				}
+				else {
+					if( $t_class == "avatar" ) {
+						echo '<img class="' . $t_class . '" src="' . $g_default_avatar . '" alt="User avatar"' .
+						' width=" ' . $t_width . '" height="' . $t_height . '" />';
+					}
+				}
+			}
+		}
+		return $t_avatar_exist;
+	}
diff -N -a --unified -r mantisbt/core/custom_field_api.php mantisbt-file_avatar/core/custom_field_api.php
--- mantisbt/core/custom_field_api.php	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-file_avatar/core/custom_field_api.php	2008-12-01 11:51:50.205616600 -0500
@@ -716,7 +716,6 @@
 	db_query_bound( $query, Array( $c_field_id ) );
 
 	$t_custom_field_table = db_get_table( 'mantis_custom_field_table' );
-
 	# delete the definition
 	$query = "DELETE FROM $t_custom_field_table
 				  WHERE id=";
diff -N -a --unified -r mantisbt/core/user_api.php mantisbt-file_avatar/core/user_api.php
--- mantisbt/core/user_api.php	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-file_avatar/core/user_api.php	2008-12-01 11:53:45.558346900 -0500
@@ -769,13 +769,15 @@
 * in this first implementation, only gravatar.com avatars are supported
 * @return array|bool an array( URL, width, height ) or false when the given user has no avatar
 */
-function user_get_avatar( $p_user_id, $p_size = 80 ) {
+function user_get_avatar( $p_user_id ) {
+	global $g_avatar_max_width, $g_avatar_max_height;
+
 	$t_email = strtolower( user_get_email( $p_user_id ) );
 	if( is_blank( $t_email ) ) {
 		$t_result = false;
 	} else {
 		$t_default_image = config_get( 'default_avatar' );
-		$t_size = $p_size;
+		$t_size = $g_avatar_max_width;
 
 		$t_use_ssl = false;
 		if( isset( $_SERVER['HTTPS'] ) && ( strtolower( $_SERVER['HTTPS'] ) != 'off' ) ) {
@@ -799,6 +801,46 @@
 	return $t_result;
 }
 
+/**
+ * return the local stored user avatar image URL
+ * @return array|bool an array( URL, width, height ) or false when the given user has no avatar 
+ */
+function user_get_local_avatar( $p_user_id ) {
+	$t_avatar_exist = true;
+	$avatar_dir = config_get('directory_avatar');
+
+	# default imagesize
+	$t_height = config_get('avatar_max_height');
+	$t_width = config_get('avatar_max_width');
+
+	$t_username = user_get_field($p_user_id, 'username');
+
+	$t_avatar_url = $avatar_dir . '/' . $t_username . '.png'; // mthibeault: Using DIRECTORY_SEPARATOR was not accepted by Firefox
+	if (!file_exists($t_avatar_url)) {
+		$t_avatar_url = $avatar_dir . '/' . $t_username . '.gif';
+		if (!file_exists($t_avatar_url)) {
+			$t_avatar_url = $avatar_dir . '/' . $t_username . '.jpg';
+			if (!file_exists($t_avatar_url)) {
+				$t_avatar_exist = false; 
+			}
+		}
+	}
+
+	if ($t_avatar_exist) {
+		# get image dimensions
+		list($width_orig, $height_orig) = getimagesize($t_avatar_url);
+		$ratio_orig = $width_orig/$height_orig;
+
+		if ($t_width/$t_height > $ratio_orig) {
+			$t_width = $t_height*$ratio_orig;
+		} else {
+			$t_height = $t_width/$ratio_orig;
+		}
+	}      
+
+	return array( $t_avatar_url, $t_width, $t_height, $t_avatar_exist );
+}
+
 # --------------------
 # return the user's access level
 #  account for private project and the project user lists
diff -N -a --unified -r mantisbt/core/utility_api.php mantisbt-file_avatar/core/utility_api.php
--- mantisbt/core/utility_api.php	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-file_avatar/core/utility_api.php	2008-12-01 11:54:06.275903500 -0500
@@ -236,6 +236,46 @@
 	}
 }
 
+function gd_open_image ($file, $extension='') {
+    // Get extension
+	if( is_blank( $extension ) ) {
+		$extension = strrchr($file, '.');
+	}
+	$extension = strtolower($extension);
+    switch($extension) {
+            case '.jpg':
+            case '.jpeg':
+                    $im = @imagecreatefromjpeg($file);
+                    break;
+            case '.gif':
+                    $im = @imagecreatefromgif($file);
+					break;
+			case '.png':
+					$im = @imagecreatefrompng($file);
+                    break;
+
+            // ... etc
+
+            default:
+                    $im = false;
+                    break;
+    }
+
+    return $im;
+}
+
+
+# Return Imagick version
+function get_imagick_version()
+{
+	$t_ImagickfuncList = get_extension_funcs('imagick');
+	if( ! is_array( $t_ImagickfuncList ) ) {
+		return 0;
+	} else {
+		return 1;
+	}
+}
+
 /**
  * return true or false if string matches current page name 
  * @param string $p_string page name
diff -N -a --unified -r mantisbt/css/default.css mantisbt-file_avatar/css/default.css
--- mantisbt/css/default.css	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-file_avatar/css/default.css	2008-12-01 11:54:30.821364600 -0500
@@ -175,5 +175,11 @@
 	border: 0;
 }
 
+.manage_avatar
+{
+	float: left;
+	border: 2;
+}
+
 .progress400				{ position: relative; width: 400px; border: 1px solid #d7d7d7; margin-top: 1em; margin-bottom: 1em; padding: 1px; }
 .progress400 .bar			{ display: block; position: relative; background: #6bba70; text-align: center; font-weight: normal; color: #333; height: 2em; line-height: 2em; }
diff -N -a --unified -r mantisbt/lang/strings_english.txt mantisbt-file_avatar/lang/strings_english.txt
--- mantisbt/lang/strings_english.txt	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-file_avatar/lang/strings_english.txt	2008-12-01 11:55:07.506751400 -0500
@@ -532,6 +532,7 @@
 $s_realname_duplicated = 'Real name is used by another user';
 $s_realname_updated = 'Real name successfully updated';
 $s_password_updated = 'Password successfully updated';
+$s_avatar_updated = 'Avatar successfully updated. You may need to refresh the next page to see the new avatar.';
 
 # adm_permission_report.php
 
@@ -1558,4 +1559,9 @@
 $s_view_account_title = 'User Information';
 
 # view_user_page.php
-$s_manage_user = 'Manage User';
\ No newline at end of file
+$s_manage_user = 'Manage User';
+
+$s_avatar = 'Avatar';
+$s_use_gravatar = 'Use Gravatar for Avatar';
+$s_upload_avatar = 'Upload Avatar';
+$s_delete_avatar = 'Delete Avatar';
diff -N -a --unified -r mantisbt/manage_user_edit_page.php mantisbt-file_avatar/manage_user_edit_page.php
--- mantisbt/manage_user_edit_page.php	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-file_avatar/manage_user_edit_page.php	2008-12-01 11:48:13.905576200 -0500
@@ -24,7 +24,8 @@
 	  * Mantis Core API's
 	  */
 	require_once( 'core.php' );
-
+	require_once( $t_core_path.'avatar_api.php' );
+	
 	auth_reauthenticate();
 
 	access_ensure_global_level( config_get( 'manage_user_threshold' ) );
@@ -44,6 +45,8 @@
 
 	$t_user = user_get_row( $t_user_id );
 
+	$t_use_gravatar = config_get( 'use_gravatar', false, $f_user_id, ALL_PROJECTS );
+	
 	html_page_top1();
 	html_page_top2();
 
@@ -55,7 +58,7 @@
 
 <!-- USER INFO -->
 <div align="center">
-<form method="post" action="manage_user_update.php">
+<form method="post" action="manage_user_update.php" enctype="multipart/form-data">
 <?php echo form_security_field( 'manage_user_update' ) ?>
 <table class="width75" cellspacing="1">
 <!-- Title -->
@@ -127,6 +130,39 @@
 		<input type="checkbox" name="protected" <?php check_checked( $t_user['protected'], ON ); ?> />
 	</td>
 </tr>
+<!-- Avatar -->
+<tr <?php echo helper_alternate_class() ?>>
+	<td class="category">
+		<?php echo lang_get( 'use_gravatar' ) ?>:
+	</td>
+	<td>
+		<input type="checkbox" name="use_gravatar" <?php check_checked( $t_use_gravatar, ON ); ?> />
+	</td>
+</tr>
+<tr <?php echo helper_alternate_class() ?>>
+	<td class="category">
+		<?php echo lang_get( 'avatar' ) ?>:
+	</td>
+	<td>
+		<?php $t_avatar_exist = avatar_print( $t_user['id'], null, "manage_avatar" ); ?>&nbsp;
+		<?php if ($t_avatar_exist and !config_get( 'use_gravatar', false, $f_user_id, ALL_PROJECTS )) { ?>
+		  <input class="button-small" type="submit" name="delete_avatar" value="<?php echo lang_get( 'delete_avatar' ) ?>" />
+	  <?php } ?>
+	</td>
+</tr>
+<?php 
+	$t_max_file_size = (int) config_get( 'max_avatar_file_size' );
+?>
+<tr <?php echo helper_alternate_class() ?>>
+	<td class="category">
+		<?php echo lang_get( 'upload_avatar' ) ?>
+		<?php echo '<span class="small">(' . lang_get( 'max_file_size' ) . ': ' . number_format( $t_max_file_size/1000 ) . 'k)</span>'?>
+	</td>
+	<td>
+		<input type="hidden" name="max_file_size" value="<?php echo $t_max_file_size ?>" />
+		<input <?php echo helper_get_tab_index() ?> name="avatar_file" type="file" size="60" />
+	</td>
+</tr>
 
 <!-- Submit Button -->
 <tr>
diff -N -a --unified -r mantisbt/manage_user_page.php mantisbt-file_avatar/manage_user_page.php
--- mantisbt/manage_user_page.php	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-file_avatar/manage_user_page.php	2008-12-01 11:49:27.463839000 -0500
@@ -28,6 +28,7 @@
 	$t_core_path = config_get( 'core_path' );
 
 	require_once( $t_core_path . 'icon_api.php' );
+	require_once( $t_core_path . 'avatar_api.php' );
 
 	auth_reauthenticate();
 
@@ -277,6 +278,10 @@
 		<?php print_manage_user_sort_link(  'manage_user_page.php', lang_get( 'last_visit' ), 'last_visit', $c_dir, $c_sort, $c_hide, $c_filter ) ?>
 		<?php print_sort_icon( $c_dir, $c_sort, 'last_visit' ) ?>
 	</td>
+	<td>
+		<?php print_manage_user_sort_link(  'manage_user_page.php', lang_get( 'avatar' ), 'avatar', $c_dir, $c_sort, $c_hide ) ?>
+		<?php print_sort_icon( $c_dir, $c_sort, 'avatar' ) ?>
+	</td>
 </tr>
 <?php
 	$t_date_format = config_get( 'normal_date_format' );
@@ -292,6 +297,10 @@
 		if( !isset( $t_access_level[$u_access_level] ) ) {
 			$t_access_level[$u_access_level] = get_enum_element( 'access_levels', $u_access_level );
 		}
+
+		# has avatar
+		$t_avatar = user_get_local_avatar( $u_id );
+		$has_avatar = $t_avatar[3];
 ?>
 <tr <?php echo helper_alternate_class( $i ) ?>>
 	<td>
@@ -312,6 +321,14 @@
         </td>
 	<td><?php echo $u_date_created ?></td>
 	<td><?php echo $u_last_visit ?></td>
+	<td class="center"><?php 
+		if (config_get("show_avatar_in_manage_user_list")) {
+			avatar_print( $u_id , null, "manage_avatar");
+		} else {
+			echo trans_bool( $has_avatar ); 
+		}
+		?>
+	</td>
 </tr>
 <?php
 	}  # end for
diff -N -a --unified -r mantisbt/manage_user_update.php mantisbt-file_avatar/manage_user_update.php
--- mantisbt/manage_user_update.php	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-file_avatar/manage_user_update.php	2008-12-01 11:49:59.133889700 -0500
@@ -42,6 +42,8 @@
 	$f_access_level	= gpc_get_int( 'access_level' );
 	$f_user_id		= gpc_get_int( 'user_id' );
 
+	$f_use_gravatar	= gpc_get_bool( 'use_gravatar' );
+	
 	user_ensure_exists( $f_user_id );
 
 	$f_email	= trim( $f_email );
@@ -111,6 +113,17 @@
 	}
 
 	$result = db_query_bound( $query, $query_params );
+
+	# store use_avatar in config
+	config_set('use_gravatar', $f_use_gravatar, $c_user_id, ALL_PROJECTS);
+
+	$f_delete_avatar = gpc_get_string( 'delete_avatar', '' );
+	if( is_blank( $f_delete_avatar ) ) {
+		if( isset( $_FILES['avatar_file'] ) && !is_blank($_FILES['avatar_file']['name']) )
+			avatar_upload( $t_username, $_FILES['avatar_file']['name'], $_FILES['avatar_file']['tmp_name'] );
+	} else {
+		avatar_delete( $t_username );
+	}
 	$t_redirect_url = 'manage_user_edit_page.php?user_id=' . $c_user_id;
 
 	form_security_purge('manage_user_update');
