mirror of
https://gitlab.com/buildfeed/BuildFeed.git
synced 2024-03-22 21:10:34 +08:00
34 lines
995 B
C#
34 lines
995 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Mvc;
|
|
using System.Web.Security;
|
|
using BuildFeed.Auth;
|
|
|
|
namespace BuildFeed.Areas.admin.Controllers
|
|
{
|
|
[Authorize(Users = "hounsell")]
|
|
public class usersController : Controller
|
|
{
|
|
// GET: admin/users
|
|
public ActionResult index()
|
|
{
|
|
return View(Membership.GetAllUsers().Cast<MembershipUser>().OrderByDescending(m => m.IsApproved).ThenBy(m => m.UserName));
|
|
}
|
|
|
|
public ActionResult approve(Guid id)
|
|
{
|
|
var provider = (Membership.Provider as RedisMembershipProvider);
|
|
provider.ChangeApproval(id, true);
|
|
return RedirectToAction("Index");
|
|
}
|
|
|
|
public ActionResult unapprove(Guid id)
|
|
{
|
|
var provider = (Membership.Provider as RedisMembershipProvider);
|
|
provider.ChangeApproval(id, false);
|
|
return RedirectToAction("Index");
|
|
}
|
|
}
|
|
} |