From ecad2a7209754729254328fce5d4c5bf9149aa07 Mon Sep 17 00:00:00 2001 From: ccoulson Date: Thu, 22 Jan 2015 14:34:36 -0500 Subject: [PATCH] Merge SharePoint 2010 FBA Pack Changes --- .../Code/ChangePasswordMenuItem.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Visigo.Sharepoint.FormsBasedAuthentication/Visigo.Sharepoint.FormsBasedAuthentication/Code/ChangePasswordMenuItem.cs b/Visigo.Sharepoint.FormsBasedAuthentication/Visigo.Sharepoint.FormsBasedAuthentication/Code/ChangePasswordMenuItem.cs index fae541e..01eda8d 100644 --- a/Visigo.Sharepoint.FormsBasedAuthentication/Visigo.Sharepoint.FormsBasedAuthentication/Code/ChangePasswordMenuItem.cs +++ b/Visigo.Sharepoint.FormsBasedAuthentication/Visigo.Sharepoint.FormsBasedAuthentication/Code/ChangePasswordMenuItem.cs @@ -28,22 +28,27 @@ protected override void CreateChildControls() } } - MembershipSettings setting = null; + + string changePasswordPage = ""; SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite(SPContext.Current.Site.ID, SPContext.Current.Site.Zone)) { - setting = new MembershipSettings(site.RootWeb); + MembershipSettings setting = new MembershipSettings(site.RootWeb); + + if (setting == null || string.IsNullOrEmpty(setting.ChangePasswordPage)) + return; + + changePasswordPage = setting.ChangePasswordPage; } }); - if (setting == null || string.IsNullOrEmpty(setting.ChangePasswordPage)) - return; + // generate return url string source = SPUtility.OriginalServerRelativeRequestUrl; - string target = Utils.GetAbsoluteURL(SPContext.Current.Web, setting.ChangePasswordPage); + string target = Utils.GetAbsoluteURL(SPContext.Current.Web, changePasswordPage); MenuItemTemplate changePasswordItem = new MenuItemTemplate(); changePasswordItem.Text = LocalizedString.GetString("FBAPackMenus", "FBAChangePassword_Title");