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

Forums / Developing with Sitefinity / Issue in Portal Application

Issue in Portal Application

4 posts, 0 answered
  1. Waji
    Waji avatar
    5 posts
    Registered:
    14 Jun 2011
    20 Jun 2011
    Link to this post
    Hello,

    I have created a portal site in my project that have multiple application names in db and every user will create in separate application name.

    its work but the issue in my application is that when I load 1st application so it will its name in session and when I load another application as separate so It will keep 1st application name for login/create user/ and password change.

    e,g
    I have 3 sites samplea ,sampleb, samplec

    when I load sampleb and then load samplea and samplec.When I create user in samplea it will create in sampleb same with samplec.

    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Nolics.ORMapper.Base;
    using Telerik.DataAccess.AspnetProviders;
     
    /// <summary>
    /// Summary description for ApplicationProvider
    /// </summary>
    public class ApplicationProvider : TelerikMembershipProvider
    {
        public override string ApplicationName
        {
            get
            {
                string appNameFromContext =
                (string)HttpContext.Current.Items["ApplicationName" + Utility.GetSiteID()];
                if (appNameFromContext != "NOTSET")
                    return appNameFromContext;
                else
                    return base.ApplicationName;
            }
        }
        public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
        {
            DataConnection.Initialize(false, typeof(TelerikRoleProvider).Assembly);
            base.Initialize(name, config);
        }
     
    }
    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Nolics.ORMapper.Base;
    using Telerik.DataAccess.AspnetProviders;
     
    /// <summary>
    /// Summary description for RoleProvider
    /// </summary>
    public class RoleProvider : TelerikRoleProvider
    {
        public override string ApplicationName
        {
            get
            {
                string appNameFromContext =
                (string)HttpContext.Current.Items["ApplicationName" + Utility.GetSiteID()];
                if (appNameFromContext != "NOTSET")
                    return appNameFromContext;
                else
                    return base.ApplicationName;
            }
        }
     
        public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
        {
            DataConnection.Initialize(false, typeof(TelerikRoleProvider).Assembly);
            base.Initialize(name, config);
        }
    }
    these are my classes which are used for ApplicationProvider and RoleProvider
    <roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="Sitefinity">
                <providers>
                    <clear/>
            <add connectionStringName="DefaultConnection" applicationName="/" name="Sitefinity" type="RoleProvider"/>
                </providers>
            </roleManager>
            <membership defaultProvider="Sitefinity" userIsOnlineTimeWindow="15" hashAlgorithmType="">
                <providers>
                    <clear/>
         
            <add name="Sitefinity" connectionStringName="DefaultConnection" type="ApplicationProvider" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Encrypted" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0"/>
             
                </providers>
            </membership>
    this is my web.config settings.

    Please help me on this issue.

    Thanks
    Wajahat
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    20 Jun 2011
    Link to this post
    Hi Waji,

    I am not sure what is the idea behind this scenario. Why don't you use several membership providers to authenticate the users and expose a drop down for setting the provider during the login?

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Waji
    Waji avatar
    5 posts
    Registered:
    14 Jun 2011
    20 Jun 2011
    Link to this post
    Hi,

    the scenario behind this work is we have several clients that will access same application but different portal.
    Basically its a portal based application.
    e.g

    samplea.demo.net
    sampleb.demo.net

    so in both site every thing is same but user will separate from each other.

    so in db telerik_applications table 2 records

    samplea
    sampleb.

    make any sense.
    Thanks

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    21 Jun 2011
    Link to this post
    Hi Waji,

    I suppose that the problem comes from the value set as applicationName in the web.config. The proper way here is using different membership providers. What you can try is setting the application name inside
    Initialize method of the provider - _AppName = "yournamehere" and you can override the ApplicationName property

    public override string ApplicationName
            {
                get { return _AppName; }
                set
                {
                    if (_AppName != value)
                    {
                        _AppName = value;
                    }
                }
            }

    private string _AppName;

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered