From e676d2fdbf29434d1dfea603a9289886fb1dd34e Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 12 Feb 2015 16:08:16 +0100 Subject: [PATCH] * Web.csproj: * Profile.aspx: * MyProfile.aspx: * AccountController.cs: renamed the Profile method to "MyProfile", could avoid issue at migrating to MVC5 * favicon.png: favicon now displays a ~"Yavsc" * BlogManager.cs: * BlogsApiController.cs: The authorisation for removing a post is now implemented at Manager's side * BlogsController.cs: Removes this odd call to a static method from the Api controller * CalendarApi.cs: * GoogleController.cs: no more json output for the calls to the Google Api * WorkFlowController.cs: sorted using clauses * Basket.cs: * Commande.cs: * EstimToPdfFormatter.cs: * Brand.cs: adds xml doc * RssFeedsFormatter.cs: modifies xml doc * TexToPdfFormatter.cs: refactoring * Global.asax.cs: Document formatting * BBCodeHelper.cs: encapsulates the url display from the BBCode in starting and closing characters : "<>" * OAuth2.cs: * SimpleJsonPostMethod.cs: using System.Runtime.Serialization.Json instead of Newtonsof.Json * App.master: updating the favicon * RegistrationPending.aspx: fixes the returnUrl usage * AssemblyInfo.aspx: better explanation for this list * Web.config: tried to migrate to MVC5 (using NuGets) * Estim.cs: * ChangePasswordModel.cs: adds xmldoc * BasketController.cs: * BlogProvidersConfigurationSection.cs: cosmetic change * GoogleErrorMessage.cs: - adds xml docs - renders ctor from JsonReaderException obsolete * MvcActionValueBinder.cs: not used * web.config: no more used, gave it up to migrate to MVC5 --- web/Controllers/AccountController.cs | 4 +- web/Controllers/BasketController.cs | 4 +- web/Controllers/BlogsApiController.cs | 11 +- web/Controllers/BlogsController.cs | 2 +- web/Controllers/GoogleController.cs | 9 +- web/Controllers/WorkFlowController.cs | 8 +- web/Formatters/EstimToPdfFormatter.cs | 24 +++-- web/Formatters/RssFeedsFormatter.cs | 2 +- web/Formatters/TexToPdfFormatter.cs | 8 +- web/Global.asax.cs | 9 +- web/Helpers/BBCodeHelper.cs | 7 +- web/Helpers/Google/CalendarApi.cs | 22 ++-- web/Helpers/Google/OAuth2.cs | 13 +-- web/Helpers/SimpleJsonPostMethod.cs | 21 ++-- web/Models/App.master | 6 +- web/MvcActionValueBinder.cs | 97 ------------------ .../Account/{Profile.aspx => MyProfile.aspx} | 2 +- web/Views/Account/RegistrationPending.aspx | 2 +- web/Views/Home/AssemblyInfo.aspx | 2 +- web/Web.config | 72 +++++++------ web/Web.csproj | 22 ++-- web/favicon.png | Bin 3295 -> 3460 bytes web/templates/Estim.cs | 4 +- web/web.config | 3 - yavscModel/Blogs/BlogManager.cs | 10 ++ .../BlogProvidersConfigurationSection.cs | 3 +- yavscModel/FrontOffice/Basket.cs | 6 ++ yavscModel/FrontOffice/Catalog/Brand.cs | 35 ++++++- yavscModel/FrontOffice/Commande.cs | 28 ++++- yavscModel/Google/GoogleErrorMessage.cs | 33 +++++- .../RolesAndMemebers/ChangePasswordModel.cs | 19 ++++ 31 files changed, 250 insertions(+), 238 deletions(-) delete mode 100644 web/MvcActionValueBinder.cs rename web/Views/Account/{Profile.aspx => MyProfile.aspx} (97%) delete mode 100644 web/web.config diff --git a/web/Controllers/AccountController.cs b/web/Controllers/AccountController.cs index bd471159..5d0bdfed 100644 --- a/web/Controllers/AccountController.cs +++ b/web/Controllers/AccountController.cs @@ -255,7 +255,7 @@ namespace Yavsc.Controllers /// Model. [Authorize] [HttpGet] - public ActionResult Profile (Profile model) + public ActionResult MyProfile (Profile model) { string username = Membership.GetUser ().UserName; ViewData ["UserName"] = username; @@ -272,7 +272,7 @@ namespace Yavsc.Controllers [Authorize] [HttpPost] // ASSERT("Membership.GetUser ().UserName is made of simple characters, no slash nor backslash" - public ActionResult Profile (Profile model, HttpPostedFileBase AvatarFile) + public ActionResult MyProfile (Profile model, HttpPostedFileBase AvatarFile) { string username = Membership.GetUser ().UserName; ViewData ["UserName"] = username; diff --git a/web/Controllers/BasketController.cs b/web/Controllers/BasketController.cs index 93c7bc27..0dff26a7 100644 --- a/web/Controllers/BasketController.cs +++ b/web/Controllers/BasketController.cs @@ -21,6 +21,7 @@ namespace Yavsc.ApiControllers /// The wfmgr. /// protected WorkFlowManager wfmgr = null; + /// /// Initialize the specified controllerContext. /// @@ -78,10 +79,7 @@ namespace Yavsc.ApiControllers [AcceptVerbs("POST")] public void Post(long itemId) { - throw new NotImplementedException (); } - - } } \ No newline at end of file diff --git a/web/Controllers/BlogsApiController.cs b/web/Controllers/BlogsApiController.cs index 04620933..d7da2cda 100644 --- a/web/Controllers/BlogsApiController.cs +++ b/web/Controllers/BlogsApiController.cs @@ -51,16 +51,7 @@ namespace Yavsc.ApiControllers /// /// User. /// Title. - public static void RemovePost(string user, string title) { - if (!Roles.IsUserInRole ("Admin")) { - string rguser = Membership.GetUser ().UserName; - if (rguser != user) { - throw new AccessViolationException ( - string.Format ( - "Vous n'avez pas le droit de suprimer des billets du Blog de {0}", - user)); - } - } + public void RemovePost(string user, string title) { BlogEntry e = BlogManager.GetPost (user, title); if (e == null) { throw new KeyNotFoundException ( diff --git a/web/Controllers/BlogsController.cs b/web/Controllers/BlogsController.cs index 2c0ec793..92c6c375 100644 --- a/web/Controllers/BlogsController.cs +++ b/web/Controllers/BlogsController.cs @@ -342,7 +342,7 @@ namespace Yavsc.Controllers ViewData["returnUrl"]=returnUrl; if (!confirm) return View ("RemovePost"); - BlogsApiController.RemovePost (user,title); + BlogManager.RemovePost (user,title); if (returnUrl == null) RedirectToAction ("Index",new { user = user }); return Redirect (returnUrl); diff --git a/web/Controllers/GoogleController.cs b/web/Controllers/GoogleController.cs index 2f1d4cfc..c1969777 100644 --- a/web/Controllers/GoogleController.cs +++ b/web/Controllers/GoogleController.cs @@ -241,10 +241,9 @@ namespace Yavsc.Controllers }); } string cred = OAuth2.GetFreshGoogleCredential (HttpContext.Profile); - string json; + CalendarApi c = new CalendarApi (); - CalendarList cl = c.GetCalendars (cred, out json); - ViewData ["json"] = json; + CalendarList cl = c.GetCalendars (cred); ViewData ["returnUrl"] = returnUrl; return View (cl); } @@ -254,6 +253,7 @@ namespace Yavsc.Controllers /// /// The calendar. /// Calchoice. + /// return Url. [HttpPost] [Authorize] public ActionResult SetCalendar (string calchoice,string returnUrl) @@ -318,9 +318,8 @@ namespace Yavsc.Controllers CalendarApi c = new CalendarApi (); CalendarEntryList res; - string responseStr; try { - res = c.GetCalendar (calid, mindate, maxdate, upr, out responseStr); + res = c.GetCalendar (calid, mindate, maxdate, upr); } catch (GoogleErrorException ex) { ViewData ["Title"] = ex.Title; ViewData ["Content"] = ex.Content; diff --git a/web/Controllers/WorkFlowController.cs b/web/Controllers/WorkFlowController.cs index 5f27af4b..ed26a126 100644 --- a/web/Controllers/WorkFlowController.cs +++ b/web/Controllers/WorkFlowController.cs @@ -1,14 +1,14 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Net.Http; using System.Web; +using System.Web.Security; using WorkFlowProvider; using Yavsc.Model.WorkFlow; -using System.Web.Http.Controllers; -using System.Web.Security; -using System.Web.Http.ModelBinding; -using System.Net.Http; using System.Web.Http; +using System.Web.Http.Controllers; +using System.Web.Http.ModelBinding; namespace Yavsc.ApiControllers { diff --git a/web/Formatters/EstimToPdfFormatter.cs b/web/Formatters/EstimToPdfFormatter.cs index 3d058e67..72637b7d 100644 --- a/web/Formatters/EstimToPdfFormatter.cs +++ b/web/Formatters/EstimToPdfFormatter.cs @@ -20,14 +20,15 @@ // along with this program. If not, see . using System; using System.Collections.Generic; -using System.IO; -using System.Net.Http.Headers; -using System.Net.Http.Formatting; -using Yavsc.Model.WorkFlow; -using Yavsc.Model.RolesAndMembers; -using System.Web.Profile; -using System.Web; using System.Diagnostics; +using System.IO; +using System.Net.Http; +using System.Net.Http.Formatting; +using System.Net.Http.Headers; +using System.Web; +using System.Web.Profile; +using Yavsc.Model.RolesAndMembers; +using Yavsc.Model.WorkFlow; namespace Yavsc.Formatters { @@ -69,8 +70,9 @@ namespace Yavsc.Formatters return enumerableType.IsAssignableFrom(type); } } + /// - /// Writes to stream. + /// Writes synchronously to the buffered stream. /// /// Type. /// Value. @@ -97,7 +99,7 @@ namespace Yavsc.Formatters tmpe.Session.Add ("to", prcli); tmpe.Init (); - string content = tmpe.TransformText (); + string contentStr = tmpe.TransformText (); string name = string.Format ("tmpestimtex-{0}", e.Id); string fullname = Path.Combine ( @@ -106,7 +108,7 @@ namespace Yavsc.Formatters FileInfo fo = new FileInfo(fullname + ".pdf"); using (StreamWriter sw = new StreamWriter (fi.FullName)) { - sw.Write (content); + sw.Write (contentStr); } using (Process p = new Process ()) { p.StartInfo.WorkingDirectory = HttpRuntime.CodegenDir; @@ -129,8 +131,10 @@ namespace Yavsc.Formatters } fi.Delete(); fo.Delete(); + } + } } diff --git a/web/Formatters/RssFeedsFormatter.cs b/web/Formatters/RssFeedsFormatter.cs index 56983bf8..04f63e3f 100644 --- a/web/Formatters/RssFeedsFormatter.cs +++ b/web/Formatters/RssFeedsFormatter.cs @@ -48,7 +48,7 @@ namespace Yavsc.Formatters private const string dateformat = "ddd, dd MMM yyyy HH:mm:ss K"; /// - /// Writes to stream. + /// Writes synchronously to the buffered stream. /// /// Type. /// Value. diff --git a/web/Formatters/TexToPdfFormatter.cs b/web/Formatters/TexToPdfFormatter.cs index 71c18733..5f92be6c 100644 --- a/web/Formatters/TexToPdfFormatter.cs +++ b/web/Formatters/TexToPdfFormatter.cs @@ -25,9 +25,13 @@ using System.Collections.Generic; using System.IO; using System.Web; using System.Diagnostics; +using System.Net.Http; namespace Yavsc.Formatters { + /// + /// Tex to pdf formatter. + /// public class TexToPdfFormatter: BufferedMediaTypeFormatter { /// @@ -73,7 +77,7 @@ namespace Yavsc.Formatters public override void WriteToStream (Type type, object value, Stream stream, HttpContentHeaders contentHeaders) { - string content = value as string; + string cntStr = value as string; string name = "tmpdoc-"+Guid.NewGuid().ToString(); string fullname = Path.Combine ( HttpRuntime.CodegenDir, name); @@ -81,7 +85,7 @@ namespace Yavsc.Formatters FileInfo fo = new FileInfo(fullname + ".pdf"); using (StreamWriter sw = new StreamWriter (fi.FullName)) { - sw.Write (content); + sw.Write (cntStr); } using (Process p = new Process ()) { p.StartInfo.WorkingDirectory = HttpRuntime.CodegenDir; diff --git a/web/Global.asax.cs b/web/Global.asax.cs index c840fb65..8fd9f0f1 100644 --- a/web/Global.asax.cs +++ b/web/Global.asax.cs @@ -6,9 +6,9 @@ using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; -using System.Web.Http; using Yavsc.Formatters; using Yavsc.Model.FrontOffice; +using System.Web.Http; namespace Yavsc { @@ -49,17 +49,18 @@ namespace Yavsc new { controller = "Blogs", action = "Index", user=UrlParameter.Optional, title = UrlParameter.Optional } ); } + /// - /// Applications the start. + /// Starts the Application. /// protected void Application_Start () { AreaRegistration.RegisterAllAreas (); GlobalConfiguration.Configuration.Routes.MapHttpRoute( - name: "DefaultApi", + name: "DefaultApi", routeTemplate: "api/{controller}/{action}/{*id}", defaults: new { controller = "WorkFlow", action="Index", id=0 } - ); + ); RegisterRoutes (RouteTable.Routes); } diff --git a/web/Helpers/BBCodeHelper.cs b/web/Helpers/BBCodeHelper.cs index d6d093c6..f16cc581 100644 --- a/web/Helpers/BBCodeHelper.cs +++ b/web/Helpers/BBCodeHelper.cs @@ -103,6 +103,9 @@ namespace Yavsc.Helpers /// public static void InitParser () { + // prevents a failure at second call + parent.Clear (); + BBTag urlBBTag = new BBTag ("url", "", "", true, true, UrlContentTransformer, new BBAttribute ("href", "",UrlAttributeTransformer), new BBAttribute ("href", "href",UrlAttributeTransformer)); BBTag bblist =new BBTag ("list", ""); @@ -177,12 +180,12 @@ namespace Yavsc.Helpers } ); // used to build the doc toc - parent.Clear (); parent.Add ("*", bblist); parent.Add ("sect3", bbs2); parent.Add ("sect2", bbs1); parent.Add ("sect1", bbdp); // + } /// /// Inits the document page. @@ -270,7 +273,7 @@ namespace Yavsc.Helpers static string UrlContentTransformer (string instr) { if (string.IsNullOrWhiteSpace (instr)) { - return urlValue; + return "<"+urlValue+">"; } else return instr; } diff --git a/web/Helpers/Google/CalendarApi.cs b/web/Helpers/Google/CalendarApi.cs index 1a02706f..2f21630f 100644 --- a/web/Helpers/Google/CalendarApi.cs +++ b/web/Helpers/Google/CalendarApi.cs @@ -28,6 +28,7 @@ using System.IO; using System.Text; using Newtonsoft.Json; using System.Web; +using System.Runtime.Serialization.Json; namespace Yavsc.Helpers.Google { @@ -60,8 +61,7 @@ namespace Yavsc.Helpers.Google /// /// The calendars. /// Cred. - /// Json. - public CalendarList GetCalendars (string cred, out string json) + public CalendarList GetCalendars (string cred) { CalendarList res = null; HttpWebRequest webreq = WebRequest.CreateHttp (getCalListUri); @@ -70,10 +70,7 @@ namespace Yavsc.Helpers.Google webreq.ContentType = "application/http"; using (WebResponse resp = webreq.GetResponse ()) { using (Stream respstream = resp.GetResponseStream ()) { - using (StreamReader readresp = new StreamReader (respstream, Encoding.UTF8)) { - json = readresp.ReadToEnd (); - res = JsonConvert.DeserializeObject (json); - } + res = (CalendarList) new DataContractJsonSerializer(typeof(CalendarList)).ReadObject (respstream); } resp.Close (); } @@ -89,8 +86,7 @@ namespace Yavsc.Helpers.Google /// Mindate. /// Maxdate. /// Upr. - /// Response string. - public CalendarEntryList GetCalendar (string calid, DateTime mindate, DateTime maxdate, ProfileBase upr, out string responseStr) + public CalendarEntryList GetCalendar (string calid, DateTime mindate, DateTime maxdate, ProfileBase upr) { string uri = string.Format ( getCalEntriesUri, HttpUtility.UrlEncode (calid)) + @@ -107,18 +103,14 @@ namespace Yavsc.Helpers.Google try { using (WebResponse resp = webreq.GetResponse ()) { using (Stream respstream = resp.GetResponseStream ()) { - using (StreamReader readresp = new StreamReader (respstream, Encoding.UTF8)) { - responseStr = readresp.ReadToEnd (); try { - res = JsonConvert.DeserializeObject (responseStr); - } catch (JsonReaderException ex) { + res = (CalendarEntryList) new DataContractJsonSerializer(typeof(CalendarEntryList)).ReadObject (respstream); + } catch (Exception ex) { respstream.Close (); resp.Close (); webreq.Abort (); - throw new GoogleErrorException(ex,responseStr); + throw new GoogleErrorException(ex); } - } - respstream.Close (); } resp.Close (); } diff --git a/web/Helpers/Google/OAuth2.cs b/web/Helpers/Google/OAuth2.cs index 5bd260c5..22b4a937 100644 --- a/web/Helpers/Google/OAuth2.cs +++ b/web/Helpers/Google/OAuth2.cs @@ -27,6 +27,7 @@ using Yavsc.Model.Google; using System.Web.Profile; using System.Web; using Yavsc.Model; +using System.Runtime.Serialization.Json; namespace Yavsc.Helpers.Google { @@ -45,16 +46,14 @@ namespace Yavsc.Helpers.Google public static People GetMe (AuthToken gat) { People me; + DataContractJsonSerializer ppser = new DataContractJsonSerializer (typeof(People)); HttpWebRequest webreppro = WebRequest.CreateHttp (getPeopleUri + "/me"); webreppro.ContentType = "application/http"; webreppro.Headers.Add (HttpRequestHeader.Authorization, gat.token_type + " " + gat.access_token); webreppro.Method = "GET"; using (WebResponse proresp = webreppro.GetResponse ()) { using (Stream prresponseStream = proresp.GetResponseStream ()) { - using (StreamReader readproresp = new StreamReader (prresponseStream, Encoding.UTF8)) { - string prresponseStr = readproresp.ReadToEnd (); - me = JsonConvert.DeserializeObject (prresponseStr); - } + me = (People) ppser.ReadObject (prresponseStream); prresponseStream.Close (); } proresp.Close (); @@ -189,11 +188,7 @@ namespace Yavsc.Helpers.Google AuthToken gat = null; using (WebResponse response = webreq.GetResponse ()) { using (Stream responseStream = response.GetResponseStream ()) { - using (StreamReader readStream = new StreamReader (responseStream, Encoding.UTF8)) { - string responseStr = readStream.ReadToEnd (); - gat = JsonConvert.DeserializeObject (responseStr); - readStream.Close (); - } + gat = (AuthToken) new DataContractJsonSerializer(typeof(AuthToken)).ReadObject (responseStream); responseStream.Close (); } response.Close (); diff --git a/web/Helpers/SimpleJsonPostMethod.cs b/web/Helpers/SimpleJsonPostMethod.cs index 7a521efa..c608bd46 100644 --- a/web/Helpers/SimpleJsonPostMethod.cs +++ b/web/Helpers/SimpleJsonPostMethod.cs @@ -22,7 +22,7 @@ using System; using System.Net; using System.Text; using System.IO; -using Newtonsoft.Json; +using System.Runtime.Serialization.Json; namespace Yavsc.Helpers { @@ -74,23 +74,18 @@ namespace Yavsc.Helpers /// Query. public TAnswer Invoke(TQuery query) { - Byte[] bytes = System.Text.Encoding.UTF8.GetBytes ( - JsonConvert.SerializeObject(query)); - Request.ContentLength = bytes.Length; - using (Stream dataStream = Request.GetRequestStream ()) { - dataStream.Write (bytes, 0, bytes.Length); - dataStream.Close (); + DataContractJsonSerializer serquery = new DataContractJsonSerializer (typeof(TQuery)); + DataContractJsonSerializer seransw = new DataContractJsonSerializer (typeof(TAnswer)); + + using (MemoryStream streamQuery = new MemoryStream ()) { + serquery.WriteObject (streamQuery, query); } + TAnswer ans = default (TAnswer); using (WebResponse response = Request.GetResponse ()) { using (Stream responseStream = response.GetResponseStream ()) { - using (StreamReader readStream = new StreamReader (responseStream, Encoding.UTF8)) { - string responseStr = readStream.ReadToEnd (); - ans = JsonConvert.DeserializeObject (responseStr); - readStream.Close (); - } - responseStream.Close (); + ans = (TAnswer) seransw.ReadObject(responseStream); } response.Close(); } diff --git a/web/Models/App.master b/web/Models/App.master index aa7de13a..7c5db7f0 100644 --- a/web/Models/App.master +++ b/web/Models/App.master @@ -11,7 +11,7 @@ - + @@ -52,12 +52,12 @@ Page d'accueil <%= Html.ActionLink("Login", "Login", "Account", new { returnUrl=Request.Url.PathAndQuery }, new { @class="actionlink" } ) %> Pour pouvoir poster ou commenter - ?returnUrl=<%=Request.Url.PathAndQuery%>" class="actionlink"> + ?returnUrl=<%=ViewData["returnUrl"]==null?Request.Url.PathAndQuery:(string)ViewData["returnUrl"]%>" class="actionlink"> Google sign in S'authentifier avec son compte Google+ <% } else { %> - <%= Html.ActionLink(HttpContext.Current.User.Identity.Name, "Profile", "Account", null, new { @class="actionlink" }) %> + <%= Html.ActionLink(HttpContext.Current.User.Identity.Name, "MyProfile", "Account", null, new { @class="actionlink" }) %> Édition de votre profile @ <%= Html.ActionLink( YavscHelpers.SiteName, "Index", "Home" ,null, new { @class="actionlink" }) %> Page d'accueil diff --git a/web/MvcActionValueBinder.cs b/web/MvcActionValueBinder.cs deleted file mode 100644 index 83e19df7..00000000 --- a/web/MvcActionValueBinder.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Globalization; -using System.Linq; -using System.Net.Http; -using System.Net.Http.Formatting; -using System.Threading; -using System.Threading.Tasks; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.ModelBinding; -using System.Web.Http.ValueProviders; -using System.Web.Http.ValueProviders.Providers; - -namespace Basic -{ - // Binder with MVC semantics. Treat the body as KeyValue pairs and model bind it. - /// - /// Mvc action value binder. - /// - public class MvcActionValueBinder : DefaultActionValueBinder - { - // Per-request storage, uses the Request.Properties bag. We need a unique key into the bag. - private const string Key = "5DC187FB-BFA0-462A-AB93-9E8036871EC8"; - - /// - /// Gets the binding. - /// - /// The binding. - /// Action descriptor. - public override HttpActionBinding GetBinding (HttpActionDescriptor actionDescriptor) - { - - HttpActionBinding actionBinding = new HttpActionBinding (); - - HttpParameterDescriptor[] parameters = actionDescriptor.GetParameters ().ToArray (); - HttpParameterBinding[] binders = Array.ConvertAll (parameters, p => DetermineBinding (actionBinding, p)); - - actionBinding.ParameterBindings = binders; - return actionBinding; - } - - private HttpParameterBinding DetermineBinding (HttpActionBinding actionBinding, HttpParameterDescriptor parameter) - { - HttpConfiguration config = parameter.Configuration; - - var attr = new ModelBinderAttribute(); // use default settings - - ModelBinderProvider provider = attr.GetModelBinderProvider(config); - - // Alternatively, we could put this ValueProviderFactory in the global config. - List vpfs = new List(attr.GetValueProviderFactories(config)); - vpfs.Add(new BodyValueProviderFactory()); - //vpfs.Add (new RouteDataValueProviderFactory ()); - return new ModelBinderParameterBinding(parameter, provider, vpfs); - } - - // Derive from ActionBinding so that we have a chance to read the body once and then share that with all the parameters. - private class MvcActionBinding : HttpActionBinding - { - // Read the body upfront , add as a ValueProvider - public override Task ExecuteBindingAsync (HttpActionContext actionContext, CancellationToken cancellationToken) - { - HttpRequestMessage request = actionContext.ControllerContext.Request; - HttpContent content = request.Content; - if (content != null) { - // content.ReadAsStreamAsync ().Result; - FormDataCollection fd = content.ReadAsAsync ().Result; - if (fd != null) { - - NameValueCollection nvc = fd.ReadAsNameValueCollection (); - - System.Web.Http.ValueProviders.IValueProvider vp = new System.Web.Http.ValueProviders.Providers.NameValueCollectionValueProvider (nvc, CultureInfo.InvariantCulture); - - request.Properties.Add (Key, vp); - } - } - - return base.ExecuteBindingAsync (actionContext, cancellationToken); - } - } - // Get a value provider over the body. This can be shared by all parameters. - // This gets the values computed in MvcActionBinding. - private class BodyValueProviderFactory : System.Web.Http.ValueProviders.ValueProviderFactory - { - public override System.Web.Http.ValueProviders.IValueProvider GetValueProvider (HttpActionContext actionContext) - { - object vp; - actionContext.Request.Properties.TryGetValue (Key, out vp); - return (System.Web.Http.ValueProviders.IValueProvider)vp; // can be null - } - } - } -} - - diff --git a/web/Views/Account/Profile.aspx b/web/Views/Account/MyProfile.aspx similarity index 97% rename from web/Views/Account/Profile.aspx rename to web/Views/Account/MyProfile.aspx index fa9ea1cc..4cbc9534 100644 --- a/web/Views/Account/Profile.aspx +++ b/web/Views/Account/MyProfile.aspx @@ -11,7 +11,7 @@ table.layout { border-width: 0; } table.layout TR TD { max-width:40%; } <%= Html.ValidationSummary() %> -<% using(Html.BeginForm("Profile", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) %> +<% using(Html.BeginForm("MyProfile", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) %> <% { %>
Informations générales diff --git a/web/Views/Account/RegistrationPending.aspx b/web/Views/Account/RegistrationPending.aspx index 4cb3accf..f5e01246 100644 --- a/web/Views/Account/RegistrationPending.aspx +++ b/web/Views/Account/RegistrationPending.aspx @@ -8,6 +8,6 @@ a été créé, un e-mail de validation de votre compte a été envoyé a l'adre Vous devriez le recevoir rapidement.
Pour valider votre compte, suivez le lien indiqué dans cet e-mail. diff --git a/web/Views/Home/AssemblyInfo.aspx b/web/Views/Home/AssemblyInfo.aspx index f8135996..5c43f73f 100644 --- a/web/Views/Home/AssemblyInfo.aspx +++ b/web/Views/Home/AssemblyInfo.aspx @@ -4,7 +4,7 @@ Running assembly : <%= GetType().Assembly.FullName %>

