+1-888-365-2779
Try Now
More in this section

Forums / 3.x Pre-release forums (retired) / Public users registration

Public users registration

8 posts, 0 answered
  1. Vangelis
    Vangelis avatar
    153 posts
    Registered:
    07 Jan 2006
    04 Mar 2007
    Link to this post
    Hi,

    In previous version 2 of Sitefinity had been initiated the public users registration. Now in version 3 how it is going to work? The internal users will be held together with the public users at the same place of the site or there will be in some other place of administration? Also the registration will be automatic or will have the option of some action before? Also in public users it is necessary to have the option to distinguish active and inactive users.

    Some clarification would be helpful at this point, since the ability to have portions of a site for registered members is desirable.

    Best regards

    Vagelis
  2. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    05 Mar 2007
    Link to this post
    I haven't tried it yet so this may be a bit premature, but can't you just create Role called publicUsers? Then copy the asp:login from the Login.aspx page and put it in your login control on your page.
  3. UI Crew
    UI Crew avatar
    99 posts
    Registered:
    24 Sep 2012
    05 Mar 2007
    Link to this post
    Hi,

    Bob from telerik answered this question in my post a couple of days ago.

    http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-tccha.aspx

    Thanks

    Seth
  4. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    05 Mar 2007
    Link to this post
    Hi,

    Currently, Sitefinity doesn't provide an out-of-the box functionality for public users registration.
    We just say that Sitefinity supports Membership services and all its functionality. So, to have a registration form on your site, you just need to create a user control and place an ASP.NET CreateUserWizard control in it. Also, you may need to code some logic in the user control, i.e. when the user is created add him to specific role(s).

    As for the public users data store, there are different cases:
      - store public users in the same database as Cms users using the same membership provider (add all public users to a specific role, e.g. 'public')
      - store public users in the same database as Cms users using different membership provider.
      - store public users in different databases.

    No matter which option you choose, you will need to configure the Membership provider and the ASP.NET Membership controls (CreateUserWizard, Login, ChangePassword,...) to achieve the desired behavior.

    We have plans to create a module for public users in the future versions of Sitefinity.

    Let us know if you need more information about implementing Public users.

    Regards,
    Vlad
    the telerik team
  5. Shaun Mitchem
    Shaun Mitchem avatar
    12 posts
    Registered:
    05 Aug 2003
    16 Mar 2007
    Link to this post
    Hi Vlad -

    A bit more help on this would be greatly appreciated! 

    We have a very a standard situation - i.e. a members-only section of our web site.  We already have a large user database with lots of multi-table profile data ("which newspapers do you read" etc), so using the built in profile system is realistic so we have implemented our own membership provider to handle these public users. This is something we have done several times before on non-sitefinity sites, so nothing scary there)

    Our problems are arising from distinguishing between the two types of login.  Within web.config there is an authentication section that sets the LoginURL to "Login.aspx". The login control on this page is set to use your membership provider so we obvioiusly need a seperate login page for the public users (which we have called LoginUser.aspx) that is set to use our membership provider.  Obviously all logons are directed to your logon page, so we need to redirect the "non-admin" logons to our logon page - we have done this by checking to see if the value for ReturnURL DOES NOT contain the string "admin" and, if so, redirect to our logon page:

    if (!Request.RawUrl.ToLower().Contains("admin"))
    {
        string ReturnUrl = Request.QueryString["ReturnUrl"].ToString();

        Response.Redirect("~/LoginUser.aspx?ReturnUrl=" + ReturnUrl);
    }

    This solution does work, but it seems like a bit of a hack - my first question is, are we missing something obvious - is there a more elegant way of doing this?

    The second part to my question is an error that is resulting from what we are trying to do.

    We have a situtaion where a "front end" web site user is able to add a piece of content to the site, but this has to be approved by the administrator of the site before it is published. The content is in a SiteFinity module and the administrator needs to tick a checkbox on the module form to approve it to be puclished.  To notify the admin, when a frontend user submits a bit of content, we are sending them an email to say "a new piece of content has been added, click on the link below to approve it"

    The link is of the form:

    http://SiteDomain/Admin/Modules.aspx?module=ModuleName&id=21

    If the administrator isnt logged on (to either the /Admin application or the frontend "members only" section) this works fine - the request is redirected to /Login.aspx, they login and ReturnURL then redirects them to the correct address.  Equally, if the administrator IS logged into the /Admin application, it goes straight through to the correct page.

    However, if the administrator is logged in to the frontend "members only" section, clicking on the link goes through to the correct address within the admin section, but comes up with an errror (abbreviated below):

    Object reference not set to an instance of an object.

    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
    System.Web.Security.RolePrincipal.IsInRole(String role) +277
    System.Web.Configuration.AuthorizationRule.IsTheUserInAnyRole(StringCollection roles, IPrincipal principal) +120
    System.Web.Configuration.AuthorizationRule.IsUserAllowed(IPrincipal user, String verb) +300
    System.Web.Configuration.AuthorizationRuleCollection.IsUserAllowed(IPrincipal user, String verb) +191
    System.Web.Security.UrlAuthorizationModule.OnEnter(Object source, EventArgs eventArgs) +3403102
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

    I can see why this is happening - the user is "logged in" (so isnt redirected to /Login.aspx) but they are logged in to the wrong membership database so when you come to check the roles for that user, non exist (or the right ones dont exist - you would understand more than me) and it throws an error.

    Are these two problems related? I have a feeling that, if we implemented a more elegant overall membership solution that didnt involve two seperate logons, the error wouldnt happen, so any pointers you could give to the best way of implementing a solution to this situation (members-only frontend section with a seperate user database) would be greatly appreciated.  However, if we are doing it in basically the "correct" way, can you suggest how we stop that error arising, or is that a "bug" for you to fix?

    Thanks for your help

    - Shaun
  6. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    19 Mar 2007
    Link to this post
    Hi Shaun,

    Thank you for bringing these problems to our attention. 

    As for the first one, currently we cannot suggest a better solution than those provided by you, since you are not able to set a different loginURL for the different providers. We will address this issue in the future by implementing a custom solution for our login form.

    As for the second issue, related to the 'Object reference not set to an instance of an object' error, we discovered a problem with the RoleManagerModule (this is an http module in the ASP.NET Framework, which is responsible for creating a RolePrinciple object for the current thread). So when the RolePrinciple object is created, it is always created with the default RoleProvider.
    Currently, you can use one of the following workarounds:
     - use only one RoleProvider for the Sitefinity and the front-end Membership users.
     - find a way to create a new RolePrincipal object for the current thread specifying the RoleProvider in the constructor. You should do this in the LoginUser.aspx, when the user is logged.

    Still we will do some further research, development and testing to avoid such problems with the official release.
    Sorry for the inconvenience.

    Regards,
    Vlad
    the telerik team
  7. Shaun Mitchem
    Shaun Mitchem avatar
    12 posts
    Registered:
    05 Aug 2003
    19 Mar 2007
    Link to this post
    thanks for this - just to be clear - the second issue is a bug at your end that you are going to fix in the next release (or are you saying it is a microsoft issue)? I can work round it for the meantime if i know there is a fix on the way

    cheers

    - shaun
  8. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    20 Mar 2007
    Link to this post
    Hello Shaun,

    Sorry for not being clearer.
    Perhaps it was not enough clear for us too. Today we did more testing and discovered a bug in our RoleProvider, which is the main reason for the error below. It is already addressed and will be fixed in the next release of Sitefinity.

    Thanks again for reporting this issue. Your telerik points have been updated.

    Greetings,
    Vlad
    the telerik team
Register for webinar
8 posts, 0 answered