SharePointFBAPack icon indicating copy to clipboard operation
SharePointFBAPack copied to clipboard

Anonymous Targeting

Open ccoulson opened this issue 8 years ago • 3 comments

HuwSy[CodePlex]
As sharepoint doesnt easily allow targeting web parts to anonymous users can there be an option in these web parts to show to only anon users. As a logged in user doesnt need to see the register new user form or password reset forms and having this option would allow me to add these to the front page of the site and them both hide once logged in. Thanks

ccoulson avatar Oct 31 '17 16:10 ccoulson

HuwSy[CodePlex]
A slightly more useful mod to the code as follows; if (!Page.User.Identity.IsAuthenticated) AddCreateUserControl(); else if (WebPartManager.DisplayMode != WebPartManager.EditDisplayMode) this.ChromeType = PartChromeType.None; else this.ChromeType = PartChromeType.TitleOnly;

ccoulson avatar Oct 31 '17 16:10 ccoulson

HuwSy[CodePlex]
Using IsAuthenticated I have modified the membership request and password recovery *webpart.cs locally to something like; if (!Page.User.Identity.IsAuthenticated) AddCreateUserControl(); else this.ChromeType = PartChromeType.None;

This also seems to fix an issue where having create membership and a content viewer web parts on the same page I could never save the content viewer because of the hip image refreshing it seems. Not an ideal solution for all so Iv not posted as a patch but it shall do for the test page I have with a similarly hidden login web part.

ccoulson avatar Oct 31 '17 16:10 ccoulson

ccoulson[CodePlex]
Why not put the web parts on seperate pages with links to the pages? Potentially you could show/hide the links with code like:

Register (register.aspx)

Or just put the links on the login page - that's the only time you should really need them anyways.

ccoulson avatar Oct 31 '17 16:10 ccoulson