-Assemblies referenced by the controllers : +Assemblies referenced in this application :

    <% foreach (System.Reflection.AssemblyName item in Model) { %>
  • <%= item.FullName %>
  • diff --git a/web/Web.config b/web/Web.config index 74f6228c..104ebd03 100644 --- a/web/Web.config +++ b/web/Web.config @@ -28,27 +28,6 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
    - - - - - - - - - - - - - + + @@ -73,26 +53,26 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx - - - + + + + + - - - + + + + - - + + @@ -103,6 +83,8 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx + + @@ -117,7 +99,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx - + @@ -302,4 +284,26 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/web/Web.csproj b/web/Web.csproj index 8b266c26..790a1408 100644 --- a/web/Web.csproj +++ b/web/Web.csproj @@ -53,7 +53,6 @@ - @@ -86,15 +85,23 @@ - - - - - + + + + ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + + + + ..\packages\PayPalCoreSDK.1.6.0\lib\net451\PayPalCoreSDK.dll + + + + + @@ -152,7 +159,6 @@ - @@ -211,7 +217,6 @@ - @@ -666,6 +671,7 @@ + diff --git a/web/favicon.png b/web/favicon.png index 1abcbea63ae3cd46cb20cb8ee8bc7b2b509c6de4..440d3a249910ea16811f3cee353cebbe1102742f 100644 GIT binary patch delta 3457 zcmV-{4Sw?98H5{l2P-9FCYH67iF+@IRp_5Hv`kv)5Fs0mn6W5R0Dq|ym){L;8NgiBY!fda6TkqF};gN;PyRPycnq# zBi1v@+2#)EgJB^s3wS(Bo8T7sHSmRmy0yR!z>|gj9fJ|61NIM)Iu-8DGLa(0NUa#T z0r(JjT8!+I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fZ;1WRU zp71GKWvC>b?NwsyS3h0APGGxV1P}57fkEmY9RCaWR^`=uqK>*VZB$CadP4~b`+)!R zi{NQKfH0Ic_SKH|)_B{N#v*m_Uf{Hqo8STpD4>7>3Mim}0tzUgfC36Apnw7jDByjC Z{|D8gEde*ggVz86002ovPDHLkV1iwsQFs6V diff --git a/web/templates/Estim.cs b/web/templates/Estim.cs index 2058b477..ad7a2a4c 100644 --- a/web/templates/Estim.cs +++ b/web/templates/Estim.cs @@ -553,7 +553,9 @@ namespace Yavsc.templates { #line hidden return this.GenerationEnvironment.ToString(); } - + /// + /// Initialize this instance. + /// public virtual void Initialize() { if ((this.Errors.HasErrors == false)) { bool _estimAcquired = false; diff --git a/web/web.config b/web/web.config deleted file mode 100644 index 67113e62..00000000 --- a/web/web.config +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/yavscModel/Blogs/BlogManager.cs b/yavscModel/Blogs/BlogManager.cs index 08633862..052d76ea 100644 --- a/yavscModel/Blogs/BlogManager.cs +++ b/yavscModel/Blogs/BlogManager.cs @@ -2,6 +2,7 @@ using System; using Yavsc.Model.Blogs; using Yavsc.Model.RolesAndMembers; using System.Web; +using System.Web.Security; namespace Yavsc.Model.Blogs @@ -49,6 +50,15 @@ namespace Yavsc.Model.Blogs } public static void RemovePost (string username, string title) { + if (!Roles.IsUserInRole ("Admin")) { + string rguser = Membership.GetUser ().UserName; + if (rguser != username) { + throw new AccessViolationException ( + string.Format ( + "{1}, Vous n'avez pas le droit de suprimer des billets du Blog de {0}", + username,rguser)); + } + } Provider.RemovePost (username, title); } public static BlogEntryCollection LastPosts (int pageIndex, int pageSize, out int totalRecords) diff --git a/yavscModel/Blogs/Configuration/BlogProvidersConfigurationSection.cs b/yavscModel/Blogs/Configuration/BlogProvidersConfigurationSection.cs index 259706aa..cc4a0c7a 100644 --- a/yavscModel/Blogs/Configuration/BlogProvidersConfigurationSection.cs +++ b/yavscModel/Blogs/Configuration/BlogProvidersConfigurationSection.cs @@ -16,13 +16,12 @@ namespace Yavsc.Model.Blogs.Configuration set { this["defaultProvider"] = value; } } - - [ConfigurationProperty("providers")] [ConfigurationCollection(typeof(BlogProvidersConfigurationCollection), AddItemName = "add", ClearItemsName = "clear", RemoveItemName = "remove")] + /// /// Gets or sets the providers. /// diff --git a/yavscModel/FrontOffice/Basket.cs b/yavscModel/FrontOffice/Basket.cs index 23f8d79d..1d8be19b 100644 --- a/yavscModel/FrontOffice/Basket.cs +++ b/yavscModel/FrontOffice/Basket.cs @@ -24,8 +24,14 @@ using Yavsc.Model.WorkFlow; namespace Yavsc.Model.FrontOffice { + /// + /// Basket. + /// public class Basket: List { + /// + /// Initializes a new instance of the class. + /// public Basket () { } diff --git a/yavscModel/FrontOffice/Catalog/Brand.cs b/yavscModel/FrontOffice/Catalog/Brand.cs index 470a7bcf..e2fe27ba 100644 --- a/yavscModel/FrontOffice/Catalog/Brand.cs +++ b/yavscModel/FrontOffice/Catalog/Brand.cs @@ -3,19 +3,41 @@ using System.ComponentModel.DataAnnotations; namespace Yavsc.Model.FrontOffice { + /// + /// Brand. + /// public class Brand { + /// + /// Initializes a new instance of the class. + /// public Brand () { } - + + /// + /// Gets or sets the name. + /// + /// The name. [Required] public string Name { get; set; } + /// + /// Gets or sets the slogan. + /// + /// The slogan. public string Slogan { get; set; } + /// + /// Gets or sets the logo. + /// + /// The logo. public ProductImage Logo { get; set; } + /// + /// Gets or sets the categories. + /// + /// The categories. public ProductCategory[] Categories { get; set; } /// /// Gets or sets the default form. @@ -23,10 +45,21 @@ namespace Yavsc.Model.FrontOffice /// The default form. public SaleForm DefaultForm { get; set; } + /// + /// Gets the product category. + /// + /// The product category. + /// Reference. public ProductCategory GetProductCategory(string reference) { return Array.Find(Categories, c => c.Reference == reference); } + + /// + /// Gets the name of the product category by. + /// + /// The product category by name. + /// Cat name. public ProductCategory GetProductCategoryByName(string catName) { return Array.Find(Categories, c => c.Name == catName); diff --git a/yavscModel/FrontOffice/Commande.cs b/yavscModel/FrontOffice/Commande.cs index 4aa62c3e..a08bb116 100644 --- a/yavscModel/FrontOffice/Commande.cs +++ b/yavscModel/FrontOffice/Commande.cs @@ -7,17 +7,39 @@ using Newtonsoft.Json; namespace Yavsc.Model.FrontOffice { + /// + /// Commande. + /// public class Commande { + /// + /// Gets or sets the creation date. + /// + /// The creation date. public DateTime CreationDate { get; set; } + /// + /// Gets or sets the identifier. + /// + /// The identifier. public long Id { get; set; } + /// + /// Gets or sets the prod reference. + /// + /// The prod reference. public string ProdRef { get; set; } - + /// + /// The parameters. + /// public StringDictionary Parameters = new StringDictionary(); - + /// + /// Initializes a new instance of the class. + /// public Commande() { } - + /// + /// Create the specified collection. + /// + /// Collection. public static Commande Create(NameValueCollection collection) { Commande cmd = new Commande (); diff --git a/yavscModel/Google/GoogleErrorMessage.cs b/yavscModel/Google/GoogleErrorMessage.cs index 48ef7dfd..b28ee77e 100644 --- a/yavscModel/Google/GoogleErrorMessage.cs +++ b/yavscModel/Google/GoogleErrorMessage.cs @@ -25,11 +25,25 @@ using Newtonsoft.Json; namespace Yavsc.Model.Google { + /// + /// Google error exception. + /// public class GoogleErrorException : Exception { + /// + /// Gets or sets the title. + /// + /// The title. public string Title { get; set; } + /// + /// Gets or sets the content. + /// + /// The content. public string Content { get; set; } - + /// + /// Initializes a new instance of the class. + /// + /// Ex. public GoogleErrorException (WebException ex) { // ASSERT ex != null; Title = ex.Message; @@ -40,10 +54,25 @@ namespace Yavsc.Model.Google Content = reader.ReadToEnd(); } } - public GoogleErrorException(JsonReaderException ex, string message) { + /// + /// Initializes a new instance of the class. + /// + /// Ex. + /// Message. + [Obsolete] + public GoogleErrorException(Exception ex, string message) { Content = message; Title = ex.Message; } + /// + /// Initializes a new instance of the class. + /// + /// Ex. + [Obsolete] + public GoogleErrorException(Exception ex) { + Content = ex.Message; + Title = ex.GetType().FullName; + } } } diff --git a/yavscModel/RolesAndMemebers/ChangePasswordModel.cs b/yavscModel/RolesAndMemebers/ChangePasswordModel.cs index b8d5d12a..30c60f7d 100644 --- a/yavscModel/RolesAndMemebers/ChangePasswordModel.cs +++ b/yavscModel/RolesAndMemebers/ChangePasswordModel.cs @@ -3,17 +3,36 @@ using System.ComponentModel.DataAnnotations; namespace Yavsc.Model.RolesAndMembers { + /// + /// Change password model. + /// public class ChangePasswordModel { + /// + /// Gets or sets the username. + /// + /// The username. [Required(ErrorMessage = "Please enter a Username")] public string Username { get; set; } + /// + /// Gets or sets the old password. + /// + /// The old password. [Required(ErrorMessage = "Please your old Password")] public string OldPassword { get; set; } + /// + /// Gets or sets the new password. + /// + /// The new password. [Required(ErrorMessage = "Please enter a new Password")] public string NewPassword { get; set; } + /// + /// Gets or sets the confirm password. + /// + /// The confirm password. [Required(ErrorMessage = "Please confirm the new Password")] public string ConfirmPassword { get; set; }