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

Forums / Set-up & Installation / public users, member users, admin users

public users, member users, admin users

6 posts, 0 answered
  1. mexner
    mexner avatar
    98 posts
    Registered:
    06 Apr 2006
    07 Oct 2007
    Link to this post
    Hello, I'm trying to build a site for a university where the students would be able to access a private "student" section.  Among other various abilities, one of the items a student will be able to do is to update their profile information and access all the other students profile information.

    The profile information will include a few more fields than what SF offers by default, but that is no problem, as the DEV manual illustrates how to update the profile provider with additional fields (like, "Birthday, Phone number, etc).

    Of course, we don't want the student having access to the admin area of the site (~/sitefinity/) either.

    Using v 3.1, is it necessary to create a new (custom) membership provider? I just want to make sure that students will not have access to the admin area at all.  I would prefer them to use a separate login control/screen, and be directed to a protected area of the website (Student Section) when the log in.

    So the site will have 3 permission areas
    -public
    -Student section (student login required), not allowed to view admin area.
    -admins - everything inside of ~/sitefinity)

    With all the new controls released in SF v 3.1, what is the best approach to do this?
     - create a new membership provider? And/Or a new Profile provider?
     - create a custom login control for students?
     - use the new permissions inside of SF admin area?

    Your feedback is much appreciated!
    Thanks,


  2. mexner
    mexner avatar
    98 posts
    Registered:
    06 Apr 2006
    07 Oct 2007
    Link to this post
    Hello,

    I had a follow up question from a previous post found here

    In the post to the link above, Bob wrote some great comments,


    9/5/2007 8:08:04 AM
    Hello Chris,

    The new things regarding user management are:
    1. Improved support for Active Directory.
    2. Support for multiple Membership, Role and Profile providers. This feature allows you to completely separate public and administrative users and manage them form one UI. Also, you can combine different providers like Active Directory and SQL.
    3. Built-in control for displaying and editing user profiles.
    4. New restriction has been added. Users that are not members of at least one unrestricted role will not be able to add or remove users from unrestricted roles even if they have been granted Manage Users permission.

     A concrete date for v3.1 has not been scheduled yet but most likely we will release a beta next week and official version around 26th this month.

    Regards,
    Bob
    the Telerik team


    I was wondering if you could elaborate

    "This feature allows you to completely separate public and administrative users and manage them form one UI"

    Thanks again for all your help, you all are great!
  3. Yasen
    Yasen avatar
    121 posts
    Registered:
    18 May 2013
    08 Oct 2007
    Link to this post
    Hi CHRIS mechsner,

    About your first question: You can achieve this using the default membership/role providers. The new global permission "CMS Access" gives you the ability not to let users enter the admin section at all. For example, you can create a role called "Students" and deny this permission, thus users in this role won't be able to enter the admin part. However, you can manage their access to pages by denying anonymous access and giving the "Students" the page permission "View".

    So far you have
    1. anonymous users who don't have any access except for the common pages.
    2. logged in users that are in "Students" and have access to particular pages, but don't have access for the cms.
    3. admins that have the "CMS Access" permission and can access the cms.

    You can use either your custom login controls, or the shipped with Sitefinity login controls to create a login or profile page, etc. If I was not clear enough or you have any problems, a similar scenario is used in the TIU site for forum users.

    About your second post: What Bob meant by  "completely separate" is that you can select different membership and role providers for completely different data sources, for example, two separate sql databases, and manage them with Sitefinity. For instance, you can have a smaller db with less than 50 users that manage your cms (create pages, manage modules etc. ) and a larger db with thousands of users (who post forum comments etc.). Then in the web.config you define the two couples membership/role provider and that is all you have to do.

    This way in the Sitefinity administration section you'll see a drop down menu that lets you select the membership/role providers you use. You can use the same functionality (create roles , give permissions etc. ) for both databases. This gives you the ability to have roles like: administrators, publishers, content writers, in the database with users for administration and another set of roles like: forum posters, polls users, etc in the large database with public users.

    For editing/viewing the profile of your students, you can use the ManageProfile control from Telerik.Security.WebControls, it is available in the control toolbox.

    Best wishes,
    Yasen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  4. mexner
    mexner avatar
    98 posts
    Registered:
    06 Apr 2006
    10 Oct 2007
    Link to this post
    Yasen, thank you for the wealth of information.  As I begin to build this out, I am needing a little help with the following questions....

     - Can you elaborate some of the prominent properties of the ManageProfile Control?
     - How do I setup an Edit Template for the ManageProfile Control? (right now all my custom profile properties are strung together one right after the other).
     - If I add new fields to the Profile Provider, how do I bring those into the User Details section of the Admin->Users->Edit page?

    It also appears to me that when using the Login and Logout controls, the properties I specify for DestinationPageUrl and LogoutPageURL respectively are not working.

    I really appreciate all the feed back and support you offer, it is outstanding!
  5. mexner
    mexner avatar
    98 posts
    Registered:
    06 Apr 2006
    10 Oct 2007
    Link to this post
    Hi Yasen, please disregard my previous post...I left out a few questions...

    Yasen, thank you for the wealth of information.  As I begin to build this out, I am needing a little help with the following questions....

     - Can you elaborate some of the prominent properties of the ManageProfile Control?
     - How do I setup an Edit Template for the ManageProfile Control? (right now, visibly, all my custom profile properties are strung together one right after the other).
     - When I log in as a user with a profile (as a student) and access my profile, if I fill in my information and click save, the page refreshes, but my updates are not being saved.  Do I need to write code for the OnClick Event of the save button? If so, do you have any examples?
     - If I add new fields to the Profile Provider, how do I bring those into the User Details section of the Admin->Users->Edit page?

    It also appears to me that when using the Login and Logout controls, the properties I specify for DestinationPageUrl and LogoutPageURL respectively are not working.

  6. Yasen
    Yasen avatar
    121 posts
    Registered:
    18 May 2013
    10 Oct 2007
    Link to this post
    Hello CHRIS mechsner,

    I'll try to answer your questions in the order you asked them :
    • The control properties are described in the Developer Manual -> API Reference, the prominent ones are: 

      -Edit/Insert/ViewTemplate - these are inner properties, they present the templates used by the control;

       -Edit/Insert/ViewTemplateUrl - these properties present the path to the .ascx files used as templates for the control;

       -Mode - Edit, Insert or View - the mode of the control;

       -Username - the username for the user whose profile is shown;

       -CurrentUsernameByDefault - indicates that if no username is set, the current logged user is used.

    • To set a template for the control you can do two things - set the Edit/Insert/ViewTemplate property or set the Edit/Insert/ViewTemplateUrl property.

    As an example of the first way you can see the CreateUserWizardControl in Sitefinity/UserControls/Login, in it the ManageProfile control has an InsertTemplate defined;

    For the second way you have to write your own .ascx file, let's say EditProfileTemplate.ascx, then set the EditProfileUrl property to something like : ~/path/ProfileEditTemplate.ascx. Here is a simple example of an edit template defined in the .ascx file:

    <%@ Control Language="C#" ClassName="WebUserControl" %> 
    <ol> 
        <li> 
            <asp:Label AssociatedControlID="FirstName" ID="FirstNameLabel" runat="server" Text="First name <em>(optional)</em> :" /> 
            <asp:TextBox ID="FirstName" runat="server" /> 
        </li> 
        <li> 
            <asp:Label AssociatedControlID="LastName" ID="LastNameLabel" runat="server" Text="Last name <em>(optional)</em> :" /> 
            <asp:TextBox ID="LastName" runat="server" /> 
        </li> 
    </ol> 

    (Note that the Template for the current mode is used, you need to set only Edit template if you use the control in Edit mode and if you set any other mode (Insert,View), the Edit template is not used.

    • This is not the expected behavior, your profile should be saved as the SetProfileProperties() method is called, I suppose you are using the 3.1 beta version as in it there were some problems. Can you please provide the steps to reproduce this issue?

    (Another note: When you define a submit button in the template, the control will recognize it as the submit button only if its ID is "Submit". Otherwise you'll have to save the profile on the click event of your button by manually calling the SetProfileProperties() method) 

    • The admin->users file is actually ~/Sitefinity/Admin/CmsAdmin/Users.aspx . In it you'll find the ManageProfile control twice - for Edit user and for Create new user, for now they use inner defined templates so if you need to add controls for the new properties, just add these controls there in the template next to the FirstName and LastName. Note that the profile property should have the same name as the control ID.

      The other page you may want to modify is ~/Sitefinity/Admin/CmsAdmin/MyProfile.aspx. This page is shown when you click on "my profile" in the upper right corner of the administration pages. In it you have to modify the manage profile control in a similar way you did in the Users file.

    I am not sure if this is the problem but I suppose that you are talking about a known bug in the control editors: when you edit a user control that has property which is marked as URL, you have to manually type the path, if you use the "select" button you can select a URL, but it is not saved when you click I'm done. So what happens is that you think you set the DestinationPageUrl and LogoutPageUrl but they are actually not saved. If this is not the issue, please provide steps to reproduce your problem and we'll do our best to fix it.

    Hope this information is useful, if you have any other questions, feel free to ask again.

    Kind regards,

    Yasen

    the Telerik team


    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
6 posts, 0 answered