--- user.module	2006-06-11 10:43:49.000000000 -0700
+++ new.user.module	2006-06-11 10:47:55.000000000 -0700
@@ -431,7 +431,7 @@
  * Implementation of hook_perm().
  */
 function user_perm() {
-  return array('administer access control', 'administer users', 'access user profiles', 'change own username');
+  return array('administer access control', 'administer users', 'access user profiles', 'change own username', 'change own picture');
 }
 
 /**
@@ -1306,16 +1306,18 @@
   }
 
   // Picture/avatar:
-  if (variable_get('user_pictures', 0)) {
-    $form['picture'] = array('#type' => 'fieldset', '#title' => t('Picture'), '#weight' => 1);
-    $picture = theme('user_picture', (object)$edit);
-    if ($picture) {
-      $form['picture']['current_picture'] = array('#type' => 'markup', '#value' => $picture);
-      $form['picture']['picture_delete'] = array('#type' => 'checkbox', '#title' => t('Delete picture'), '#description' => t('Check this box to delete your current picture.'));
-    } else {
-      $form['picture']['picture_delete'] = array('#type' => 'hidden');
-    }
-    $form['picture']['picture_upload'] = array('#type' => 'file', '#title' => t('Upload picture'), '#size' => 48, '#description' => t('Your virtual face or picture.  Maximum dimensions are %dimensions and the maximum size is %size kB.', array('%dimensions' => variable_get('user_picture_dimensions', '85x85'), '%size' => variable_get('user_picture_file_size', '30'))) .' '. variable_get('user_picture_guidelines', ''));
+  if (user_access('change own picture') || user_access('administer users')) {
+	  if (variable_get('user_pictures', 0)) {
+	    $form['picture'] = array('#type' => 'fieldset', '#title' => t('Picture'), '#weight' => 1);
+	    $picture = theme('user_picture', (object)$edit);
+	    if ($picture) {
+	      $form['picture']['current_picture'] = array('#type' => 'markup', '#value' => $picture);
+	      $form['picture']['picture_delete'] = array('#type' => 'checkbox', '#title' => t('Delete picture'), '#description' => t('Check this box to delete your current picture.'));
+	    } else {
+	      $form['picture']['picture_delete'] = array('#type' => 'hidden');
+	    }
+	    $form['picture']['picture_upload'] = array('#type' => 'file', '#title' => t('Upload picture'), '#size' => 48, '#description' => t('Your virtual face or picture.  Maximum dimensions are %dimensions and the maximum size is %size kB.', array('%dimensions' => variable_get('user_picture_dimensions', '85x85'), '%size' => variable_get('user_picture_file_size', '30'))) .' '. variable_get('user_picture_guidelines', ''));
+	  }
   }
 
   return $form;
@@ -1348,8 +1350,10 @@
   }
 
   // If required, validate the uploaded picture.
-  if ($file = file_check_upload('picture_upload')) {
-    user_validate_picture($file, $edit, $user);
+  if (user_access('change own picture') || user_access('administer users') || arg(1) == 'register') {
+	  if ($file = file_check_upload('picture_upload')) {
+	    user_validate_picture($file, $edit, $user);
+	  }
   }
 }
 
