Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Emil Badh 8 posts 29 karma points
    Nov 27, 2009 @ 13:51
    Emil Badh
    0

    Server.Transfer equivalent.

    I'm building a site in which members are organized into clubs. There are three different user groups, (roles) they are member (for regular members), club administrator (a person that is in charge of a club) and site administrators (that can handle things that are common for all clubs).

    A club is basically a document of the document type club and a members club membership is stored as an int with the id of the club page. (If done from the back end it's set with a content picker.)

    Below a club page I want to display pages that are visible only to the members of that club. Now this sound like the schoolbook example of a usergroup and using the public access functionality but I don't want to create two member groups for every club as there might eventually be hundreds of club and the work to maintain the security for each subpage would be too much.

    So, what I've done is to write an xslt macro that checks if the the club page id associated with the member can be found as an ancestor of the current page. I'd like to use the standard behavior of role based security (show the login page if not logged on and an error page if of the wrong club).

    I could achieve this with a Response.Redirect() but I would like the user to return to the restricted page once logged on and that doesn't happen (at least not right now...).

    So, if anyone could help me with a way to make the user return after being redirected to the login page that would be swell.

    Thanks in advance.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Nov 27, 2009 @ 14:27
    Sebastiaan Janssen
    0

    What I've always done with these kinds of redirects is added the URL (to redirect to later) to the session, during login, I check if the session variable is filled, I remove it and then redirect to the requested page. Pretty easy to implement.

  • Emil Badh 8 posts 29 karma points
    Nov 27, 2009 @ 14:40
    Emil Badh
    0

    I feel kinda stupid now. I've done exactly this dozens of times before. I guess I was a little stuck on wanting the same smooth transfers as the role based security functionality offers...

    Thanks!

  • Murray Roke 503 posts 966 karma points c-trib
    May 27, 2010 @ 02:29
    Murray Roke
    0

    For those searching in future, to do a "Server.Transfer" equivalent in code behind, you can do something like this:

    Response.Write(umbraco.library.RenderTemplate(1234));
    Response.End();
Please Sign in or register to post replies

Write your reply to:

Draft