diff --git a/LaDOSE.Src/LaDOSE.Api/Startup.cs b/LaDOSE.Src/LaDOSE.Api/Startup.cs index bf6f8c7..669e865 100644 --- a/LaDOSE.Src/LaDOSE.Api/Startup.cs +++ b/LaDOSE.Src/LaDOSE.Api/Startup.cs @@ -25,6 +25,7 @@ using Pomelo.EntityFrameworkCore.MySql; using Pomelo.EntityFrameworkCore.MySql.Infrastructure; using AutoMapper; using LaDOSE.Api.Helpers; +using LaDOSE.Business.Helper; using LaDOSE.Entity.Wordpress; namespace LaDOSE.Api @@ -117,7 +118,7 @@ namespace LaDOSE.Api cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - cfg.CreateMap(); + cfg.CreateMap().ForMember(e=>e.Meta,opt=>opt.MapFrom(s=>s.Meta.CleanWpMeta())); cfg.CreateMapTwoWay(); }); diff --git a/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/WordPressViewModel.cs b/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/WordPressViewModel.cs index e6813d3..856b346 100644 --- a/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/WordPressViewModel.cs +++ b/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/WordPressViewModel.cs @@ -162,7 +162,7 @@ namespace LaDOSE.DesktopApp.ViewModels } #endregion - + //TODO : Remove the Meta of WPEvent (parse it in Update DB) private void ParseGame(WPEventDTO selectedWpEvent) { var reservation = SelectedWpEvent.WpBookings.FirstOrDefault(); diff --git a/LaDOSE.Src/LaDOSE.Service/Helper/WpEventDeserialize.cs b/LaDOSE.Src/LaDOSE.Service/Helper/WpEventDeserialize.cs index ba29581..965a7eb 100644 --- a/LaDOSE.Src/LaDOSE.Service/Helper/WpEventDeserialize.cs +++ b/LaDOSE.Src/LaDOSE.Service/Helper/WpEventDeserialize.cs @@ -33,5 +33,22 @@ namespace LaDOSE.Business.Helper return null; } + + //Quick Fix to not leak Email. + //TODO : Parse this shit and put it in database (and git rid of it in the UI) + public static string CleanWpMeta(this string meta) + { + PhpSerializer p = new PhpSerializer(); + var deserialize = p.Deserialize(meta); + + Hashtable currentmeta = deserialize as Hashtable; + + if (currentmeta != null) + { + currentmeta["registration"] = null; + } + + return p.Serialize(currentmeta); + } } } \ No newline at end of file