Add UserList
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System.Web.Mvc;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Security;
|
||||
using Hangfire;
|
||||
using LeafWeb.WebCms.Models;
|
||||
@@ -6,6 +8,7 @@ using LeafWeb.WebCms.Services;
|
||||
using log4net;
|
||||
using MlkPwgen;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Web.Mvc;
|
||||
|
||||
namespace LeafWeb.WebCms.Controllers
|
||||
{
|
||||
@@ -208,5 +211,17 @@ namespace LeafWeb.WebCms.Controllers
|
||||
|
||||
return Redirect(redirectUrl);
|
||||
}
|
||||
|
||||
[MemberAuthorize(AllowGroup = "Administrator")]
|
||||
public ActionResult UserList()
|
||||
{
|
||||
var emails
|
||||
= from li in DataService.GetLeafInputs()
|
||||
group li by li.Email
|
||||
into emailGroup
|
||||
select new { emailGroup.Key, emailGroup.FirstOrDefault().Name };
|
||||
|
||||
return View(emails.ToList().Select(e => new Tuple<string, string>(e.Name, e.Key)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@{
|
||||
Html.RenderAction("UserList", "Membership");
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
@model IEnumerable<Tuple<string,string>>
|
||||
|
||||
<div class="container mt-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 ">
|
||||
<table>
|
||||
|
||||
@foreach (var m in Model)
|
||||
{
|
||||
<tr>
|
||||
<th>@m.Item1</th><th>@m.Item2</th>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1082,6 +1082,8 @@
|
||||
<Content Include="Views\Shared\PermissionDenied.cshtml" />
|
||||
<Content Include="Views\Shared\ModelStateErrors.cshtml" />
|
||||
<Content Include="Views\MacroPartials\BannerAlert.cshtml" />
|
||||
<Content Include="Views\Membership\UserList.cshtml" />
|
||||
<Content Include="Views\MacroPartials\Membership\UserList.cshtml" />
|
||||
<None Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</None>
|
||||
|
||||
Reference in New Issue
Block a user