Exemple #1
0
 //---------------------------------------------------------------------------
 #endregion
 public static void ConfigureSubSiteIfExist(MembershipUser user)
 {
     if (user != null)
     {
         UsersDataEntity userdata = UsersDataFactory.GetUsersDataObject((Guid)user.ProviderUserKey, Guid.Empty);
         CreateUserFolder(user, userdata);
     }
 }
Exemple #2
0
 public static void DeleteUserFolder(MembershipUser user)
 {
     if (user != null)
     {
         UsersDataEntity userdata = UsersDataFactory.GetUsersDataObject((Guid)user.ProviderUserKey, Guid.Empty);
         DeleteUserFolder(user, userdata);
     }
 }
Exemple #3
0
        //-------------------------------------------------------------
        public static UsersDataEntity GetOwnerData()
        {
            UsersDataEntity SiteOwner = null;
            HttpContext     context   = HttpContext.Current;

            if (context.Items["SiteOwnerData"] != null)
            {
                SiteOwner = (UsersDataEntity)context.Items["SiteOwnerData"];
            }
            else
            {
                if (context.Items["OwnerInterfaceType"] != null)
                {
                    OwnerInterfaceType ownerInterfaceType = (OwnerInterfaceType)context.Items["OwnerInterfaceType"];
                    if (ownerInterfaceType == OwnerInterfaceType.SubAdmin)
                    {
                        MembershipUser user = Membership.GetUser(context.User.Identity.Name);
                        if (user != null)
                        {
                            SiteOwner = UsersDataFactory.GetUsersDataObject((Guid)user.ProviderUserKey, Guid.Empty);
                            if (SiteOwner != null)
                            {
                                context.Items["OwnerID"]         = new Guid(SiteOwner.UserId.ToString());
                                context.Items["OwnerIdentifire"] = SiteOwner.UserName;
                                context.Items["OwnerTitle"]      = SiteOwner.Name;
                            }
                            else
                            {
                                context.Response.Redirect(SiteSettings.Site_WebsiteDomain);
                            }
                        }
                    }
                    else if (ownerInterfaceType == OwnerInterfaceType.SubSites)
                    {
                        string SubSiteIdentifire = (string)context.Items["SubSiteIdentifire"];
                        if (!string.IsNullOrEmpty(SubSiteIdentifire))
                        {
                            MembershipUser user = Membership.GetUser(SubSiteIdentifire);
                            if (user != null)
                            {
                                SiteOwner = UsersDataFactory.GetUsersDataObject((Guid)user.ProviderUserKey, Guid.Empty);
                                if (SiteOwner != null)
                                {
                                    context.Items["OwnerID"]         = new Guid(SiteOwner.UserId.ToString());
                                    context.Items["OwnerIdentifire"] = SiteOwner.UserName;
                                    context.Items["OwnerTitle"]      = SiteOwner.Name;
                                }
                            }
                            else
                            {
                                context.Response.Redirect(SiteSettings.Site_WebsiteDomain);
                            }
                        }
                    }
                }
            }
            //---------------------------------------------------------
            //
            if (SiteOwner == null)
            {
                context.Items["OwnerID"]         = Guid.Empty;
                context.Items["OwnerIdentifire"] = "";
                context.Items["OwnerTitle"]      = "";
            }
            //---------------------------------------------------------
            return(SiteOwner);
            //---------------------------------------------------------
        }