annotate Agendas/trunk/src/Agendas.Web/Controllers/AccountController.cs @ 119:8fa58a79656a

Historico
author Nelo@Kenia.neluz.int
date Wed, 22 Jun 2011 09:49:07 -0300
parents 7a2eeb9e9bf9
children 62dc9fb3a03e
rev   line source
115
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
1 using System.Web.Mvc;
10
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
2 using System.Web.Routing;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
3 using System.Web.Security;
94
db4b1e2cae49 Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents: 93
diff changeset
4 using AltNetHispano.Agendas.Domain;
db4b1e2cae49 Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents: 93
diff changeset
5 using AltNetHispano.Agendas.Factories;
90
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
6 using AltNetHispano.Agendas.Twitter;
34
475be11edf56 Ajuste en los nombre de los assemblies y namespaces
nelo@MTEySS.neluz.int
parents: 10
diff changeset
7 using AltNetHispano.Agendas.Web.Models;
93
65f0b3d70c18 Reordenando clases e interfaces
Nelo@Kenia.neluz.int
parents: 92
diff changeset
8 using AltNetHispano.Agendas.Web.Services;
10
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
9
34
475be11edf56 Ajuste en los nombre de los assemblies y namespaces
nelo@MTEySS.neluz.int
parents: 10
diff changeset
10 namespace AltNetHispano.Agendas.Web.Controllers
10
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
11 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
12 public class AccountController : Controller
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
13 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
14
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
15 public IFormsAuthenticationService FormsService { get; set; }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
16 public IMembershipService MembershipService { get; set; }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
17
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
18 protected override void Initialize(RequestContext requestContext)
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
19 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
20 if (FormsService == null) { FormsService = new FormsAuthenticationService(); }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
21 if (MembershipService == null) { MembershipService = new AccountMembershipService(); }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
22
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
23 base.Initialize(requestContext);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
24 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
25
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
26 // **************************************
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
27 // URL: /Account/LogOn
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
28 // **************************************
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
29
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
30 public ActionResult LogOn()
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
31 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
32 return View();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
33 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
34
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
35 [HttpPost]
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
36 public ActionResult LogOn(LogOnModel model, string returnUrl)
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
37 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
38 if (ModelState.IsValid)
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
39 {
96
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
40 if (MembershipService.ValidateUser(model.UserName, model.Password))
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
41 {
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
42 var personaService = AgendaFactory.GetPersonaService();
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
43 if (personaService.Validate(IdentityProviderEnum.BuiltIn, model.UserName))
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
44 {
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
45 FormsService.SignIn(Identification.Map[(int)IdentityProviderEnum.BuiltIn] + model.UserName, model.RememberMe);
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
46 if (Url.IsLocalUrl(returnUrl))
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
47 return Redirect(returnUrl);
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
48 return RedirectToAction("Index", "Home");
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
49 }
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
50 }
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
51 ModelState.AddModelError("", "The user name or password provided is incorrect.");
10
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
52 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
53
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
54 // If we got this far, something failed, redisplay form
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
55 return View(model);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
56 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
57
90
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
58 public ActionResult TwitterLogOn()
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
59 {
94
db4b1e2cae49 Cambio del nombre de la clase Ponente a Persona
Nelo@Kenia.neluz.int
parents: 93
diff changeset
60 var oAuth = new OAuthTwitter();
90
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
61
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
62 if (Request["oauth_token"] == null)
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
63 {
92
7027cda13de3 Armado de la url de retorno en base a la url del request
Nelo@Kenia.neluz.int
parents: 90
diff changeset
64 var action = Url.Action("TwitterLogOn");
7027cda13de3 Armado de la url de retorno en base a la url del request
Nelo@Kenia.neluz.int
parents: 90
diff changeset
65 var url = Request.Url.Scheme + "://" + Request.Url.Host +
7027cda13de3 Armado de la url de retorno en base a la url del request
Nelo@Kenia.neluz.int
parents: 90
diff changeset
66 (Request.Url.Port != 80 ? ":" + Request.Url.Port : string.Empty) + action;
7027cda13de3 Armado de la url de retorno en base a la url del request
Nelo@Kenia.neluz.int
parents: 90
diff changeset
67
115
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
68 return Redirect(oAuth.AuthorizationLinkGet(url).ToString());
90
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
69 }
115
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
70
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
71 var response = oAuth.AccessTokenGet(Request["oauth_token"], Request["oauth_verifier"]);
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
72 if (response.Length > 0)
90
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
73 {
115
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
74 var username = OAuthTwitter.GetResponseContent(response, "screen_name");
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
75 var nombre = OAuthTwitter.GetResponseContent(response, "name");
90
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
76
115
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
77 var personaService = AgendaFactory.GetPersonaService();
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
78 personaService.CreateIfNotExist(IdentityProviderEnum.Twitter, username, nombre);
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
79
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
80 FormsService.SignIn(Identification.Map[(int)IdentityProviderEnum.Twitter]+username, false);
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
81 return RedirectToAction("Index", "Home");
90
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
82 }
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
83
115
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
84 ModelState.AddModelError("", "The user name or password provided is incorrect.");
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
85
90
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
86 return RedirectToAction("LogOn");
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
87 }
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
88
d1688622fa88 Autenticando con twitter (falta emprolijar el código, pero autentica!)
Nelo@Kenia.neluz.int
parents: 34
diff changeset
89 // **************************************
10
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
90 // URL: /Account/LogOff
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
91 // **************************************
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
92
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
93 public ActionResult LogOff()
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
94 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
95 FormsService.SignOut();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
96
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
97 return RedirectToAction("Index", "Home");
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
98 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
99
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
100 // **************************************
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
101 // URL: /Account/Register
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
102 // **************************************
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
103
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
104 public ActionResult Register()
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
105 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
106 ViewBag.PasswordLength = MembershipService.MinPasswordLength;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
107 return View();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
108 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
109
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
110 [HttpPost]
115
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
111 public ActionResult Register(RegisterModel model, string returnUrl)
10
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
112 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
113 if (ModelState.IsValid)
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
114 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
115 // Attempt to register the user
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
116 MembershipCreateStatus createStatus = MembershipService.CreateUser(model.UserName, model.Password, model.Email);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
117
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
118 if (createStatus == MembershipCreateStatus.Success)
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
119 {
96
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
120 var personaService = AgendaFactory.GetPersonaService();
115
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
121 if (personaService.CreateIfNotExist(IdentityProviderEnum.BuiltIn, model.UserName, model.Nombre))
96
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
122 {
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
123 FormsService.SignIn(Identification.Map[(int)IdentityProviderEnum.BuiltIn] + model.UserName, false);
115
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
124 if (Url.IsLocalUrl(returnUrl))
7a2eeb9e9bf9 Crear cuenta interna asociada
Nelo@Kenia.neluz.int
parents: 112
diff changeset
125 return Redirect(returnUrl);
96
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
126 return RedirectToAction("Index", "Home");
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
127 }
10
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
128 }
96
1eb5a0e531bf Funcionamiento con cuenta interna y con cuenta de twitter, falta unificar usuarios
Nelo@Kenia.neluz.int
parents: 94
diff changeset
129 ModelState.AddModelError("", AccountValidation.ErrorCodeToString(createStatus));
10
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
130 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
131
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
132 // If we got this far, something failed, redisplay form
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
133 ViewBag.PasswordLength = MembershipService.MinPasswordLength;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
134 return View(model);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
135 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
136
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
137 // **************************************
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
138 // URL: /Account/ChangePassword
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
139 // **************************************
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
140
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
141 [Authorize]
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
142 public ActionResult ChangePassword()
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
143 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
144 ViewBag.PasswordLength = MembershipService.MinPasswordLength;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
145 return View();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
146 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
147
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
148 [Authorize]
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
149 [HttpPost]
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
150 public ActionResult ChangePassword(ChangePasswordModel model)
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
151 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
152 if (ModelState.IsValid)
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
153 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
154 if (MembershipService.ChangePassword(User.Identity.Name, model.OldPassword, model.NewPassword))
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
155 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
156 return RedirectToAction("ChangePasswordSuccess");
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
157 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
158 else
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
159 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
160 ModelState.AddModelError("", "The current password is incorrect or the new password is invalid.");
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
161 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
162 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
163
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
164 // If we got this far, something failed, redisplay form
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
165 ViewBag.PasswordLength = MembershipService.MinPasswordLength;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
166 return View(model);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
167 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
168
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
169 // **************************************
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
170 // URL: /Account/ChangePasswordSuccess
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
171 // **************************************
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
172
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
173 public ActionResult ChangePasswordSuccess()
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
174 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
175 return View();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
176 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
177
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
178 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
179 }