Explorar el Código

Cannot remove/replace own picture in social network bug fixed see #3348

Julio Montoya hace 14 años
padre
commit
68a1830e4c
Se han modificado 1 ficheros con 5 adiciones y 6 borrados
  1. 5 6
      main/auth/profile.php

+ 5 - 6
main/auth/profile.php

@@ -607,9 +607,8 @@ if ($form->validate()) {
 			$user_data['picture_uri'] = $new_picture;
 			$_SESSION['image_uploaded'] = 'success';			
 		}
-	}
-	// remove existing picture if asked
-	elseif (!empty($user_data['remove_picture'])) {
+	} elseif (!empty($user_data['remove_picture'])) {
+	    // remove existing picture if asked
 		UserManager::delete_user_picture(api_get_user_id());
 		$user_data['picture_uri'] = '';
 	}
@@ -657,15 +656,15 @@ if ($form->validate()) {
     }
     
 	//Only update values that are request by the "profile" setting
-	$profile_list = api_get_setting('profile');
-		
+	$profile_list = api_get_setting('profile');		
 	$available_values_to_modify = array();
-	
 	foreach($profile_list as $key => $status) {	    
 	    if ($status == 'true') {
             if ($key == 'name') {
                $available_values_to_modify[] = 'firstname';
                $available_values_to_modify[] = 'lastname'; 
+            } elseif ($key == 'picture') {
+               $available_values_to_modify[] = 'picture_uri';               
             } else {
     	       $available_values_to_modify[] = $key;
     	    }