fixes user's auto-deletion :-)
This commit is contained in:
@ -1,8 +1,12 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace Yavsc.ViewModels.Account
|
namespace Yavsc.ViewModels.Account
|
||||||
{
|
{
|
||||||
public class UnregisterViewModel
|
public class UnregisterViewModel
|
||||||
{
|
{
|
||||||
|
[Required]
|
||||||
public string UserId { get; set; }
|
public string UserId { get; set; }
|
||||||
|
|
||||||
public string ReturnUrl { get; set; }
|
public string ReturnUrl { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -687,7 +687,7 @@ namespace Yavsc.Controllers
|
|||||||
[HttpGet, Authorize]
|
[HttpGet, Authorize]
|
||||||
public IActionResult Delete()
|
public IActionResult Delete()
|
||||||
{
|
{
|
||||||
return View();
|
return View(new UnregisterViewModel { UserId = User.GetUserId() });
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet, Authorize("AdministratorOnly")]
|
[HttpGet, Authorize("AdministratorOnly")]
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<form asp-controller="Account" asp-action="Delete" method="post" class="form-horizontal" role="form">
|
<form asp-controller="Account" asp-action="Delete" method="post" class="form-horizontal" role="form">
|
||||||
|
|
||||||
@Html.Hidden("ReturnUrl")
|
@Html.Hidden("ReturnUrl")
|
||||||
|
@Html.Hidden("UserId")
|
||||||
<input type="submit" value="@SR["Unregister"]" class="btn btn-default"/>
|
<input type="submit" value="@SR["Unregister"]" class="btn btn-default"/>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user