recupération de mot de passe + prise de commande
* ResetPassword.txt: Un message pour le mot de passe oublié
* style.css: fixe un 404
* UpdatePassword.aspx: Implémente le formulaire de mise à jour du mot
de passe,
accessible depuis l'e-mail.
* Contact.aspx: implémente la page de contact préstataire
* UpdatePassword.cs: modèle de la modification de mot de passe au
jeton de securité (qui est encore un fake en l'état)
* CommandRegistration.cs: un enregistrement de commande
* NominativeCommandRegistration.cs: un enregistrement de commande
nominative
* .gitignore: ignore ma config LuaDebug
* NpgsqlMembershipProvider.cs: ne pas crasher à la lecture en base de
la question de
recupération du mot de passe quand elle est nulle.
* BasketController.cs: renvoie l'objet décrivant la prise de commande
* Global.asax.cs: ignorer les routes vers App_Data et App_Code
* instdbws.sql: passage du type json à jsonb pour les paramètres de la
commande
* RegistrationMail.txt: un piti message à l'enregistrement
* AccountController.cs: Envoi du message du mot de passe oublié,
methode de changemnet du mot de passe.
* AdminController.cs: xmldoc + refabrication helper Notify
* HomeController.cs:
* BlogsController.cs:
* GoogleController.cs: refabrication helper Notify
* FrontOfficeController.cs: Refabrication: Utilisation du nouvel
enregistrement de commande.
+ refabrication helper Notify
* YavscHelpers.cs: implémente la methode d'envoi du message de mot de
passe oublié
+ refabrication helper Notify
* App.master: Corrige la notification Html
* AppAdmin.master: Le lien vers la page de contact était associé
à tort à la classe css "thanks"
* yavsc.js: message plus parlant en cas de requête Ajax mal formée.
* Login.aspx: Implémente le lien vers le formulaire de recupération du
mot de passe
* UserPost.aspx: .
* Booking.aspx: format du code
* Performer.ascx: l'e-mail préstataire ne sera jamais fourni par
l'application,
aussi, on parlera de "prendre contact", d'échanger ... mais pas de
donner l'adresse e-mail.
L'information "son email" n'est donc pas disponible meme à
l'utilisateur autorisé.
La prise de contact, ou autre fux de comunication le sont.
* Performers.aspx: affiche la notification à l'envoi de la demande de
devis
* Product.aspx:
* Service.aspx: les periodes du catalogue et du calendrier sont
fondue.
* Contact.aspx: traduction en français
* Web.config:
* la procédure de recupération du mot de passe est
activée
* l'e-message envoyé est construit à partir d'un modèle, un fichier
texte trouvé dans /App_Data, et indiqué à l'application
par le paramêtre applicatif "LostPasswordMessage"
* Yavsc.csproj: reference les nouveaux fichiers
* Product.cs: utilise la période du calendrier
* Commande.cs: renvoie un objet à la prise de commande, indiquant
l'identifiant de commande, et les messages envoyés
en cas de commande nominative.
* GoogleHelpers.cs: icone à la notification mobile
* LocalizedText.resx:
* LocalizedText.fr.resx:
* LocalizedText.Designer.cs:
* LocalizedText.fr.Designer.cs: traductions
* UserNameBase.cs: fixe la dé-sérialisation
* WorkFlowManager.cs: refabrication de la prise de commande
* YavscModel.csproj: nouveaux objets du modèle
* OtherWebException.aspx: page obsolete
* Period.cs: fondre la période: celle du catalogue disparait, au
profit de celle du calendrier.
This commit is contained in:
parent
5a4179d051
commit
a14e63d26f
49 changed files with 793 additions and 218 deletions
|
|
@ -18,6 +18,7 @@ using System.Net;
|
|||
using System.Configuration;
|
||||
using Yavsc.Model;
|
||||
using Yavsc.Model.WorkFlow;
|
||||
using Yavsc.Model.Messaging;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
|
|
@ -62,7 +63,7 @@ namespace Yavsc.Controllers
|
|||
/// <returns>The login.</returns>
|
||||
/// <param name="model">Model.</param>
|
||||
/// <param name="returnUrl">Return URL.</param>
|
||||
[HttpPost,ValidateAntiForgeryToken]
|
||||
[HttpPost,ValidateAntiForgeryToken]
|
||||
public ActionResult Login (LoginModel model, string returnUrl)
|
||||
{
|
||||
if (ModelState.IsValid) {
|
||||
|
|
@ -362,7 +363,7 @@ namespace Yavsc.Controllers
|
|||
FormsAuthentication.SetAuthCookie (model.NewUserName, model.RememberMe);
|
||||
model.UserName = model.NewUserName;
|
||||
}
|
||||
YavscHelpers.Notify(ViewData, "Profile enregistré"+((editsTheUserName)?", nom public inclu.":""));
|
||||
ViewData.Notify( "Profile enregistré"+((editsTheUserName)?", nom public inclu.":""));
|
||||
}
|
||||
SetMEACodeViewData (model);
|
||||
SetUIThemeViewData (model);
|
||||
|
|
@ -404,8 +405,10 @@ namespace Yavsc.Controllers
|
|||
foreach (string key in errors.Keys)
|
||||
ModelState.AddModelError (key, errors [key]);
|
||||
|
||||
if (user != null && ModelState.IsValid)
|
||||
Url.SendActivationMessage (user);
|
||||
if (user != null && ModelState.IsValid) {
|
||||
YavscHelpers.SendNewPasswordMessage (user);
|
||||
ViewData.Notify ( new Notification () { body = LocalizedText.NewPasswordMessageSent } );
|
||||
}
|
||||
}
|
||||
return View (model);
|
||||
}
|
||||
|
|
@ -420,22 +423,69 @@ namespace Yavsc.Controllers
|
|||
{
|
||||
MembershipUser u = Membership.GetUser (id, false);
|
||||
if (u == null) {
|
||||
YavscHelpers.Notify( ViewData,
|
||||
ViewData.Notify(
|
||||
string.Format ("Cet utilisateur n'existe pas ({0})", id));
|
||||
} else if (u.ProviderUserKey.ToString () == key) {
|
||||
if (u.IsApproved) {
|
||||
YavscHelpers.Notify( ViewData,
|
||||
ViewData.Notify(
|
||||
string.Format ("Votre compte ({0}) est déjà validé.", id));
|
||||
} else {
|
||||
u.IsApproved = true;
|
||||
Membership.UpdateUser (u);
|
||||
YavscHelpers.Notify( ViewData,
|
||||
ViewData.Notify(
|
||||
string.Format ("La création de votre compte ({0}) est validée.", id));
|
||||
}
|
||||
} else
|
||||
YavscHelpers.Notify( ViewData, "La clé utilisée pour valider ce compte est incorrecte" );
|
||||
ViewData.Notify( "La clé utilisée pour valider ce compte est incorrecte" );
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the password.
|
||||
/// </summary>
|
||||
/// <returns>The password.</returns>
|
||||
/// <param name="id">Identifier.</param>
|
||||
/// <param name="key">Key.</param>
|
||||
[HttpGet]
|
||||
public ActionResult UpdatePassword (string id, string key)
|
||||
{
|
||||
MembershipUser u = Membership.GetUser (id, false);
|
||||
if (u == null) {
|
||||
return Content(
|
||||
string.Format("Cet utilisateur n'existe pas ({0})", id));
|
||||
}
|
||||
if (u.ProviderUserKey.ToString () != key) {
|
||||
return Content("Clé invalide");
|
||||
}
|
||||
ViewData["UserName"] = id;
|
||||
ViewData["UserKey"] = key;
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the password.
|
||||
/// </summary>
|
||||
/// <returns>The password.</returns>
|
||||
/// <param name="model">Model.</param>
|
||||
[HttpPost]
|
||||
public ActionResult UpdatePassword (UpdatePassword model)
|
||||
{
|
||||
if (ModelState.IsValid) {
|
||||
if (model.Password == model.ConfirmPassword) {
|
||||
MembershipUser u = Membership.GetUser (model.UserName, false);
|
||||
if (u == null) {
|
||||
return Content(
|
||||
string.Format("Cet utilisateur n'existe pas ({0})", model.UserName));
|
||||
}
|
||||
if (u.ProviderUserKey.ToString () != model.UserKey) {
|
||||
return Content("Clé invalide");
|
||||
}
|
||||
u.ChangePassword(u.GetPassword (),model.Password);
|
||||
ViewData.Notify( "La mise à jour du mot de passe a été effectuée.");
|
||||
return View("Index");
|
||||
}
|
||||
}
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ namespace Yavsc.Controllers
|
|||
// FIXME do this in a new installation script.
|
||||
if (!Roles.RoleExists (_adminRoleName)) {
|
||||
Roles.CreateRole (_adminRoleName);
|
||||
YavscHelpers.Notify (ViewData, _adminRoleName + " " + LocalizedText.role_created);
|
||||
ViewData.Notify( _adminRoleName + " " + LocalizedText.role_created);
|
||||
}
|
||||
return View ();
|
||||
}
|
||||
|
|
@ -159,6 +159,13 @@ namespace Yavsc.Controllers
|
|||
return Redirect(returnUrl);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the user to role.
|
||||
/// </summary>
|
||||
/// <returns>The user to role.</returns>
|
||||
/// <param name="username">Username.</param>
|
||||
/// <param name="rolename">Rolename.</param>
|
||||
/// <param name="returnUrl">Return URL.</param>
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult AddUserToRole(string username, string rolename, string returnUrl)
|
||||
{
|
||||
|
|
@ -178,7 +185,7 @@ namespace Yavsc.Controllers
|
|||
ViewData ["usertoremove"] = username;
|
||||
if (submitbutton == "Supprimer") {
|
||||
Membership.DeleteUser (username);
|
||||
YavscHelpers.Notify(ViewData, string.Format("utilisateur \"{0}\" supprimé",username));
|
||||
ViewData.Notify( string.Format("utilisateur \"{0}\" supprimé",username));
|
||||
ViewData ["usertoremove"] = null;
|
||||
}
|
||||
return View ();
|
||||
|
|
@ -273,7 +280,7 @@ namespace Yavsc.Controllers
|
|||
public ActionResult AddRole (string rolename)
|
||||
{
|
||||
Roles.CreateRole(rolename);
|
||||
YavscHelpers.Notify(ViewData, LocalizedText.role_created+ " : "+rolename);
|
||||
ViewData.Notify(LocalizedText.role_created+ " : "+rolename);
|
||||
return View ();
|
||||
}
|
||||
|
||||
|
|
@ -310,7 +317,7 @@ namespace Yavsc.Controllers
|
|||
ViewData ["useritems"] = users;
|
||||
if (ModelState.IsValid) {
|
||||
Roles.AddUserToRole (model.UserName, _adminRoleName);
|
||||
YavscHelpers.Notify(ViewData, model.UserName + " "+LocalizedText.was_added_to_the_role+" '" + _adminRoleName + "'");
|
||||
ViewData.Notify(model.UserName + " "+LocalizedText.was_added_to_the_role+" '" + _adminRoleName + "'");
|
||||
} else {
|
||||
if (admins.Length > 0) {
|
||||
if (! admins.Contains (Membership.GetUser ().UserName)) {
|
||||
|
|
@ -321,7 +328,7 @@ namespace Yavsc.Controllers
|
|||
// No admin, gives the Admin Role to the current user
|
||||
Roles.AddUserToRole (currentUser, _adminRoleName);
|
||||
admins = new string[] { currentUser };
|
||||
YavscHelpers.Notify(ViewData, string.Format (
|
||||
ViewData.Notify( string.Format (
|
||||
LocalizedText.was_added_to_the_empty_role,
|
||||
currentUser, _adminRoleName));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -289,11 +289,11 @@ namespace Yavsc.Controllers
|
|||
// ensures rights to update
|
||||
BlogManager.GetForEditing (model.Id, true);
|
||||
BlogManager.UpdatePost (model.Id, model.Title, model.Content, model.Visible, model.AllowedCircles);
|
||||
YavscHelpers.Notify (ViewData, LocalizedText.BillUpdated);
|
||||
ViewData.Notify( LocalizedText.BillUpdated);
|
||||
|
||||
} else {
|
||||
model.Id = BlogManager.Post (model.Author, model.Title, model.Content, model.Visible, model.AllowedCircles);
|
||||
YavscHelpers.Notify (ViewData, LocalizedText.BillCreated);
|
||||
ViewData.Notify( LocalizedText.BillCreated);
|
||||
}
|
||||
BlogManager.UpdatePostPhoto (model.Id, model.Photo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ namespace Yavsc.Controllers
|
|||
ViewData ["ProdRef"] = pref;
|
||||
Catalog cat = CatalogManager.GetCatalog ();
|
||||
if (cat == null) {
|
||||
YavscHelpers.Notify (ViewData, "Catalog introuvable");
|
||||
ViewData.Notify( "Catalog introuvable");
|
||||
ViewData ["RefType"] = "Catalog";
|
||||
return View ("ReferenceNotFound");
|
||||
}
|
||||
|
|
@ -257,10 +257,12 @@ namespace Yavsc.Controllers
|
|||
// * Make the workflow register this command
|
||||
// * Render the resulting basket
|
||||
|
||||
long cmdid = YavscHelpers.CreateCommandFromRequest ();
|
||||
NominativeCommandRegistration cmdreg = YavscHelpers.CreateCommandFromRequest ()
|
||||
as NominativeCommandRegistration;
|
||||
var basket = WorkFlowManager.GetCommands (User.Identity.Name);
|
||||
ViewData["Commanded"] = basket[cmdid];
|
||||
YavscHelpers.Notify (ViewData,
|
||||
ViewData["Commanded"] = basket[cmdreg.CommandId];
|
||||
ViewData["CommandResult"] = cmdreg ;
|
||||
ViewData.Notify(
|
||||
LocalizedText.Item_added_to_basket);
|
||||
return View ("Basket",basket);
|
||||
} catch (Exception e) {
|
||||
|
|
@ -315,7 +317,7 @@ namespace Yavsc.Controllers
|
|||
/// <summary>
|
||||
/// Activities the specified search and toPower.
|
||||
/// </summary>
|
||||
/// <param name="search">Search.</param>
|
||||
/// <param name="id">Activity identifier.</param>
|
||||
/// <param name="toPower">If set to <c>true</c> to power.</param>
|
||||
public ActionResult Activities (string id, bool toPower = false)
|
||||
{
|
||||
|
|
@ -329,7 +331,7 @@ namespace Yavsc.Controllers
|
|||
/// <summary>
|
||||
/// Activity at the specified id.
|
||||
/// </summary>
|
||||
/// <param name="id">Identifier.</param>
|
||||
/// <param name="MEACode">Identifier.</param>
|
||||
public ActionResult Activity (string MEACode)
|
||||
{
|
||||
return View (WorkFlowManager.GetActivity (MEACode));
|
||||
|
|
@ -356,7 +358,7 @@ namespace Yavsc.Controllers
|
|||
// That filters the view in order to only edit the given fieldset
|
||||
|
||||
if (mea == "none")
|
||||
YavscHelpers.Notify (ViewData, "Vous devez choisir une activité avant de pouvoir déclarer vos compétences " +
|
||||
ViewData.Notify( "Vous devez choisir une activité avant de pouvoir déclarer vos compétences " +
|
||||
"(Editez la rubrique <a href=\"" +
|
||||
Url.RouteUrl ("Default", new { controller = "Account", action = "Profile", id = User.Identity.Name, fs="infopub" }) + "\">Informations publiques</a> votre profile)");
|
||||
|
||||
|
|
@ -398,7 +400,7 @@ namespace Yavsc.Controllers
|
|||
response = reader.ReadToEnd ();
|
||||
stream.Close ();
|
||||
}
|
||||
YavscHelpers.Notify (ViewData,
|
||||
ViewData.Notify(
|
||||
string.Format (
|
||||
"Google calendar API exception {0} : {1}<br><pre>{2}</pre>",
|
||||
ex.Status.ToString (),
|
||||
|
|
@ -498,7 +500,7 @@ namespace Yavsc.Controllers
|
|||
stream.Dispose ();
|
||||
|
||||
}
|
||||
YavscHelpers.Notify (ViewData,
|
||||
ViewData.Notify(
|
||||
string.Format (
|
||||
"{3} exception {0} : {1}<br><pre>{2}</pre>",
|
||||
ex.Status.ToString (),
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ namespace Yavsc.Controllers
|
|||
OAuth2 oa = GoogleHelpers.CreateOAuth2 (CalendarGRU);
|
||||
AuthToken gat = oa.GetToken (Request, (string) Session ["state"], out msg);
|
||||
if (gat == null) {
|
||||
YavscHelpers.Notify(ViewData, msg);
|
||||
ViewData.Notify( msg);
|
||||
return View ("Auth");
|
||||
}
|
||||
SaveToken (HttpContext.Profile,gat);
|
||||
|
|
@ -147,7 +147,7 @@ namespace Yavsc.Controllers
|
|||
OAuth2 oa = GoogleHelpers.CreateOAuth2 (AuthGRU);
|
||||
AuthToken gat = oa.GetToken (Request, (string)Session ["state"], out msg);
|
||||
if (gat == null) {
|
||||
YavscHelpers.Notify(ViewData, msg);
|
||||
ViewData.Notify(msg);
|
||||
return View ();
|
||||
}
|
||||
string returnUrl = (string)Session ["returnUrl"];
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ namespace Yavsc.Controllers
|
|||
using (System.Net.Mail.SmtpClient sc = new SmtpClient())
|
||||
{
|
||||
sc.Send (msg);
|
||||
YavscHelpers.Notify(ViewData, LocalizedText.Message_sent);
|
||||
ViewData.Notify(LocalizedText.Message_sent);
|
||||
return View (new { email=email, reason="", body="" });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue