Factoring out Constants.AdminPane and Constants.HostUser

This commit is contained in:
Tony Valenti
2020-10-16 10:23:17 -05:00
parent becc779db8
commit f33fb4d001
8 changed files with 35 additions and 14 deletions

View File

@ -216,7 +216,7 @@ else
private string _username = string.Empty;
private string _password = string.Empty;
private bool _integratedsecurity = true;
private string _hostusername = Constants.HostUser;
private string _hostusername = UserNames.Host;
private string _hostpassword = string.Empty;
private string _name = string.Empty;
@ -311,7 +311,7 @@ else
// validate host credentials
var user = new User();
user.SiteId = PageState.Site.SiteId;
user.Username = Constants.HostUser;
user.Username = UserNames.Host;
user.Password = _hostpassword;
user = await UserService.LoginUserAsync(user, false, false);
if (user.IsAuthenticated)

View File

@ -31,7 +31,7 @@ else
protected override void OnParametersSet()
{
if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions) && Name != Constants.AdminPane)
if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions) && Name != PaneNames.Admin)
{
_useadminborder = true;
_paneadminborder = "app-pane-admin-border";
@ -47,7 +47,7 @@ else
{
if (PageState.ModuleId != -1 && PageState.Action != Constants.DefaultAction)
{
if (Name.ToLower() == Constants.AdminPane.ToLower())
if (Name.ToLower() == PaneNames.Admin.ToLower())
{
Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
if (module != null && !module.IsDeleted)

View File

@ -505,7 +505,7 @@
// ensure module's pane exists in current page and if not, assign it to the Admin pane
if (page.Panes == null || page.Panes.FindIndex(item => item.Equals(module.Pane, StringComparison.OrdinalIgnoreCase)) == -1)
{
module.Pane = Constants.AdminPane;
module.Pane = PaneNames.Admin;
}
// calculate module position within pane