2014-10-11 06:57:02 +08:00
|
|
|
|
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
|
2014-11-01 03:28:16 +08:00
|
|
|
|
public ActionResult index()
|
2014-10-11 06:57:02 +08:00
|
|
|
|
{
|
2014-11-01 03:28:16 +08:00
|
|
|
|
return View(Membership.GetAllUsers().Cast<MembershipUser>().OrderByDescending(m => m.IsApproved).ThenBy(m => m.UserName));
|
2014-10-11 06:57:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
2014-11-01 03:28:16 +08:00
|
|
|
|
public ActionResult approve(Guid id)
|
2014-10-11 06:57:02 +08:00
|
|
|
|
{
|
|
|
|
|
var provider = (Membership.Provider as RedisMembershipProvider);
|
|
|
|
|
provider.ChangeApproval(id, true);
|
|
|
|
|
return RedirectToAction("Index");
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-01 03:28:16 +08:00
|
|
|
|
public ActionResult unapprove(Guid id)
|
2014-10-11 06:57:02 +08:00
|
|
|
|
{
|
|
|
|
|
var provider = (Membership.Provider as RedisMembershipProvider);
|
|
|
|
|
provider.ChangeApproval(id, false);
|
|
|
|
|
return RedirectToAction("Index");
|
|
|
|
|
}
|
2014-12-05 05:42:47 +08:00
|
|
|
|
|
|
|
|
|
public ActionResult @lock(Guid id)
|
|
|
|
|
{
|
|
|
|
|
var provider = (Membership.Provider as RedisMembershipProvider);
|
|
|
|
|
provider.ChangeLockStatus(id, true);
|
|
|
|
|
return RedirectToAction("Index");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ActionResult unlock(Guid id)
|
|
|
|
|
{
|
|
|
|
|
var provider = (Membership.Provider as RedisMembershipProvider);
|
|
|
|
|
provider.ChangeLockStatus(id, false);
|
|
|
|
|
return RedirectToAction("Index");
|
|
|
|
|
}
|
2014-10-11 06:57:02 +08:00
|
|
|
|
}
|
|
|
|
|
}
|