Add UserList

This commit is contained in:
2023-01-27 09:36:14 -05:00
parent 4e3daa7320
commit 8e16510ad9
4 changed files with 39 additions and 1 deletions
+16 -1
View File
@@ -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");
}
+17
View File
@@ -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>
+2
View File
@@ -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>