Skip to content

Commit

Permalink
Merge pull request #4882 from dnnsoftware/release/9.10.2
Browse files Browse the repository at this point in the history
Merging back latest fixed from 9.10.2 RC into develop
  • Loading branch information
valadas authored Oct 20, 2021
2 parents 00d61d7 + 3955e96 commit 05544c7
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,11 @@ public HttpResponseMessage GetDefaultPagesSettings(int? portalId, string culture
}

var portal = PortalController.Instance.GetPortal(pid, cultureCode);
var localizedPortalSettings = PortalController.Instance.GetPortalSettings(portal.PortalID, cultureCode);
var localizedPortalSettings = PortalController.Instance.GetPortalSettings(pid, cultureCode);

int redirectAfterLoginTabId = int.TryParse(localizedPortalSettings["Redirect_AfterLogin"], out redirectAfterLoginTabId) ? redirectAfterLoginTabId : -1;
int redirectAfterLogoutTabId = int.TryParse(localizedPortalSettings["Redirect_AfterLogout"], out redirectAfterLogoutTabId) ? redirectAfterLogoutTabId : -1;
int redirectAfterRegistrationTabId = int.TryParse(localizedPortalSettings["Redirect_AfterRegistration"], out redirectAfterRegistrationTabId) ? redirectAfterRegistrationTabId : -1;
int redirectAfterLoginTabId = this.GetLocalizedTabIdSetting(localizedPortalSettings, "Redirect_AfterLogin");
int redirectAfterLogoutTabId = this.GetLocalizedTabIdSetting(localizedPortalSettings, "Redirect_AfterLogout");
int redirectAfterRegistrationTabId = this.GetLocalizedTabIdSetting(localizedPortalSettings, "Redirect_AfterRegistration");

return this.Request.CreateResponse(HttpStatusCode.OK, new
{
Expand Down Expand Up @@ -3582,5 +3582,17 @@ private int ValidateTabId(int tabId, int portalId)
var tab = TabController.Instance.GetTab(tabId, portalId);
return tab != null && !tab.IsDeleted ? tab.TabID : Null.NullInteger;
}

private int GetLocalizedTabIdSetting(Dictionary<string, string> localizedPortalSettings, string settingKey)
{
var settingValue = string.Empty;
if (localizedPortalSettings.TryGetValue(settingKey, out settingValue))
{
int tabId = int.TryParse(settingValue, out tabId) ? tabId : -1;
return tabId;
}

return -1;
}
}
}

0 comments on commit 05544c7

Please sign in to comment.