public ActionResult RemoveUIModule(long ID, string authorize) { string message; if (string.IsNullOrWhiteSpace(authorize) || !ID.ToString().Equals(authorize)) { message = "You must check the proper authorize radio button first."; } else { ApplicationUser authedUser = UserManager.FindById(User.Identity.GetUserId()); IUIModule obj = TemplateCache.Get <IUIModule>(ID); if (obj == null) { message = "That does not exist"; } else if (obj.Remove(authedUser.GameAccount, authedUser.GetStaffRank(User))) { LoggingUtility.LogAdminCommandUsage("*WEB* - RemoveUIModule[" + ID.ToString() + "]", authedUser.GameAccount.GlobalIdentityHandle); message = "Delete Successful."; } else { message = "Error; Removal failed."; } } return(RedirectToAction("UIModules", new { Message = message })); }
public ActionResult Remove(long removeId = -1, string authorizeRemove = "", long unapproveId = -1, string authorizeUnapprove = "") { string message; if (!string.IsNullOrWhiteSpace(authorizeRemove) && removeId.ToString().Equals(authorizeRemove)) { ApplicationUser authedUser = UserManager.FindById(User.Identity.GetUserId()); IUIModule obj = TemplateCache.Get <IUIModule>(removeId); if (obj == null) { message = "That does not exist"; } else if (obj.Remove(authedUser.GameAccount, authedUser.GetStaffRank(User))) { LoggingUtility.LogAdminCommandUsage("*WEB* - RemoveUIModule[" + removeId.ToString() + "]", authedUser.GameAccount.GlobalIdentityHandle); message = "Delete Successful."; } else { message = "Error; Removal failed."; } } else if (!string.IsNullOrWhiteSpace(authorizeUnapprove) && unapproveId.ToString().Equals(authorizeUnapprove)) { ApplicationUser authedUser = UserManager.FindById(User.Identity.GetUserId()); IUIModule obj = TemplateCache.Get <IUIModule>(unapproveId); if (obj == null) { message = "That does not exist"; } else if (obj.ChangeApprovalStatus(authedUser.GameAccount, authedUser.GetStaffRank(User), ApprovalState.Returned)) { LoggingUtility.LogAdminCommandUsage("*WEB* - UnapproveUIModule[" + unapproveId.ToString() + "]", authedUser.GameAccount.GlobalIdentityHandle); message = "Unapproval Successful."; } else { message = "Error; Unapproval failed."; } } else { message = "You must check the proper remove or unapprove authorization radio button first."; } return(RedirectToAction("Index", new { Message = message })); }