diff --git a/NpgsqlContentProvider/ChangeLog b/NpgsqlContentProvider/ChangeLog index fe0a3d5b..dfc87981 100644 --- a/NpgsqlContentProvider/ChangeLog +++ b/NpgsqlContentProvider/ChangeLog @@ -1,3 +1,9 @@ +2015-06-18 Paul Schneider + + * NpgsqlCircleProvider.cs: Fixes the Circle creation + + * NpgsqlContentProvider.cs: code formatting + 2015-06-10 Paul Schneider * NpgsqlCircleProvider.cs: diff --git a/NpgsqlContentProvider/NpgsqlCircleProvider.cs b/NpgsqlContentProvider/NpgsqlCircleProvider.cs index 1240b592..19e1083f 100644 --- a/NpgsqlContentProvider/NpgsqlCircleProvider.cs +++ b/NpgsqlContentProvider/NpgsqlCircleProvider.cs @@ -25,6 +25,7 @@ using System.Configuration; using Npgsql; using NpgsqlTypes; using System.Collections.Generic; +using System.Web.Security; namespace WorkFlowProvider { @@ -140,7 +141,7 @@ namespace WorkFlowProvider cmd.Parameters.AddWithValue ("wnr", owner); cmd.Parameters.AddWithValue ("tit", title); cmd.Parameters.AddWithValue ("app", applicationName); - id = (long)cmd.ExecuteScalar (); + id = (long) cmd.ExecuteScalar (); } using (NpgsqlCommand cmd = cnx.CreateCommand ()) { cmd.CommandText = "insert into circle_members (circle_id,member) values (@cid,@mbr)"; @@ -148,14 +149,14 @@ namespace WorkFlowProvider cmd.Parameters.Add ("mbr", NpgsqlDbType.Varchar); cmd.Prepare (); foreach (string user in users) { - cmd.Parameters[1].Value = user; + object pkid = Membership.GetUser (user).ProviderUserKey; + cmd.Parameters[1].Value = pkid.ToString(); cmd.ExecuteNonQuery (); } } cnx.Close (); } - - throw new NotImplementedException (); + return id; } /// @@ -190,11 +191,15 @@ namespace WorkFlowProvider using (NpgsqlDataReader rdr = cmd.ExecuteReader ()) { if (rdr.HasRows) { cc = new CircleInfoCollection (); - while (rdr.Read ()) - cc.Add( - new CircleInfo ( - rdr.GetInt64 (0), - rdr.GetString (1))); + while (rdr.Read ()) { + string title = null; + int ottl = rdr.GetOrdinal ("title"); + if (!rdr.IsDBNull (ottl)) + title = rdr.GetString (ottl); + long id = (long) rdr.GetInt64 ( + rdr.GetOrdinal ("_id")); + cc.Add (new CircleInfo (id,title)); + } } rdr.Close (); } diff --git a/NpgsqlContentProvider/NpgsqlContentProvider.cs b/NpgsqlContentProvider/NpgsqlContentProvider.cs index 8d57ef72..82d5dc6e 100644 --- a/NpgsqlContentProvider/NpgsqlContentProvider.cs +++ b/NpgsqlContentProvider/NpgsqlContentProvider.cs @@ -538,7 +538,7 @@ namespace Yavsc cmd.Parameters.AddWithValue("@app", ApplicationName); cnx.Open (); Estimate created = new Estimate (); - created.Id = (long)cmd.ExecuteScalar (); + created.Id = (long) cmd.ExecuteScalar (); cnx.Close (); created.Title = title; created.Description = description; diff --git a/web/ApiControllers/AccountController.cs b/web/ApiControllers/AccountController.cs new file mode 100644 index 00000000..8eee577e --- /dev/null +++ b/web/ApiControllers/AccountController.cs @@ -0,0 +1,111 @@ +// +// AccountController.cs +// +// Author: +// Paul Schneider +// +// Copyright (c) 2015 GNU GPL +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +using System; +using System.Web.Http; +using System.Net.Http; +using Yavsc.Model.RolesAndMembers; +using System.Web.Security; +using System.Web.Profile; +using Yavsc.Helpers; +using System.Collections.Specialized; + +namespace Yavsc.ApiControllers +{ + public class AccountController : ApiController + { + + /// + /// Register the specified model. + /// + /// Model. + [Authorize()] + [ValidateAjaxAttribute] + public HttpResponseMessage Register ([FromBody] RegisterClientModel model) + { + if (ModelState.IsValid) { + if (model.IsApprouved) + if (!Roles.IsUserInRole ("Admin")) + if (!Roles.IsUserInRole ("FrontOffice")) { + ModelState.AddModelError ("Register", + "Since you're not member of Admin or FrontOffice groups, " + + "you cannot ask for a pre-approuved registration"); + return DefaultResponse (); + } + MembershipCreateStatus mcs; + var user = Membership.CreateUser ( + model.UserName, + model.Password, + model.Email, + null, + null, + model.IsApprouved, + out mcs); + switch (mcs) { + case MembershipCreateStatus.DuplicateEmail: + ModelState.AddModelError ("Email", "Cette adresse e-mail correspond " + + "à un compte utilisateur existant"); + break; + case MembershipCreateStatus.DuplicateUserName: + ModelState.AddModelError ("UserName", "Ce nom d'utilisateur est " + + "déjà enregistré"); + break; + case MembershipCreateStatus.Success: + if (!model.IsApprouved) + YavscHelpers.SendActivationMessage (user); + ProfileBase prtu = ProfileBase.Create (model.UserName); + prtu.SetPropertyValue("Name",model.Name); + prtu.SetPropertyValue("Address",model.Address); + prtu.SetPropertyValue("CityAndState",model.CityAndState); + prtu.SetPropertyValue("Mobile",model.Mobile); + prtu.SetPropertyValue("Phone",model.Phone); + prtu.SetPropertyValue("ZipCode",model.ZipCode); + break; + default: + break; + } + } + return DefaultResponse (); + } + + + private HttpResponseMessage DefaultResponse() + { + return ModelState.IsValid ? + Request.CreateResponse (System.Net.HttpStatusCode.OK) : + Request.CreateResponse (System.Net.HttpStatusCode.BadRequest, + ValidateAjaxAttribute.GetErrorModelObject (ModelState)); + } + + /// + /// Resets the password. + /// + /// Model. + [ValidateAjax] + public void ResetPassword(LostPasswordModel model) + { + StringDictionary errors; + YavscHelpers.ResetPassword (model, out errors); + foreach (string key in errors.Keys) + ModelState.AddModelError (key, errors [key]); + } + } +} + diff --git a/web/ApiControllers/BlogsController.cs b/web/ApiControllers/BlogsController.cs index d7da2cda..531dd03d 100644 --- a/web/ApiControllers/BlogsController.cs +++ b/web/ApiControllers/BlogsController.cs @@ -12,7 +12,7 @@ namespace Yavsc.ApiControllers /// /// Blogs API controller. /// - public class BlogsApiController : ApiController + public class BlogsController : ApiController { private const string adminRoleName = "Admin"; diff --git a/web/ApiControllers/CalendarController.cs b/web/ApiControllers/CalendarController.cs index a7ca4c8c..c672cf9b 100644 --- a/web/ApiControllers/CalendarController.cs +++ b/web/ApiControllers/CalendarController.cs @@ -34,7 +34,7 @@ namespace Yavsc.ApiControllers /// /// Night flash controller. /// - public class CalendarApiController: ApiController + public class CalendarController: ApiController { YaEvent[] getTestList() { @@ -160,7 +160,7 @@ namespace Yavsc.ApiControllers "déjà enregistré"); break; case MembershipCreateStatus.Success: - YavscHelpers.SendActivationEmail (user); + YavscHelpers.SendActivationMessage (user); // TODO set registration id throw new NotImplementedException (); } diff --git a/web/ApiControllers/CircleController.cs b/web/ApiControllers/CircleController.cs index a6932402..e61bb2f5 100644 --- a/web/ApiControllers/CircleController.cs +++ b/web/ApiControllers/CircleController.cs @@ -27,10 +27,15 @@ using System.Web.Security; namespace Yavsc.ApiControllers { + public class NewCircle { + public string title { get ; set; } + public string [] users { get ; set; } + } + /// /// Circle controller. /// - public class CircleApiController : ApiController + public class CircleController : ApiController { /// /// Creates the specified circle using the given title and user list. @@ -38,10 +43,10 @@ namespace Yavsc.ApiControllers /// Identifier. /// Users. [Authorize] - public long Create(string title, string [] users) + public long Create(NewCircle model) { string user = Membership.GetUser ().UserName; - return CircleManager.DefaultProvider.Create (user, title, users); + return CircleManager.DefaultProvider.Create (user, model.title, model.users); } /// diff --git a/web/ApiControllers/FrontOfficeController.cs b/web/ApiControllers/FrontOfficeController.cs index 6068763c..8b17a09b 100644 --- a/web/ApiControllers/FrontOfficeController.cs +++ b/web/ApiControllers/FrontOfficeController.cs @@ -164,66 +164,6 @@ namespace Yavsc.ApiControllers return result; } - private HttpResponseMessage DefaultResponse() - { - return ModelState.IsValid ? - Request.CreateResponse (System.Net.HttpStatusCode.OK) : - Request.CreateResponse (System.Net.HttpStatusCode.BadRequest, - ValidateAjaxAttribute.GetErrorModelObject (ModelState)); - } - - /// - /// Register the specified model. - /// - /// Model. - [Authorize()] - [ValidateAjaxAttribute] - public HttpResponseMessage Register ([FromBody] RegisterClientModel model) - { - if (ModelState.IsValid) { - if (model.IsApprouved) - if (!Roles.IsUserInRole ("Admin")) - if (!Roles.IsUserInRole ("FrontOffice")) { - ModelState.AddModelError ("Register", - "Since you're not member of Admin or FrontOffice groups, " + - "you cannot ask for a pre-approuved registration"); - return DefaultResponse (); - } - MembershipCreateStatus mcs; - var user = Membership.CreateUser ( - model.UserName, - model.Password, - model.Email, - null, - null, - model.IsApprouved, - out mcs); - switch (mcs) { - case MembershipCreateStatus.DuplicateEmail: - ModelState.AddModelError ("Email", "Cette adresse e-mail correspond " + - "à un compte utilisateur existant"); - break; - case MembershipCreateStatus.DuplicateUserName: - ModelState.AddModelError ("UserName", "Ce nom d'utilisateur est " + - "déjà enregistré"); - break; - case MembershipCreateStatus.Success: - if (!model.IsApprouved) - Yavsc.Helpers.YavscHelpers.SendActivationEmail (user); - ProfileBase prtu = ProfileBase.Create (model.UserName); - prtu.SetPropertyValue("Name",model.Name); - prtu.SetPropertyValue("Address",model.Address); - prtu.SetPropertyValue("CityAndState",model.CityAndState); - prtu.SetPropertyValue("Mobile",model.Mobile); - prtu.SetPropertyValue("Phone",model.Phone); - prtu.SetPropertyValue("ZipCode",model.ZipCode); - break; - default: - break; - } - } - return DefaultResponse (); - } } } diff --git a/web/ApiControllers/GCMController.cs b/web/ApiControllers/GCMController.cs new file mode 100644 index 00000000..69e992b8 --- /dev/null +++ b/web/ApiControllers/GCMController.cs @@ -0,0 +1,33 @@ +// +// GCMController.cs +// +// Author: +// Paul Schneider +// +// Copyright (c) 2015 GNU GPL +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +using System; +using System.Web.Http; + +namespace Yavsc.ApiControllers +{ + public class GCMController : ApiController + { + public GCMController () + { + } + } +} + diff --git a/web/ApiControllers/PaypalApiController.cs b/web/ApiControllers/PaypalApiController.cs index 233ca785..07841a2d 100644 --- a/web/ApiControllers/PaypalApiController.cs +++ b/web/ApiControllers/PaypalApiController.cs @@ -21,7 +21,7 @@ using System; using System.Web.Http; -#if HASPAYPALAPI +#if USEPAYPALAPI using PayPal.Api; diff --git a/web/ApiControllers/WorkFlowController.cs b/web/ApiControllers/WorkFlowController.cs index 872dc15c..8b7f8e4a 100644 --- a/web/ApiControllers/WorkFlowController.cs +++ b/web/ApiControllers/WorkFlowController.cs @@ -85,7 +85,7 @@ namespace Yavsc.ApiControllers return ; case MembershipCreateStatus.Success: if (!userModel.IsApprouved) - YavscHelpers.SendActivationEmail (user); + YavscHelpers.SendActivationMessage (user); return; default: throw new InvalidOperationException (string.Format("Unexpected user creation code :{0}",mcs)); diff --git a/web/ChangeLog b/web/ChangeLog index 95159c4d..8772fcec 100644 --- a/web/ChangeLog +++ b/web/ChangeLog @@ -1,3 +1,51 @@ +2015-06-18 Paul Schneider + + * AccountController.cs: Register and reset passord from Web + API + + * GCMController.cs: initial creation, will host GCM calls and + related procedures. + + * ResetPassword.aspx: Html view to resetr the password + + * BlogsController.cs: + * CircleController.cs: + * WorkFlowController.cs: + * PaypalApiController.cs: + * FrontOfficeController.cs: refactoring + + * Web.config: + * Web.csproj: + * CalendarController.cs: + + * AccountController.cs: Adds the way to reset the password + + * Global.asax.cs: + * AdminController.cs: code formatting + + * FrontOfficeController.cs: xml doc + + * T.cs: Make this class an helper to translation + + * YavscHelpers.cs: Implements the e-mail sending + + * style.css: style uniformization + + * Circles.aspx: Implements the Html interface to Circle + creation (modifications and deletions are still to implement) + + * Register.ascx: Allows the error display in case of lack of + power of the user at registering another user. + + + * Estimate.aspx: use the partial view to register from the + Account folder. + Cleans the useless reference to ~/Theme/dark/style.css, that + was for using the "tablesorter.js", no used anymore. + + + * Web.config: Trying to have all the Index pages to work... + 2015-06-12 Paul Schneider * AccountController.cs: Code formatting diff --git a/web/Controllers/AccountController.cs b/web/Controllers/AccountController.cs index c392f2d3..8c3cf61c 100644 --- a/web/Controllers/AccountController.cs +++ b/web/Controllers/AccountController.cs @@ -12,6 +12,7 @@ using Yavsc.Model.RolesAndMembers; using Yavsc.Helpers; using System.Web.Mvc; using Yavsc.Model.Circles; +using System.Collections.Specialized; namespace Yavsc.Controllers { @@ -108,7 +109,7 @@ namespace Yavsc.Controllers "déjà enregistré"); return View (model); case MembershipCreateStatus.Success: - YavscHelpers.SendActivationEmail (user); + YavscHelpers.SendActivationMessage (user); ViewData ["username"] = user.UserName; ViewData ["email"] = user.Email; return View ("RegistrationPending"); @@ -177,8 +178,8 @@ namespace Yavsc.Controllers // than return false in certain failure scenarios. bool changePasswordSucceeded = false; try { - var users = Membership.FindUsersByName (model.Username); - + MembershipUserCollection users = + Membership.FindUsersByName (model.Username); if (users.Count > 0) { MembershipUser user = Membership.GetUser (model.Username, true); @@ -299,6 +300,8 @@ namespace Yavsc.Controllers { string user = Membership.GetUser ().UserName; CircleInfoCollection cic = CircleManager.DefaultProvider.List (user); + if (cic == null) + cic = new CircleInfoCollection (); return View (cic); } /// @@ -312,6 +315,22 @@ namespace Yavsc.Controllers return Redirect (returnUrl); } + /// + /// Losts the password. + /// + /// The password. + /// Model. + public ActionResult ResetPassword(LostPasswordModel model) + { + if (Request.HttpMethod == "POST") { + StringDictionary errors; + YavscHelpers.ResetPassword (model, out errors); + foreach (string key in errors.Keys) + ModelState.AddModelError (key, errors [key]); + } + return View (model); + } + /// /// Validate the specified id and key. /// @@ -325,13 +344,19 @@ namespace Yavsc.Controllers ViewData ["Error"] = string.Format ("Cet utilisateur n'existe pas ({0})", id); } else if (u.ProviderUserKey.ToString () == key) { - u.IsApproved = true; - Membership.UpdateUser (u); - ViewData ["Message"] = - string.Format ("La création de votre compte ({0}) est validée.", id); + if (u.IsApproved) { + ViewData ["Message"] = + string.Format ("Votre compte ({0}) est déjà validé.", id); + } else { + u.IsApproved = true; + Membership.UpdateUser (u); + ViewData ["Message"] = + string.Format ("La création de votre compte ({0}) est validée.", id); + } } else ViewData ["Error"] = "La clé utilisée pour valider ce compte est incorrecte"; return View (); } + } } diff --git a/web/Controllers/AdminController.cs b/web/Controllers/AdminController.cs index 48913639..e6a21af0 100644 --- a/web/Controllers/AdminController.cs +++ b/web/Controllers/AdminController.cs @@ -260,7 +260,6 @@ namespace Yavsc.Controllers [Authorize()] public ActionResult Admin (NewAdminModel model) { - // ASSERT (Roles.RoleExists (adminRoleName)) string [] admins = Roles.GetUsersInRole (adminRoleName); string currentUser = Membership.GetUser ().UserName; diff --git a/web/Controllers/FrontOfficeController.cs b/web/Controllers/FrontOfficeController.cs index 9a5d08b7..496d3fae 100644 --- a/web/Controllers/FrontOfficeController.cs +++ b/web/Controllers/FrontOfficeController.cs @@ -44,6 +44,11 @@ namespace Yavsc.Controllers { return View (); } + /// + /// Pub the Event + /// + /// The pub. + /// Model. public ActionResult EventPub (EventPub model) { return View (model); diff --git a/web/Global.asax.cs b/web/Global.asax.cs index 55d0bcfc..8b77756e 100644 --- a/web/Global.asax.cs +++ b/web/Global.asax.cs @@ -1,5 +1,4 @@ - using System; using System.Collections.Generic; using System.Linq; @@ -108,6 +107,8 @@ namespace Yavsc ("AppStartExecuteCompleted", BindingFlags.NonPublic | BindingFlags.Static); ob.SetValue(null, true, null); + } } } + diff --git a/web/Helpers/T.cs b/web/Helpers/T.cs index e5cdd1da..01883b2a 100644 --- a/web/Helpers/T.cs +++ b/web/Helpers/T.cs @@ -15,8 +15,9 @@ namespace Yavsc.Helpers /// /// T. /// - public class T + public static class T { + /// /// Gets the string. /// @@ -27,5 +28,12 @@ namespace Yavsc.Helpers string tr = LocalizedText.ResourceManager.GetString (msg.Replace (" ", "_")); return tr==null?msg:tr; } + + public static string Translate(this HtmlHelper helper, string text) + { + // Just call the other one, to avoid having two copies (we don't use the HtmlHelper). + return GetString(text); + } + } } diff --git a/web/Helpers/YavscHelpers.cs b/web/Helpers/YavscHelpers.cs index 6d3175d1..c6594d61 100644 --- a/web/Helpers/YavscHelpers.cs +++ b/web/Helpers/YavscHelpers.cs @@ -5,6 +5,10 @@ using System.Web.Security; using System.IO; using System.Web.Configuration; using System.Net.Mail; +using System.Web.Http.ModelBinding; +using Yavsc.Model.RolesAndMembers; +using System.Collections.Generic; +using System.Collections.Specialized; namespace Yavsc.Helpers { @@ -13,8 +17,7 @@ namespace Yavsc.Helpers /// public static class YavscHelpers { - private static string registrationMessage = - WebConfigurationManager.AppSettings ["RegistrationMessage"]; + private static string siteName = null; @@ -43,10 +46,21 @@ namespace Yavsc.Helpers } /// - /// Sends the activation email. + /// Sends the activation message. /// /// User. - public static void SendActivationEmail(MembershipUser user) { + public static void SendActivationMessage(MembershipUser user) + { + SendEmail (WebConfigurationManager.AppSettings ["RegistrationMessage"], + user); + } + + /// + /// Sends the email. + /// + /// Registration message. + /// User. + public static void SendEmail(string registrationMessage, MembershipUser user) { FileInfo fi = new FileInfo ( HttpContext.Current.Server.MapPath (registrationMessage)); if (!fi.Exists) { @@ -79,6 +93,48 @@ namespace Yavsc.Helpers } } + /// + /// Resets the password. + /// + /// Model state. + /// Model. + public static void ResetPassword(LostPasswordModel model, out StringDictionary errors) + { + MembershipUserCollection users = null; + errors = new StringDictionary (); + + if (!string.IsNullOrEmpty (model.UserName)) { + users = + Membership.FindUsersByName (model.UserName); + if (users.Count < 1) { + errors.Add ("UserName", "User name not found"); + return ; + } + if (users.Count != 1) { + errors.Add ("UserName", "Found more than one user!(sic)"); + return ; + } + } + if (!string.IsNullOrEmpty (model.Email)) { + users = + Membership.FindUsersByEmail (model.Email); + if (users.Count < 1) { + errors.Add ( "Email", "Email not found"); + return ; + } + if (users.Count != 1) { + errors.Add ("Email", "Found more than one user!(sic)"); + return ; + } + } + if (users==null) + return; + // Assert users.Count == 1 + if (users.Count != 1) + throw new InvalidProgramException ("Emails and user's names are uniques, and we find more than one result here, aborting."); + foreach (MembershipUser u in users) + YavscHelpers.SendActivationMessage (u); + } } } diff --git a/web/Theme/style.css b/web/Theme/style.css index 7ce2f738..b7f9d25c 100644 --- a/web/Theme/style.css +++ b/web/Theme/style.css @@ -145,7 +145,7 @@ padding-left: 20px; } -input.actionlink, a.actionlink { +.actionlink { color: #B0B080; border: solid 1px rgb(128,128,128); border-radius:5px; @@ -155,9 +155,17 @@ input.actionlink, a.actionlink { font-family: 'Arial', cursive; } + input, select { + color: #B0B080; + border: solid 1px rgb(128,128,128); + border-radius:5px; + background-color:rgba(0,0,32,0.8); + font-family: 'Arial', cursive; +} + a.actionlink img { top:4px; } -input.actionlink:hover, a.actionlink:hover { +.actionlink:hover { background-color:rgba(30,0,124,0.9); border : solid 1px white; text-decoration: underline; diff --git a/web/Views/Account/Circles.aspx b/web/Views/Account/Circles.aspx index 5d3ff68c..2a7cf680 100644 --- a/web/Views/Account/Circles.aspx +++ b/web/Views/Account/Circles.aspx @@ -1,18 +1,179 @@ -<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %> - - +<%@ Page Title="Circles" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %> +<%@ Register Assembly="Yavsc.WebControls" TagPrefix="yavsc" Namespace="Yavsc.WebControls" %> + -<% if (Model==null) { %> -No circle yet -<% } else { %> -<% foreach (CircleInfo ci in Model) { %> - <%= ci.Title %> - <%= ci.Id %> -
-<% }} %> + + + + + + + +<% int lc=0; + foreach (CircleInfo ci in Model) { lc++; %> +row" id="c_<%=ci.Id%>"> + + + +<% } %> + +
<%=Html.Translate("Title")%>
<%=ci.Title%> + " class="actionlink rowbtnrm"/> + " class="actionlink rowbtnvw"/> +
+
+ + +
+
+Nouveau cercle + + + + + + + + + + + + +
<%=Html.Translate("Members")%> + + + + + +
+" class="actionlink rowbtnct" /> +
+
+
diff --git a/web/Views/Account/Register.ascx b/web/Views/Account/Register.ascx index 7b124ea5..d0d0f61c 100644 --- a/web/Views/Account/Register.ascx +++ b/web/Views/Account/Register.ascx @@ -3,6 +3,7 @@ <% using(Html.BeginForm("Register")) %> <% { %>

Nouvel utilisateur

+*
diff --git a/web/Views/Account/ResetPassword.aspx b/web/Views/Account/ResetPassword.aspx new file mode 100644 index 00000000..7970c614 --- /dev/null +++ b/web/Views/Account/ResetPassword.aspx @@ -0,0 +1,23 @@ +<%@ Page Title="Reset your Password" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %> + +<%= Html.ValidationSummary("Modification de mot de passe") %> + +<% using(Html.BeginForm("ResetPassword", "Account")) { %> +Enter one of the following :
+
  • + +<%= Html.TextBox( "UserName" ) %> +<%= Html.ValidationMessage("UserName", "*") %>
  • +
  • + +<%= Html.TextBox( "Email" ) %> +<%= Html.ValidationMessage("Email", "*") %> +
  • +
+Then, hit the following button: +
+A message will be sent to you, containning a link that you'll can use to reset your password. +<% } %> +
+ + diff --git a/web/Views/FrontOffice/Estimate.aspx b/web/Views/FrontOffice/Estimate.aspx index 9ce9f703..d850b336 100644 --- a/web/Views/FrontOffice/Estimate.aspx +++ b/web/Views/FrontOffice/Estimate.aspx @@ -7,11 +7,11 @@ $(function(){ $("#tbwrts").stupidtable(); }); -" type="text/css" media="print, projection, screen" /> <%= Html.ValidationSummary("Devis") %> + <% using (Html.BeginForm("Estimate","FrontOffice")) { %> <%= Html.LabelFor(model => model.Title) %>:<%= Html.TextBox( "Title" ) %> <%= Html.ValidationMessage("Title", "*") %> @@ -85,10 +85,9 @@ $("#tbwrts").stupidtable(); - <% ViewData["EstimateId"]=Model.Id; %>