// Future performance update: have client upload image to intermediary storage, submit location with imag eid for WCF processing (similar to other imageing solutions) public DataAccessResponseType UpdatePlatformUserProfilePhoto(string userId, byte[] imageByteArray, string requesterId, RequesterType requesterType, string sharedClientKey) { // Ensure the clients are certified. if (sharedClientKey != Sahara.Core.Platform.Requests.RequestManager.SharedClientKey) { return(null); } #region Validate Request var requesterName = string.Empty; var requesterEmail = string.Empty; var requestResponseType = RequestManager.ValidateRequest(requesterId, requesterType, out requesterName, out requesterEmail, Sahara.Core.Settings.Platform.Users.Authorization.Roles.SuperAdmin, null); if (!requestResponseType.isApproved) { //Request is not approved, send results: return(new DataAccessResponseType { isSuccess = false, ErrorMessage = requestResponseType.requestMessage }); } #endregion var result = PlatformUserManager.UpdateProfilePhoto(userId, imageByteArray); #region Log Platoform Activity if (result.isSuccess) { try { var logDescription = string.Empty; if (userId == requesterId) { logDescription = requesterName + " has updated their profile photo"; } else { var user = PlatformUserManager.GetUser(userId); logDescription = requesterName + " updated " + user.FullName + "'s profile photo"; } PlatformLogManager.LogActivity( CategoryType.PlatformUser, ActivityType.PlatformUser_Edited, "Photo updated", logDescription, null, null, requesterId, requesterName, requesterEmail ); } catch { } } #endregion return(result); }