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:
Paul Schneider 2015-12-30 14:43:39 +01:00
commit a14e63d26f
49 changed files with 793 additions and 218 deletions

View file

@ -0,0 +1,46 @@
//
// CommandRegistration.cs
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// 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 <http://www.gnu.org/licenses/>.
using System;
using Yavsc.Model.WorkFlow;
using System.Configuration;
using System.Collections.Specialized;
using Yavsc.Model.FrontOffice;
using System.Configuration.Provider;
using Yavsc.Model.FrontOffice.Catalog;
using System.Collections.Generic;
using Yavsc.Model.Skill;
using System.Linq;
using Yavsc.Model.Calendar;
using Yavsc.Model.Google.Api;
using System.Net.Mail;
using System.Web.Security;
using System.Web.Configuration;
using System.Net;
using System.IO;
namespace Yavsc.Model.WorkFlow
{
public class CommandRegistration {
public long CommandId {get; set; }
}
}

View file

@ -0,0 +1,48 @@
//
// NominativeCommandRegistration.cs
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// 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 <http://www.gnu.org/licenses/>.
using System;
using Yavsc.Model.WorkFlow;
using System.Configuration;
using System.Collections.Specialized;
using Yavsc.Model.FrontOffice;
using System.Configuration.Provider;
using Yavsc.Model.FrontOffice.Catalog;
using System.Collections.Generic;
using Yavsc.Model.Skill;
using System.Linq;
using Yavsc.Model.Calendar;
using Yavsc.Model.Google.Api;
using System.Net.Mail;
using System.Web.Security;
using System.Web.Configuration;
using System.Net;
using System.IO;
namespace Yavsc.Model.WorkFlow
{
public class NominativeCommandRegistration : CommandRegistration {
public bool NotifiedOnMobile { get; set; }
public bool EmailSent { get; set; }
}
}

View file

@ -18,7 +18,8 @@ using System.IO;
namespace Yavsc.Model.WorkFlow
{
/// <summary>
/// Work flow manager.
/// It takes orders store them and raise some events for modules
@ -75,16 +76,20 @@ namespace Yavsc.Model.WorkFlow
/// <value>The catalog.</value>
public static Catalog Catalog { get; set; }
/// <summary>
/// Registers the command.
/// </summary>
/// <returns>The command.</returns>
/// <param name="com">COM.</param>
public static long RegisterCommand (Command com)
public static CommandRegistration RegisterCommand (Command com)
{
long cmdid = DefaultProvider.RegisterCommand (com);
string errorMsgGCM=null;
if (com.GetType ().GetInterface ("INominative") != null) {
var result = new NominativeCommandRegistration ();
result.CommandId = cmdid;
INominative cmdn = com as INominative;
NominativeEventPub ev = new NominativeEventPub ();
ev.PerformerName = cmdn.PerformerName;
@ -92,9 +97,13 @@ namespace Yavsc.Model.WorkFlow
ev.Description = desc;
// TODO send a location
try {
var gnresponse = GoogleHelpers.NotifyEvent (ev);
}
catch (WebException ex) {
if (gnresponse.failure > 0 || gnresponse.success <=0)
result.NotifiedOnMobile = false;
else result.NotifiedOnMobile = true;
} catch (WebException ex) {
using (var respstream = ex.Response.GetResponseStream ()) {
using (StreamReader rdr = new StreamReader (respstream)) {
@ -103,30 +112,32 @@ namespace Yavsc.Model.WorkFlow
}
respstream.Close ();
}
if (errorMsgGCM==null)
errorMsgGCM = "No response";
if (errorMsgGCM == null)
throw;
throw new Exception (errorMsgGCM);
throw new Exception (errorMsgGCM,ex);
}
string errorEMail = null;
try {
var pref = Membership.GetUser (cmdn.PerformerName);
using (System.Net.Mail.MailMessage msg =
new MailMessage (
WebConfigurationManager.AppSettings.Get ("OwnerEMail"),
pref.Email,
"[Demande de devis] " + com.ClientName,
desc)) {
using (System.Net.Mail.SmtpClient sc = new SmtpClient ()) {
sc.Send (msg);
var pref = Membership.GetUser (cmdn.PerformerName);
using (System.Net.Mail.MailMessage msg =
new MailMessage (
WebConfigurationManager.AppSettings.Get ("OwnerEMail"),
pref.Email,
"[Demande de devis] " + com.ClientName,
desc)) {
using (System.Net.Mail.SmtpClient sc = new SmtpClient ()) {
sc.Send (msg);
result.EmailSent = true;
}
}
}
}
catch (Exception ex) {
} catch (Exception ex) {
errorEMail = ex.Message;
result.EmailSent = false;
}
}
return cmdid;
return result;
} else
throw new NotImplementedException ();
}
/// <summary>