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

Forums / Security / Different Clients under the same database

Different Clients under the same database

9 posts, 0 answered
  1. debett
    debett avatar
    16 posts
    Registered:
    12 Feb 2007
    26 Aug 2010
    Link to this post
    Hi,

    I am just evaluating sitefinity, so, please, excuse me, if my question is stupid.

    We have found out that it is more efficient to maintain only one app for all our clients rather than multiple instances of the same app.

    So, I was hoping to have an option to have all our clients to use one website too. Currently for all other ASP.net applications we are passing applicationId to the application, which determines which database to go after for authentication, as well as for everything else. So, we switch connection to the database at run time, which allows each client to feel like they are going to their own application with their own master pages, authentication, styles and of course their own data.

    Basically, I was wondering how can we achieve similar productivity with sitefinity. I am not sure yet, if we want to have different databases to serve different clients, but It would be nice to maintain just one application for all clients. Basically, each client should be able to manage its own images/templates, etc. Each individual client should potentially have a connection to his/her own information system database.
    At the same time, it would be nice to have some templates,controls, etc shared between all of them. Basically, by releasing the app once, I want all the clients to get the updates. We will then setup aliases through IIS, so that
    let's say client 1 will go to   CLIENTOne.com, while really going to
    website1. .?clientId=1, then client 2 will go to   CLIENTTwo.com, while really going to
    website1. .?clientId=2

    etc. .

    Does it make any sense?




    Thank you.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Aug 2010
    Link to this post
    Hi debett,

    Please take a look at

    The provider model allows you to share or divide some content, but if you want to do this for each user it will be hard, because permissions in 3.x edition are role based and granularity is available out of the box for pages and your scenario require custom coding.  Since Sitefinity 4.0 we have granular permissions for each object and there is more easy to separate items per user, not per role of users.
    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. debett
    debett avatar
    16 posts
    Registered:
    12 Feb 2007
    26 Aug 2010
    Link to this post
    Hi Ivan,

    Thank you very much for replying.

    The link that you gave discuss running "multiple Community version 3.6 sp1 sites off one SQL2009 database."  My goal is to have one website/app with either one database or most probably many databases, so that the website look and feel is read from the appropriate database, connection to which is set during run-time.

    Thank you.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Aug 2010
    Link to this post
    Hi debett,

    The way that you should set the connection string in Sitefinity is the same as for each other ASP.NET web application.

    Below is a sample code that illustrates how to get/set the connection string dynamically

    // GET THE CONNECTION STRING FROM THE WEB.CONFIG FILE
    string currentConnection =System.Web.Configuration.WebConfigurationManager.ConnectionStrings["Sitefinity"].ConnectionString;
    // HERE SET THE CONNECTION STRING TO THE CURRENT SETTINGS
    Configuration conf = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
    conf.ConnectionStrings.ConnectionStrings["Sitefinity"].ConnectionString = currentConnection;
    conf.Save();

    ASP.NET worker process will update the web.config file. You can use a custom HttpModule or add the code in Global.asax, Application_Start.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. debett
    debett avatar
    16 posts
    Registered:
    12 Feb 2007
    30 Aug 2010
    Link to this post
    Hi Ivan,

    I cannot find references to connectionstring in the web.config....

    Where do you store connection strings?

    I even cntrl+shift+f for the name of the database and it does not return any results.



    Thank you.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    30 Aug 2010
    Link to this post
    Hello debett,

    There is a <connectionStrings> in the web.config file that resides in the root of Sitefinity website. Provider model allows you to change the providers at runtime instead of setting the connection string. You could have one website connected to many database and change the provider depending on the user.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. debett
    debett avatar
    16 posts
    Registered:
    12 Feb 2007
    31 Aug 2010
    Link to this post
    Hi Ivan,

    Jennifer from Telerik has replied to my question the following way:

    "

    Thank you for contacting us about Sitefinity.

    In regards to running multiple websites under the same Sitefinity project and top level domain name, you can define each site as a page group within Sitefinity.

    The websites will be defined as Page Groups. You can configure those websites to be accessible through sub-domains using the built-in domain-page mapping feature of Sitefinity. All page templates and themes for the different websites will be accessible through the Template and Theme drop down menus during page edits.


    There is also another way to set up multiple websites as sub domains with Sitefinity. You can have each sub domain be a separate Sitefinity instance that has its pages, templates, and themes grouped at one place. This way you will be able to manage the sub sites separately and instead of seeing all website themes and templates, you will see in the drop down menus only those themes and templates that are available for the sub site.

    "

    I am interested in the second option. Could you, please, direct me somewhere, where I can find information on how to achieve what she is describing in the second paragraph. Also, will the users be different for different sub domains? Their roles?



    Thank you.
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    31 Aug 2010
    Link to this post
    Hi debett,

    First you said "My goal is to have one website/app with either one database or most probably many databases". Then you want to have " You can have each sub domain be a separate Sitefinity instance that has its pages, templates, and themes grouped at one place."

    The only way to have one application and single or multiple databases is using the provider model and changing the application name.

    Using domain page mapping divides only the pages, but not the content or any other data. It is useful if you want to separate only the pages.

    On each subdomain you can have separate Sitefinity instance and used one or more than one databases to share content again using the provider model.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. debett
    debett avatar
    16 posts
    Registered:
    12 Feb 2007
    31 Aug 2010
    Link to this post
    Ivan,

    "First you said "My goal is to have one website/app with either one database or most probably many databases". Then you want to have " You can have each sub domain be a separate Sitefinity instance that has its pages, templates, and themes grouped at one place.""

    I apologize if I was not clear enough, but both of my statements are true. I do want to have only one project == only on directory with project files on my server. At the same time, I want this one directory/folder/code files to be run from different or the same subdomains. I already use this approach for all of my asp.net applications. Depending on the query string / subdomain, I determine which database to use to define the presentation of an application, as well as to use authentication against the selected database. Therefore, when I need to perform a release, I only update one physical folder versus thousands.

    Thank you.
Register for webinar
9 posts, 0 answered