init
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Exceptions;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Adminisztracio.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Helpers.ReCaptcha;
|
||||
|
||||
namespace Kreta.Web.Areas.Adminisztracio.Controllers
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class ElfelejtettJelszoController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View(new ElfelejtettJelszoModel());
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public JsonResult LinkKuldes(ElfelejtettJelszoModel model)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
Response.StatusCode = 400;
|
||||
Response.TrySkipIisCustomErrors = true;
|
||||
|
||||
var modelErrors = ModelState.AllErrors();
|
||||
return Json(modelErrors);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var captcha = ReCaptchaValidator.Validate(model.ReCaptcha);
|
||||
if (!captcha.Success)
|
||||
{
|
||||
return Json(new IsSuccessResponseCo(false, string.Join(",", captcha.ErrorCodes)));
|
||||
}
|
||||
|
||||
new JelszoModositasLinkHelper(ConnectionTypeExtensions.GetOrganizationConnectionType()).JelszoValtoztatoLinkGeneralasEsKuldes(model.BejelentkezesiNev, model.EmailCim);
|
||||
}
|
||||
catch (KretaJelszoModositasException e)
|
||||
{
|
||||
return Json(new IsSuccessResponseCo(false, e.Message));
|
||||
}
|
||||
|
||||
return Json(new IsSuccessResponseCo(true, AdminisztracioResource.SikeresElfelejtettJelszoFeedback));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user