|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Net;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Web;
|
|
|
|
|
|
using System.Web.Mvc;
|
|
|
|
|
|
using System.Web.Profile;
|
|
|
|
|
|
using System.Web.Security;
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
using Yavsc.Model;
|
|
|
|
|
|
using Yavsc.Model.Google;
|
|
|
|
|
|
using Yavsc.Model.RolesAndMembers;
|
|
|
|
|
|
using Yavsc.Model.Calendar;
|
|
|
|
|
|
using Yavsc.Helpers;
|
Implémente un formulaire simple
de réservation d'un préstataire
* p8-av4.xxs.jpg:
* p8-av4.xxs.png: inutile
* NoLogin.master:
* Entity.cs:
* OAuth2.cs:
* ApiClient.cs:
* PeopleApi.cs:
* MapTracks.cs:
* SkillManager.cs:
* Skills.aspx:
* EntityQuery.cs:
* CalendarApi.cs:
* SimpleJsonPostMethod.cs:
* GoogleHelpers.cs:
* EventPub.aspx:
* GoogleController.cs:
* Notification.cs:
* UserSkills.aspx:
* BackOfficeController.cs:
* BackOfficeController.cs:
* Notification.cs:
* MessageWithPayLoad.cs:
* MessageWithPayloadResponse.cs: refabrication
* IContentProvider.cs:
* NpgsqlBlogProvider.cs: xml doc
* NpgsqlContentProvider.cs: implemente un listing des prestataire du
code APE en base.
* NpgsqlSkillProvider.cs: implemente un listing des domaines de
compétence du préstataire en base.
* XmlCatalogProvider.cs: Le catalogue de vente implémente mainenant
l'interface d'un fournisseur de donnée comme les autres.
Il pourrait par exemple vouloir définir des activité et des
compétences.
Pour l'instant, il n'est pas activé par la configuration, et reste le
fournisseur du catalogue legacy (voir </FrontOffice/Catalog> ).
* FrontOfficeController.cs: format du code
* Global.asax.cs: Une route customisée pour le Front Office : /do
(genre, ici, ça bouge.)
* activity.sql: implémente en base de donnée le modèle des activités
et compétences,
ajoute aussi deux activités : l'edition logicielle et "Artiste"
* style.css: changement de mes images de fond ... tombées du camion de
Xavier et onlinehome.us
* p8-av4.s.jpg: changement de taille
* AccountController.cs: Met le code MEA à "none" quand il est spécifié
non disponible.
* BlogsController.cs: fixe un bug de l'edition d'un billet
* FrontOfficeController.cs: implemente le contrôle booking simple
* HomeController.cs: ajoute l'assemblage du catalog dans le listing
dédié
* YavscAjaxHelper.cs: Implemente un outil de representation JSon des
objets côté serveur
* parallax.js: deux fois plus de mouvement autout de x dans le
parallax
* yavsc.rate.js: imlemente un callback JS pour le rating
* Activities.aspx: Des labels au formulaire de déclaration des
activités
* Activity.ascx: un panneau activité descent
* Booking.aspx: implemente l'UI web du booking simple.
* EavyBooking.aspx: refabrication du booking lourd
* Index.aspx: supprime le panneau du tag Accueil, affiche les
activités en cours du site (avec au moins un préstataire valide pour
cette activité)
* Web.config: Implemente une cote utilisateur, par une nouvelle valeur
de son profile (Rate).
* Yavsc.csproj: refabrique du code API Google, qui part dans le model.
* MarkdownDeep.dll: le tag <p> ne convenait pas, le remplacer par le
tag <span> non plus.
Maintenant ça devrait être correct, c'est un div, mais que en cas de
tag englobant non défini.
* BookingQuery.cs: Le booking lourd devient une commande basée sur des
activités concernée par l'intervention
* ChangeLog: nettoyage
* CatalogProvider.cs: implemente l'interface d'un fournissseur de
contenu
* PerformerProfile.cs: implemente le profile prestataire
* SimpleBookingQuery.cs: Les besoin sont exprimé sous forme d'un
tableau de valeur du parametrage de la commande
* LocalizedText.resx:
* LocalizedText.fr.resx:
* LocalizedText.Designer.cs:
* LocalizedText.fr.Designer.cs: internationalisation
* Profile.cs: implemente un accès à l'id d'enregistrement Google GCM
* SkillEntity.cs: La compétence appartient à un domaine d'activité, on
lui associe un et un seul code APE
* SkillProvider.cs: Fait chercher les compétences à partir d'un code
activité
* WorkFlowManager.cs: implemente l'accès à la liste des préstataires
de telle activité
* YavscModel.csproj: refabrications
* Skills.sql: vient de passer dans activity.Sql
* T.cs: la traduction est faite plus simple à appeler (sans cast vers
`string`).
10 years ago
|
|
|
|
using Yavsc.Model.WorkFlow;
|
|
|
|
|
|
using Yavsc.Model.FrontOffice;
|
|
|
|
|
|
using Yavsc.Model.Google.Api;
|
|
|
|
|
|
using Yavsc.Model.Skill;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Yavsc.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Google controller.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class GoogleController : Controller
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Index this instance.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ActionResult Index()
|
|
|
|
|
|
{
|
|
|
|
|
|
return View ();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string SetSessionSate ()
|
|
|
|
|
|
{
|
|
|
|
|
|
string state = "security_token";
|
|
|
|
|
|
Random rand = new Random ();
|
|
|
|
|
|
for (int l = 0; l < 32; l++) {
|
|
|
|
|
|
int r = rand.Next (62);
|
|
|
|
|
|
char c;
|
|
|
|
|
|
if (r < 10) {
|
|
|
|
|
|
c = (char)('0' + r);
|
|
|
|
|
|
} else if (r < 36) {
|
|
|
|
|
|
r -= 10;
|
|
|
|
|
|
c = (char) ('a' + r);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
r -= 36;
|
|
|
|
|
|
c = (char) ('A' + r);
|
|
|
|
|
|
}
|
|
|
|
|
|
state += c;
|
|
|
|
|
|
}
|
|
|
|
|
|
Session ["state"] = state;
|
|
|
|
|
|
return state;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string AuthGRU {
|
|
|
|
|
|
get {
|
|
|
|
|
|
return Request.Url.Scheme + "://" +
|
|
|
|
|
|
Request.Url.Authority + "/Google/Auth";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string CalendarGRU {
|
|
|
|
|
|
get {
|
|
|
|
|
|
return Request.Url.Scheme + "://" +
|
|
|
|
|
|
Request.Url.Authority + "/Google/CalAuth";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Login the specified returnUrl.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="returnUrl">Return URL.</param>
|
|
|
|
|
|
public void Login (string returnUrl)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace (returnUrl))
|
|
|
|
|
|
returnUrl = "/";
|
|
|
|
|
|
Session ["returnUrl"] = returnUrl;
|
|
|
|
|
|
string state = SetSessionSate ();
|
|
|
|
|
|
Response.Login (state, AuthGRU);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the cal auth.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="returnUrl">Return URL.</param>
|
|
|
|
|
|
public void GetCalAuth (string returnUrl)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace (returnUrl))
|
|
|
|
|
|
returnUrl = "/";
|
|
|
|
|
|
Session ["returnUrl"] = returnUrl;
|
|
|
|
|
|
Response.CalLogin (SetSessionSate (), CalendarGRU);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Called after the Google authorizations screen,
|
|
|
|
|
|
/// we assume that <c>Session</c> contains a redirectUrl entry
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>The auth.</returns>
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
[Authorize]
|
|
|
|
|
|
public ActionResult CalAuth ()
|
|
|
|
|
|
{
|
|
|
|
|
|
string msg;
|
|
|
|
|
|
OAuth2 oa = GoogleHelpers.CreateOAuth2 (CalendarGRU);
|
|
|
|
|
|
AuthToken gat = oa.GetToken (Request, (string) Session ["state"], out msg);
|
|
|
|
|
|
if (gat == null) {
|
|
|
|
|
|
YavscHelpers.Notify(ViewData, msg);
|
|
|
|
|
|
return View ("Auth");
|
|
|
|
|
|
}
|
|
|
|
|
|
SaveToken (HttpContext.Profile,gat);
|
|
|
|
|
|
HttpContext.Profile.SetPropertyValue ("gcalapi", true);
|
|
|
|
|
|
string returnUrl = (string) Session ["returnUrl"];
|
|
|
|
|
|
Session ["returnUrl"] = null;
|
|
|
|
|
|
return Redirect (returnUrl);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Saves the token.
|
|
|
|
|
|
/// This calls the Profile.Save() method.
|
|
|
|
|
|
/// It should be called immediatly after getting the token from Google, in
|
|
|
|
|
|
/// order to save a descent value as expiration date.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pr">pr.</param>
|
|
|
|
|
|
/// <param name="gat">Gat.</param>
|
|
|
|
|
|
private void SaveToken (ProfileBase pr, AuthToken gat)
|
|
|
|
|
|
{
|
|
|
|
|
|
pr.SetPropertyValue ("gtoken", gat.access_token);
|
|
|
|
|
|
if (gat.refresh_token != null)
|
|
|
|
|
|
pr.SetPropertyValue ("grefreshtoken", gat.refresh_token);
|
|
|
|
|
|
pr.SetPropertyValue ("gtokentype", gat.token_type);
|
|
|
|
|
|
pr.SetPropertyValue ("gtokenexpir", DateTime.Now.AddSeconds (gat.expires_in));
|
|
|
|
|
|
pr.Save ();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Auth this instance.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
public ActionResult Auth ()
|
|
|
|
|
|
{
|
|
|
|
|
|
string msg;
|
|
|
|
|
|
OAuth2 oa = GoogleHelpers.CreateOAuth2 (AuthGRU);
|
|
|
|
|
|
AuthToken gat = oa.GetToken (Request, (string)Session ["state"], out msg);
|
|
|
|
|
|
if (gat == null) {
|
|
|
|
|
|
YavscHelpers.Notify(ViewData, msg);
|
|
|
|
|
|
return View ();
|
|
|
|
|
|
}
|
|
|
|
|
|
string returnUrl = (string)Session ["returnUrl"];
|
|
|
|
|
|
SignIn regmod = new SignIn ();
|
|
|
|
|
|
|
|
|
|
|
|
People me = PeopleApi.GetMe (gat);
|
|
|
|
|
|
// TODO use me.id to retreive an existing user
|
|
|
|
|
|
string accEmail = me.emails.Where (x => x.type == "account").First ().value;
|
|
|
|
|
|
MembershipUserCollection mbrs = Membership.FindUsersByEmail (accEmail);
|
|
|
|
|
|
if (mbrs.Count == 1) {
|
|
|
|
|
|
// TODO check the google id
|
|
|
|
|
|
// just set this user as logged on
|
* bg.gif:
* asc.gif:
* desc.gif:
* style.css: moved to App_Themes
* style.css:
* bg.gif:
* asc.gif:
* bg.png:
* rect.png:
* asc.png:
* desc.gif:
* jquery-ui.css:
* mdd_styles.css:
* croix.png:
* desc.png:
* style.css:
* jquery-ui.min.css:
* mdd_gripper.png:
* mdd_toolbar.png:
* jquery.timepicker.css:
* mdd_ajax_loader.gif:
* mdd_modal_background.png: moved to /App_Themes
* NpgsqlBlogProvider.cs: * Remove post by id
* Manage collections of entries on a couple (user,title), not a single
post
* NpgsqlCircleProvider.cs: Fixes the "Match" method.
* IDbModule.cs:
* Edit.aspx:
* Estimates.aspx:
* WorkFlowManager.cs:
* NpgsqlContentProvider.cs: refactoring
* NpgsqlMRPProviders.csproj: new NpgsqlUserName provider
* NpgsqlRoleProvider.cs: simpler init method
* NpgsqlUserNameProvider.cs: impements a UserNameProvider
* MyClass.cs: refactoring from Yavsc.Model
* BlogsController.cs: access control simplified
* FrontOfficeController.cs: Pdf generation made public ni case of
formatting exception
* mdd_styles.css: Theme -> App_Themes
* style.css: yet another style impact
* AccountController.cs: Fixes the user name modification
* BlogsController.cs: * Fixes the removal process
* On a title and user name, we get collection of posts, not only one.
* Implements an Access on circle
* FrontOfficeController.cs: * implements a new Get method.
* ensure a membership existence before delivering an estimate.
* GoogleController.cs: Fixes the user name modification on a Google
account
* ErrorHtmlFormatter.cs: nice error message in html (using Markdown
helper)
* FormatterException.cs: formatter exception exposes error and
standard output of the process
* TexToPdfFormatter.cs: * generates temporary files in the folder
returned by Path.GetTempPath()
* throws FormatterException
* Global.asax.cs: new route map:
Blogs/{action}/{user}/{title}
Blog/{user}/{title}
B/{id}
{controller}/{action}/{id}
* App.master: * refactoring: Theme moved to App_Themes
* a link to the logged user's blog
*
* NoLogin.master: refactoring: Theme moved to App_Themes
* Circles.aspx: refactoring : circles now are given as select items
* Login.aspx: fixes the html presentation
* Register.aspx: Fixes a Typo
* Index.aspx: Implements a blog index, due to M&C changes with this
commit
* RemovePost.aspx: links to the new route to the "RemovePost" action,
giving it a post id
* RemoveTitle.aspx: fixes a not yet linked page to remove a post
collection under a given title
* EventPub.aspx: code refactoring
* Writting.ascx: cleans the code
* Web.config: fills the config with new names in the space
* Web.config: configures the new NpgsqlUserNameProvider
* Web.csproj: refactoring and others
* BlogEntryCollection.cs: implement the BlogEntryCollection
* BlogManager.cs: the manager helps to filter on access
* BlogProvider.cs: The title is not unique anymore, and one can modify
it, post a lot under it, drop all posts under it.
A Post is deleted by id.
* UUBlogEntryCollection.cs: implements a collection of post under a
given user name.
* UUTBlogEntryCollection.cs: implements a collection of post under a
given couple (user name, title).
* ListItem.cs: ListItem is declared obsolete in this model, helpers
can build MVC SelectListItem on data returned by the manager.
* LocalizedText.Designer.cs:
* LocalizedText.fr.Designer.cs: autogenerated from xml
* LocalizedText.resx:
* LocalizedText.fr.resx: new labels
* ChangeUserNameProvider.cs: xml doc
* Profile.cs: the UserName property is read only, and comes from
authentication, to change it, we set a Name and validate it agains
the "Profile" method
* UserManager.cs: simpler code a init time
* IContentProvider.cs: implements the new IDataProvider interface
* IDataProvider.cs: defines the new IDataProvider interface
* YavscModel.csproj: includes new classes
* UserPosts.aspx: adds a link to remove a post
* UserPost.aspx: now uses the new BlogEntryCollection object
10 years ago
|
|
|
|
foreach (MembershipUser u in mbrs) {
|
|
|
|
|
|
string username = u.UserName;
|
|
|
|
|
|
FormsAuthentication.SetAuthCookie (username, true);
|
|
|
|
|
|
/* var upr = ProfileBase.Create (username);
|
|
|
|
|
|
SaveToken (upr,gat); */
|
* bg.gif:
* asc.gif:
* desc.gif:
* style.css: moved to App_Themes
* style.css:
* bg.gif:
* asc.gif:
* bg.png:
* rect.png:
* asc.png:
* desc.gif:
* jquery-ui.css:
* mdd_styles.css:
* croix.png:
* desc.png:
* style.css:
* jquery-ui.min.css:
* mdd_gripper.png:
* mdd_toolbar.png:
* jquery.timepicker.css:
* mdd_ajax_loader.gif:
* mdd_modal_background.png: moved to /App_Themes
* NpgsqlBlogProvider.cs: * Remove post by id
* Manage collections of entries on a couple (user,title), not a single
post
* NpgsqlCircleProvider.cs: Fixes the "Match" method.
* IDbModule.cs:
* Edit.aspx:
* Estimates.aspx:
* WorkFlowManager.cs:
* NpgsqlContentProvider.cs: refactoring
* NpgsqlMRPProviders.csproj: new NpgsqlUserName provider
* NpgsqlRoleProvider.cs: simpler init method
* NpgsqlUserNameProvider.cs: impements a UserNameProvider
* MyClass.cs: refactoring from Yavsc.Model
* BlogsController.cs: access control simplified
* FrontOfficeController.cs: Pdf generation made public ni case of
formatting exception
* mdd_styles.css: Theme -> App_Themes
* style.css: yet another style impact
* AccountController.cs: Fixes the user name modification
* BlogsController.cs: * Fixes the removal process
* On a title and user name, we get collection of posts, not only one.
* Implements an Access on circle
* FrontOfficeController.cs: * implements a new Get method.
* ensure a membership existence before delivering an estimate.
* GoogleController.cs: Fixes the user name modification on a Google
account
* ErrorHtmlFormatter.cs: nice error message in html (using Markdown
helper)
* FormatterException.cs: formatter exception exposes error and
standard output of the process
* TexToPdfFormatter.cs: * generates temporary files in the folder
returned by Path.GetTempPath()
* throws FormatterException
* Global.asax.cs: new route map:
Blogs/{action}/{user}/{title}
Blog/{user}/{title}
B/{id}
{controller}/{action}/{id}
* App.master: * refactoring: Theme moved to App_Themes
* a link to the logged user's blog
*
* NoLogin.master: refactoring: Theme moved to App_Themes
* Circles.aspx: refactoring : circles now are given as select items
* Login.aspx: fixes the html presentation
* Register.aspx: Fixes a Typo
* Index.aspx: Implements a blog index, due to M&C changes with this
commit
* RemovePost.aspx: links to the new route to the "RemovePost" action,
giving it a post id
* RemoveTitle.aspx: fixes a not yet linked page to remove a post
collection under a given title
* EventPub.aspx: code refactoring
* Writting.ascx: cleans the code
* Web.config: fills the config with new names in the space
* Web.config: configures the new NpgsqlUserNameProvider
* Web.csproj: refactoring and others
* BlogEntryCollection.cs: implement the BlogEntryCollection
* BlogManager.cs: the manager helps to filter on access
* BlogProvider.cs: The title is not unique anymore, and one can modify
it, post a lot under it, drop all posts under it.
A Post is deleted by id.
* UUBlogEntryCollection.cs: implements a collection of post under a
given user name.
* UUTBlogEntryCollection.cs: implements a collection of post under a
given couple (user name, title).
* ListItem.cs: ListItem is declared obsolete in this model, helpers
can build MVC SelectListItem on data returned by the manager.
* LocalizedText.Designer.cs:
* LocalizedText.fr.Designer.cs: autogenerated from xml
* LocalizedText.resx:
* LocalizedText.fr.resx: new labels
* ChangeUserNameProvider.cs: xml doc
* Profile.cs: the UserName property is read only, and comes from
authentication, to change it, we set a Name and validate it agains
the "Profile" method
* UserManager.cs: simpler code a init time
* IContentProvider.cs: implements the new IDataProvider interface
* IDataProvider.cs: defines the new IDataProvider interface
* YavscModel.csproj: includes new classes
* UserPosts.aspx: adds a link to remove a post
* UserPost.aspx: now uses the new BlogEntryCollection object
10 years ago
|
|
|
|
}
|
|
|
|
|
|
Session ["returnUrl"] = null;
|
|
|
|
|
|
return Redirect (returnUrl);
|
|
|
|
|
|
}
|
|
|
|
|
|
// else create the account
|
|
|
|
|
|
regmod.Email = accEmail;
|
|
|
|
|
|
regmod.UserName = me.displayName;
|
|
|
|
|
|
Session ["me"] = me;
|
|
|
|
|
|
Session ["GoogleAuthToken"] = gat;
|
|
|
|
|
|
return Auth (regmod);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Creates an account using the Google authentification.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="regmod">Regmod.</param>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public ActionResult Auth (SignIn regmod)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (ModelState.IsValid) {
|
|
|
|
|
|
if (Membership.GetUser (regmod.UserName) != null) {
|
|
|
|
|
|
ModelState.AddModelError ("UserName", "This user name already is in use");
|
|
|
|
|
|
return View ();
|
|
|
|
|
|
}
|
|
|
|
|
|
string returnUrl = (string) Session ["returnUrl"];
|
|
|
|
|
|
AuthToken gat = (AuthToken) Session ["GoogleAuthToken"];
|
|
|
|
|
|
People me = (People)Session ["me"];
|
|
|
|
|
|
if (gat == null || me == null)
|
|
|
|
|
|
throw new InvalidDataException ();
|
|
|
|
|
|
|
|
|
|
|
|
Random rand = new Random ();
|
|
|
|
|
|
string passwd = rand.Next (100000).ToString () + rand.Next (100000).ToString ();
|
|
|
|
|
|
|
|
|
|
|
|
MembershipCreateStatus mcs;
|
|
|
|
|
|
Membership.CreateUser (
|
|
|
|
|
|
regmod.UserName,
|
|
|
|
|
|
passwd,
|
|
|
|
|
|
regmod.Email,
|
|
|
|
|
|
null,
|
|
|
|
|
|
null,
|
|
|
|
|
|
true,
|
|
|
|
|
|
out mcs);
|
|
|
|
|
|
switch (mcs) {
|
|
|
|
|
|
case MembershipCreateStatus.DuplicateEmail:
|
|
|
|
|
|
ModelState.AddModelError ("Email", "Cette adresse e-mail correspond " +
|
|
|
|
|
|
"à un compte utilisateur existant");
|
|
|
|
|
|
return View (regmod);
|
|
|
|
|
|
case MembershipCreateStatus.DuplicateUserName:
|
|
|
|
|
|
ModelState.AddModelError ("UserName", "Ce nom d'utilisateur est " +
|
|
|
|
|
|
"déjà enregistré");
|
|
|
|
|
|
return View (regmod);
|
|
|
|
|
|
case MembershipCreateStatus.Success:
|
|
|
|
|
|
Membership.ValidateUser (regmod.UserName, passwd);
|
|
|
|
|
|
FormsAuthentication.SetAuthCookie (regmod.UserName, true);
|
|
|
|
|
|
|
|
|
|
|
|
HttpContext.Profile.Initialize (regmod.UserName, true);
|
|
|
|
|
|
HttpContext.Profile.SetPropertyValue ("Name", me.displayName);
|
|
|
|
|
|
// TODO use image
|
|
|
|
|
|
if (me.image != null) {
|
|
|
|
|
|
HttpContext.Profile.SetPropertyValue ("Avatar", me.image.url);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (me.placesLived != null) {
|
|
|
|
|
|
People.Place pplace = me.placesLived.Where (x => x.primary).First ();
|
|
|
|
|
|
if (pplace != null)
|
|
|
|
|
|
HttpContext.Profile.SetPropertyValue ("CityAndState", pplace.value);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (me.url != null)
|
|
|
|
|
|
HttpContext.Profile.SetPropertyValue ("WebSite", me.url);
|
|
|
|
|
|
// Will be done in SaveToken: HttpContext.Profile.Save ();
|
|
|
|
|
|
SaveToken (HttpContext.Profile, gat);
|
|
|
|
|
|
Session ["returnUrl"] = null;
|
|
|
|
|
|
return Redirect (returnUrl);
|
|
|
|
|
|
}
|
|
|
|
|
|
ViewData ["returnUrl"] = returnUrl;
|
|
|
|
|
|
}
|
|
|
|
|
|
return View (regmod);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Authorize]
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
ActionResult PushPos ()
|
|
|
|
|
|
{
|
|
|
|
|
|
return View ();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Chooses the calendar.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>The calendar.</returns>
|
|
|
|
|
|
/// <param name="returnUrl">Return URL.</param>
|
|
|
|
|
|
[Authorize]
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
public ActionResult ChooseCalendar (string returnUrl)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (returnUrl != null) {
|
|
|
|
|
|
Session ["chooseCalReturnUrl"] = returnUrl;
|
|
|
|
|
|
return RedirectToAction ("GetCalAuth",
|
|
|
|
|
|
new {
|
|
|
|
|
|
returnUrl = Url.Action ("ChooseCalendar") // "ChooseCalendar?returnUrl="+HttpUtility.UrlEncode(returnUrl)
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
CalendarList cl = GoogleHelpers.GetCalendars(HttpContext.Profile);
|
|
|
|
|
|
ViewData ["returnUrl"] = Session ["chooseCalReturnUrl"];
|
|
|
|
|
|
return View (cl);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Sets the calendar.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>The calendar.</returns>
|
|
|
|
|
|
/// <param name="calchoice">Calchoice.</param>
|
|
|
|
|
|
/// <param name="returnUrl">return Url.</param>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[Authorize]
|
|
|
|
|
|
public ActionResult SetCalendar (string calchoice,string returnUrl)
|
|
|
|
|
|
{
|
|
|
|
|
|
HttpContext.Profile.SetPropertyValue ("gcalid", calchoice);
|
|
|
|
|
|
HttpContext.Profile.Save ();
|
|
|
|
|
|
|
|
|
|
|
|
if (returnUrl != null) {
|
|
|
|
|
|
return Redirect (returnUrl);
|
|
|
|
|
|
}
|
|
|
|
|
|
return Redirect ("/");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Dates the query.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>The query.</returns>
|
|
|
|
|
|
[Authorize,HttpGet]
|
|
|
|
|
|
public ActionResult Book ()
|
|
|
|
|
|
{
|
|
|
|
|
|
var model = new BookingQuery ();
|
|
|
|
|
|
model.StartDate = DateTime.Now;
|
|
|
|
|
|
model.EndDate = model.StartDate.AddDays(2);
|
|
|
|
|
|
model.StartHour = DateTime.Now.ToString("HH:mm");
|
|
|
|
|
|
model.EndHour = DateTime.Now.AddHours(1).ToString("HH:mm");
|
|
|
|
|
|
return View (model);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
Implémente un formulaire simple
de réservation d'un préstataire
* p8-av4.xxs.jpg:
* p8-av4.xxs.png: inutile
* NoLogin.master:
* Entity.cs:
* OAuth2.cs:
* ApiClient.cs:
* PeopleApi.cs:
* MapTracks.cs:
* SkillManager.cs:
* Skills.aspx:
* EntityQuery.cs:
* CalendarApi.cs:
* SimpleJsonPostMethod.cs:
* GoogleHelpers.cs:
* EventPub.aspx:
* GoogleController.cs:
* Notification.cs:
* UserSkills.aspx:
* BackOfficeController.cs:
* BackOfficeController.cs:
* Notification.cs:
* MessageWithPayLoad.cs:
* MessageWithPayloadResponse.cs: refabrication
* IContentProvider.cs:
* NpgsqlBlogProvider.cs: xml doc
* NpgsqlContentProvider.cs: implemente un listing des prestataire du
code APE en base.
* NpgsqlSkillProvider.cs: implemente un listing des domaines de
compétence du préstataire en base.
* XmlCatalogProvider.cs: Le catalogue de vente implémente mainenant
l'interface d'un fournisseur de donnée comme les autres.
Il pourrait par exemple vouloir définir des activité et des
compétences.
Pour l'instant, il n'est pas activé par la configuration, et reste le
fournisseur du catalogue legacy (voir </FrontOffice/Catalog> ).
* FrontOfficeController.cs: format du code
* Global.asax.cs: Une route customisée pour le Front Office : /do
(genre, ici, ça bouge.)
* activity.sql: implémente en base de donnée le modèle des activités
et compétences,
ajoute aussi deux activités : l'edition logicielle et "Artiste"
* style.css: changement de mes images de fond ... tombées du camion de
Xavier et onlinehome.us
* p8-av4.s.jpg: changement de taille
* AccountController.cs: Met le code MEA à "none" quand il est spécifié
non disponible.
* BlogsController.cs: fixe un bug de l'edition d'un billet
* FrontOfficeController.cs: implemente le contrôle booking simple
* HomeController.cs: ajoute l'assemblage du catalog dans le listing
dédié
* YavscAjaxHelper.cs: Implemente un outil de representation JSon des
objets côté serveur
* parallax.js: deux fois plus de mouvement autout de x dans le
parallax
* yavsc.rate.js: imlemente un callback JS pour le rating
* Activities.aspx: Des labels au formulaire de déclaration des
activités
* Activity.ascx: un panneau activité descent
* Booking.aspx: implemente l'UI web du booking simple.
* EavyBooking.aspx: refabrication du booking lourd
* Index.aspx: supprime le panneau du tag Accueil, affiche les
activités en cours du site (avec au moins un préstataire valide pour
cette activité)
* Web.config: Implemente une cote utilisateur, par une nouvelle valeur
de son profile (Rate).
* Yavsc.csproj: refabrique du code API Google, qui part dans le model.
* MarkdownDeep.dll: le tag <p> ne convenait pas, le remplacer par le
tag <span> non plus.
Maintenant ça devrait être correct, c'est un div, mais que en cas de
tag englobant non défini.
* BookingQuery.cs: Le booking lourd devient une commande basée sur des
activités concernée par l'intervention
* ChangeLog: nettoyage
* CatalogProvider.cs: implemente l'interface d'un fournissseur de
contenu
* PerformerProfile.cs: implemente le profile prestataire
* SimpleBookingQuery.cs: Les besoin sont exprimé sous forme d'un
tableau de valeur du parametrage de la commande
* LocalizedText.resx:
* LocalizedText.fr.resx:
* LocalizedText.Designer.cs:
* LocalizedText.fr.Designer.cs: internationalisation
* Profile.cs: implemente un accès à l'id d'enregistrement Google GCM
* SkillEntity.cs: La compétence appartient à un domaine d'activité, on
lui associe un et un seul code APE
* SkillProvider.cs: Fait chercher les compétences à partir d'un code
activité
* WorkFlowManager.cs: implemente l'accès à la liste des préstataires
de telle activité
* YavscModel.csproj: refabrications
* Skills.sql: vient de passer dans activity.Sql
* T.cs: la traduction est faite plus simple à appeler (sans cast vers
`string`).
10 years ago
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ActionResult Book (SimpleBookingQuery model)
|
|
|
|
|
|
{
|
|
|
|
|
|
return View (model);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|