private LogOn ( |
||
model | ||
returnUrl | string | |
return | System.Web.Mvc.ActionResult |
public ActionResult LogOn(LogOnModel model, string returnUrl)
{
if (ModelState.IsValid)
{
if (MembershipService.ValidateUser(model.UserName, model.Password))
{
FormsService.SignIn(model.UserName, model.RememberMe);
if (!String.IsNullOrEmpty(returnUrl))
{
return Redirect(returnUrl);
}
else
{
return RedirectToAction("Index", "Home");
}
}
else
{
ModelState.AddModelError("", "Nazwa użytkownika lub hasło jest niepoprawne.");
}
}
// If we got this far, something failed, redisplay form
return View(model);
}
AccountController::LogOn ( ) : System.Web.Mvc.ActionResult |