Prefixed built in controllers to better avoid conflicts with people's custom code
This commit is contained in:
28
src/Umbraco.Web/Controllers/UmbLoginController.cs
Normal file
28
src/Umbraco.Web/Controllers/UmbLoginController.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using umbraco.cms.businesslogic.member;
|
||||
using Umbraco.Web.Models;
|
||||
using Umbraco.Web.Mvc;
|
||||
|
||||
namespace Umbraco.Web.Controllers
|
||||
{
|
||||
public class UmbLoginController : SurfaceController
|
||||
{
|
||||
[HttpPost]
|
||||
public ActionResult HandleLogin([Bind(Prefix="loginModel")]LoginModel model)
|
||||
{
|
||||
// TODO: Use new Member API
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
var m = Member.GetMemberFromLoginNameAndPassword(model.Username, model.Password);
|
||||
if (m != null)
|
||||
{
|
||||
Member.AddMemberToCache(m);
|
||||
return Redirect("/");
|
||||
}
|
||||
}
|
||||
|
||||
return CurrentUmbracoPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user