2013-08-28 13:36:04 +02:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Web.Mvc;
|
2014-01-28 13:07:25 +11:00
|
|
|
|
using System.Web.Security;
|
2013-08-28 13:36:04 +02:00
|
|
|
|
using umbraco.cms.businesslogic.member;
|
|
|
|
|
|
using Umbraco.Web.Models;
|
|
|
|
|
|
using Umbraco.Web.Mvc;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Controllers
|
|
|
|
|
|
{
|
2014-01-28 13:47:16 +11:00
|
|
|
|
public class UmbLoginStatusController : SurfaceController
|
2013-08-28 13:36:04 +02:00
|
|
|
|
{
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public ActionResult HandleLogout([Bind(Prefix = "loginStatusModel")]LoginStatusModel model)
|
|
|
|
|
|
{
|
2014-01-28 13:07:25 +11:00
|
|
|
|
if (ModelState.IsValid == false)
|
2013-08-28 13:36:04 +02:00
|
|
|
|
{
|
2014-01-28 13:07:25 +11:00
|
|
|
|
return CurrentUmbracoPage();
|
|
|
|
|
|
}
|
2013-08-28 13:36:04 +02:00
|
|
|
|
|
2014-01-28 19:41:21 +11:00
|
|
|
|
if (Members.IsLoggedIn())
|
2014-01-28 13:07:25 +11:00
|
|
|
|
{
|
|
|
|
|
|
FormsAuthentication.SignOut();
|
2013-08-28 13:36:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2014-01-28 13:07:25 +11:00
|
|
|
|
//TODO: Shouldn't we be redirecting to the current page or integrating this with the
|
|
|
|
|
|
// normal Umbraco protection stuff?
|
|
|
|
|
|
return Redirect("/");
|
2013-08-28 13:36:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|