public AUser GetZTOPAccount(string SAMAccountName) { var user = ADController.GetUser(SAMAccountName); if (user.Type == GroupType.Guest) { return(user); } user.Managers = Core.AuthorizeManager.GetList(user.Name); user.MGroup = ADController.GetGroupList(SAMAccountName); if (ADController.IsAdministrator(user)) { user.Type = GroupType.Administrator; } else if (ADController.IsManager(user)) { user.Type = GroupType.Manager; } else { if (user.Managers != null && user.Managers.Count != 0) { user.Type = GroupType.Manager; } else { user.Type = GroupType.Member; } } return(user); }
public User Get(UserIdentity Identity) { return(new User() { Name = Identity.Name, MGroup = ADController.GetGroupList(Identity.Name) }); }
/// <summary> /// 管理员查看申请权限记录以及进行审核 /// </summary> /// <returns></returns> public ActionResult Manager() { var groups = ADController.GetGroupList(); ViewBag.Wait = Core.DataBookManager.Get(groups, CheckStatus.Wait); ViewBag.DGroups = ADController.GetUserDict(groups); return(View()); }
public ActionResult Manager(int ID, string Reason, int?Day, bool?Check, CheckStatus status = CheckStatus.Wait) { Core.DataBookManager.Check(ID, Reason, Identity.Name, Day, Check, status); var groups = ADController.GetGroupList(); ViewBag.Wait = Core.DataBookManager.Get(groups, CheckStatus.Wait); ViewBag.DGroups = ADController.GetUserDict(groups); return(View()); }
public ActionResult Manager(int ID, string Reason, int?Day, bool?Check, CheckStatus status = CheckStatus.Wait) { Core.DataBookManager.Check(ID, Reason, sAMAccountName, Day, Check, status); Core.MessageManager.Add(Core.DataBookManager.Get(ID), ADController.GetNameBysAMAccountName(sAMAccountName)); var groups = ADController.GetGroupList(); ViewBag.Wait = Core.DataBookManager.Get(groups, CheckStatus.Wait); ViewBag.DGroups = ADController.GetUserDict(groups); return(View()); }
public ActionResult Impower(Authorize authorize) { try { Core.AuthorizeManager.Add(Core.AuthorizeManager.Get(HttpContext)); } catch (Exception ex) { throw new ArgumentException(ex.Message); } ViewBag.List = Core.AuthorizeManager.GetList(); ViewBag.Groups = ADController.GetGroupList().ListToTable(); return(View()); }
public ActionResult Manager(int ID, string Reason, int?Day, bool?Check, CheckStatus status = CheckStatus.Wait) { var book = Core.DataBookManager.Check(ID, Reason, Identity.Name, Day, Check, status); Core.MessageManager.Add(new Message { Sender = Identity.Name, Info = string.Format("申请{0}的权限已经确认!", book.GroupName), Receiver = book.Name }); var groups = ADController.GetGroupList(); ViewBag.Wait = Core.DataBookManager.Get(groups, CheckStatus.Wait); if (Identity.GroupType == GroupType.Manager) { ViewBag.DGroups = ADController.GetUserDict(groups); } return(View()); }
public ActionResult Manager() { List <string> groups; //获取我管理的组 if (ADController.IsManager(LUser)) { groups = ADController.GetGroupList(); } else { groups = Core.AuthorizeManager.GetList(ADController.GetNameBysAMAccountName(sAMAccountName)); } //获取当前管理组的权限审核列表 ViewBag.Wait = Core.DataBookManager.Get(groups, CheckStatus.Wait); ViewBag.DGroups = ADController.GetUserDict(groups); return(View()); }
public ActionResult Manager(int ID, string Reason, int?Day, bool?Check, CheckStatus status = CheckStatus.Wait) { Core.DataBookManager.Check(ID, Reason, sAMAccountName, Day, Check, status); Core.MessageManager.Add(Core.DataBookManager.Get(ID), ADController.GetNameBysAMAccountName(sAMAccountName)); //待审批列表 List <string> groups; if (ADController.IsManager(LUser)) { groups = ADController.GetGroupList(); } else { groups = Core.AuthorizeManager.GetList(ADController.GetNameBysAMAccountName(sAMAccountName)); } ViewBag.Wait = Core.DataBookManager.Get(groups, CheckStatus.Wait); ViewBag.DGroups = ADController.GetUserDict(groups); return(View()); }
public User GetWindowsAccount(string sAMAccountName) { if (string.IsNullOrEmpty(sAMAccountName)) { return(null); } var user = ADController.GetUser(sAMAccountName); if (user.Type == GroupType.Guest) { return(user); } user.Managers = Core.AuthorizeManager.GetList(user.Name); user.MGroup = ADController.GetGroupList(sAMAccountName); if (ADController.IsAdministrator(user)) { user.Type = GroupType.Administrator; } else if (ADController.IsManager(user)) { user.Type = GroupType.Manager; } else { if (user.Managers.Count != 0) { user.Type = GroupType.Manager; } else { user.Type = GroupType.Member; } } return(user); }