locked
redirect to web site on the basis of user group RRS feed

  • Question

  •  hi

    I have a requirement from client.

    On the basis of user group, user should redirect automatically to site.

    example :

    There is 2 user group in SharePoint A & B, also there is 2 sites site1 and site 2.

    User of group A should redirect to site1 on login to system.

    User of group B Should redirect to site2 on login to system.

    Thanks in advance.  

    Friday, January 25, 2013 5:06 AM

Answers

  • You can also use a generic landing page for this functionality which has a web part on the page that does the check/redirect. The generic landing page method is lower touch than building your own login page and allows you access to the SPContext.Current.Web.Groups["GroupName"].ContainsCurrentUser object which is only available once a user is authenticated (i.e. after login). :)

    Also gives you the benefit of simpler administration, I typically have a sharepoint list on this kind of landing page's site that gives group names and destinations.


    My CodePlex - My Blog - My Twitter

    • Proposed as answer by Sachin Dagar Friday, January 25, 2013 8:47 AM
    • Marked as answer by Emir Liu Thursday, January 31, 2013 6:49 AM
    Friday, January 25, 2013 7:39 AM

All replies

  • Hi,

    You need to develop custom Login page to achive this functionality. You can check user within SharePoint group using following syntex.

    SPContext.Current.Web.Groups["Group1"].ContainsCurrentUser

    Did you find this Helpful? Please Mark it So! Thank you. Sachin Kumar

    Friday, January 25, 2013 7:26 AM
  • Hi,

    You can take help of following thread.

    http://social.msdn.microsoft.com/Forums/en/sharepointcustomization/thread/fd5bb5c7-51ad-4e24-8d09-16ed32f4045f


    Did you find this Helpful? Please Mark it So! Thank you. Sachin Kumar

    Friday, January 25, 2013 7:28 AM
  • You can also use a generic landing page for this functionality which has a web part on the page that does the check/redirect. The generic landing page method is lower touch than building your own login page and allows you access to the SPContext.Current.Web.Groups["GroupName"].ContainsCurrentUser object which is only available once a user is authenticated (i.e. after login). :)

    Also gives you the benefit of simpler administration, I typically have a sharepoint list on this kind of landing page's site that gives group names and destinations.


    My CodePlex - My Blog - My Twitter

    • Proposed as answer by Sachin Dagar Friday, January 25, 2013 8:47 AM
    • Marked as answer by Emir Liu Thursday, January 31, 2013 6:49 AM
    Friday, January 25, 2013 7:39 AM