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

Forums / Developing with Sitefinity / Intranet / Portal

Intranet / Portal

4 posts, 0 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    07 Jul 2008
    Link to this post
    Hello Sitefinity,

    I've a question regarding Sitefinity's Users/Roles/Permissions.
    The following I want to achieve, or at least know if it is possible:

    Currently I have an application that is acting like an Intranet application. Users have to login before they can see anything. Some users have specific rights to edit content, or to upload files etc. to this intranet.

    If a normal user is logged on, he or she can edit their own profile information, which is very extended, compared to the ASP.NET tables that are created by default. They also can see public profiles from other users.

    They can enter Address information, e-mail addresses, telephone numbers, a group of users can be grouped within a unit etc....

    So, I currently store all columns that are needed for authentication etc. (based on the MembershipProvider, RoleProvider and ProfileProvider) inside my own tables.

    Now this database is a bit out of date and the application too. I'd like to know if it is possible to create a Sitefinity website for this purpose? I really like the SF framework that is already there. So rather then recreating the whole application again, I would like to build on a default Sitefinity website, but I'm not sure about the login procedure and assigning rights to users.

    I would not be happy to maintain 2 tables with users: 1 for the public area and 1 for the administrators... Every users should login to the application and every user could be an administrator.

    I hope my problem/question is a bit clear?

    If anyone already has a solution like this, I would really like to hear how it works.

    Thanks,
    Daniel
  2. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    09 Jul 2008
    Link to this post
    Hi Dan,

    Thanks for writing to us.

    You can create a Sitefinity website to act an an Intranet site and you can store profile information without having to create database tables. Sitefinity is using the ASP.NET Membership, Roles and Profile classes, so anything you have learned with a regular ASP.NET 2.0 application would apply to Sitefinity.

    Building your web application would require adding fields to the profile provider and extending the Create User Wizard Control. You need to open the web.config of your Sitefinity application and locate the profile provider and add fields. Our CMS is also using the Create a User Wizard control from Visual Studio, which we wrapped inside of a user control. The location of that user control to customize is here: [Root]\Sitefinity\UserControls\Login\CreateUserWizard.ascx
      This article from Scott Guthrie will discuss adding fields to the profile provider and customizing the the               Create a User Wizard Control. This blog post by Scott Guthrie will also give you more insight into customzing the profile provider.

      When you create users inside of Sitefinity, all of that info is stored in the same membership table and when users sign up on the website using the Create a User Wizard control. On the administrative side, and this is an optional step, you can customize the create a user from when your user is logged into the admin. In this example, I will add a profile field called Nickname. To do so, follow these instructions:
      1. Open your web.config file and locate this code: <add name="LastName"/>
      2. Add this code right below it <add name="NickName">
      3. Open this file:

        [Root]\Sitefinity\Admin\CmsAdmin\Users.aspx

      4. You will notice a ASP.NET Repeater Control on the page. Locate the <InsertTemplate> tag
      5. Add this code
        <%--Nickname Field--%> 
                                                         
        <li> 
        <cc2:FieldLabel ID="NickNameLabel" runat="server" Text="Nickname" TargetID="NickName"
        </cc2:FieldLabel> 
        <asp:TextBox ID="NickName" runat="server"></asp:TextBox> 
        </li> 
         
            6. Locate the <EditTemplate> tag and insert the code from step 5.

      In terms of assigning rights to users, this can be done on the page, module and CMS level. Sitefinity creates a group of users and assigns them to roles, which have certain privileges. As an example for the page level, login as an admin, Then, click on the pages tab. After that, click on the all pages and then permissions on the right hand side of the screen. In the middle, you'll see that anyone in the administrators role has full privileges to all pages. For more info on security and Sitefinity, please watch this video and review the Permissions section of our user manual.


      I hope that I have given you clear instructions on how to extend the profile provider within Sitefinity. If you have any other questions, feel free contact me.

      Thanks,

      Joe
      the Telerik team

      Instantly find answers to your questions at the new Telerik Support Center
    1. Daniel Plomp
      Daniel Plomp avatar
      952 posts
      Registered:
      18 Feb 2004
      09 Jul 2008
      Link to this post
      Hi Joe,

      Thanks for your reply.
      Actually, I'm not sure if this is what I want.

      I do want to use my own tables for my users, because of all the extra fields. There are too much custom fields to put all in the Profile and they have one-to-many relations with other tables. I also have a small Windows Application for maintaining these users...

      So I think I should use a custom MembershipProvider and RoleProvider to let my users login on the public part of the intranet.

      But then I want some of these users to be an admin, or have another role to login to the Sitefinity admin area and edit the site content.

      So, I do not want to store my users inside the Sitefinity tables using Profile or whatever.

      I hope I am more clear now? I'm sorry about my poor english...!

      Thanks,
      Daniel
    2. Joe
      Joe avatar
      138 posts
      Registered:
      24 Sep 2012
      09 Jul 2008
      Link to this post
      Hi Dan,

      Thanks for responding.

      In your scenario, I would recommend a custom Membership and Role provider because you have many customizations and joined tables. Since Sitefinity uses the provider model, you can add a custom provider to achieve your desired functionality. Providers are stored in the web.config file of the Sitefinity project.

      To create a custom membership and roles provider, you'll need to override both the CreateUser() method within the Create a User Wizard control and the ValidateUser() method within the Login control. For more detailed information on creating a custom membership and roles provider, using MS Access as an example, please refer to this article.

      Once you create your custom provider, you will need to make it the default membership and roles provider with Sitefinity, so your users don't have to login twice; once to edit the CMS and once to view their profile properties. This article will give you detailed instructions on changing the default membership and roles provider within Sitefinity.

      I hope that I have given you clear instructions on implementing a custom membership and roles provider and implementing it within Sitefinity. Feel free to contact us if you have any other questions.


      Kind regards,

      Joe
      the Telerik team

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