diff Agendas/trunk/src/Agendas.Web/Controllers/AccountController.cs @ 179:1deccd6c3cb2

Aplicando seguridad x roles en sitio web
author nelopauselli
date Mon, 08 Aug 2011 15:24:26 -0300
parents 3c70b0d8bd69
children beeb06da4398
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Web/Controllers/AccountController.cs	Mon Aug 08 12:30:37 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Controllers/AccountController.cs	Mon Aug 08 15:24:26 2011 -0300
@@ -1,24 +1,21 @@
 using System.Web.Mvc;
 using System.Web.Routing;
-using System.Web.Security;
 using AltNetHispano.Agendas.Domain;
 using AltNetHispano.Agendas.Factories;
 using AltNetHispano.Agendas.Twitter;
-using AltNetHispano.Agendas.Web.Models;
 using AltNetHispano.Agendas.Web.Services;
 
 namespace AltNetHispano.Agendas.Web.Controllers
 {
     public class AccountController : Controller
     {
-
-        public IFormsAuthenticationService FormsService { get; set; }
+    	private IFormsAuthenticationService _formsService;
 
         protected override void Initialize(RequestContext requestContext)
         {
-            if (FormsService == null) { FormsService = new FormsAuthenticationService(); }
-
-            base.Initialize(requestContext);
+            if (_formsService == null) { _formsService = new FormsAuthenticationService(); }
+            
+			base.Initialize(requestContext);
         }
 
         public ActionResult LogOn()
@@ -60,7 +57,7 @@
 				var personaService = AgendaFactory.GetPersonaService();
 				personaService.CreateIfNotExist(IdentityProviderEnum.Twitter, username, nombre);
 
-				FormsService.SignIn(Identification.Map[(int)IdentityProviderEnum.Twitter]+username, false);
+				_formsService.SignIn(Identification.Map[(int)IdentityProviderEnum.Twitter]+username, false);
 				return RedirectToAction("Index", "Home");
 			}
 
@@ -71,7 +68,7 @@
 
         public ActionResult LogOff()
         {
-            FormsService.SignOut();
+            _formsService.SignOut();
             return RedirectToAction("Index", "Home");
         }
     }