Beispiel #1
0
        //------------------------------------------
        #endregion

        #region ---------------------------RegisterInMailList---------------------------
        //---------------------------------------------------------------------------
        public static void RegisterInMailList(UsersDataEntity usersDataObject)
        {
            UsersDataGlobalOptions userDataModule = UsersDataGlobalOptions.GetType(usersDataObject.ModuleTypeID);
            Languages langID = (Languages)SiteSettings.Languages_DefaultLanguageID;

            MailListUsersFactory.RegisterInMailList(userDataModule.ModuleTypeID, usersDataObject.Email, langID, userDataModule.MailListAutomaticActivation, userDataModule.MailListSendingMailActivation);
        }
Beispiel #2
0
        //---------------------------------------------------------------------------
        #endregion

        #region ---------------------------RegisterInSms---------------------------
        //---------------------------------------------------------------------------
        public static void RegisterInSms(UsersDataEntity usersDataObject)
        {
            UsersDataGlobalOptions userDataModule = UsersDataGlobalOptions.GetType(usersDataObject.ModuleTypeID);
            Languages langID = (Languages)SiteSettings.Languages_DefaultLanguageID;

            SMSNumbersFactory.RegisterInSms(userDataModule.ModuleTypeID, usersDataObject.Mobile, langID, userDataModule.SmsAutomaticActivation);
        }
Beispiel #3
0
 public static void CreateUserFolder(MembershipUser user, UsersDataEntity userdata)
 {
     if (user != null && userdata != null)
     {
         if (user.IsApproved && UsersDataFactory.IsSubSubSiteOwner(userdata.UserType))
         {
             string subSiteFolder             = DCSiteUrls.GetPath_SubSiteUploadFolder(user.UserName);
             string subSiteFolderPhysicalPath = DCServer.MapPath(subSiteFolder);
             if (!Directory.Exists(subSiteFolderPhysicalPath))
             {
                 string        subSiteEmptyFolderPhysicalPath = DCServer.MapPath(DCSiteUrls.GetPath_DefaultSubSiteFolder());
                 DirectoryInfo diSource = new DirectoryInfo(subSiteEmptyFolderPhysicalPath);
                 DirectoryInfo diTarget = new DirectoryInfo(subSiteFolderPhysicalPath);
                 DcDirectoryManager.CopyAll(diSource, diTarget);
             }
         }
         else
         {
             // Create msg folder
             string folder             = DCSiteUrls.GetPath_UserDataDirectory(userdata.OwnerName, userdata.ModuleTypeID, userdata.CategoryID, userdata.UserProfileID);
             string folderPhysicalPath = DCServer.MapPath(folder);
             if (!Directory.Exists(folderPhysicalPath))
             {
                 string        defaultFolder             = DCSiteUrls.GetPath_DefaultUserDataFolder();
                 string        defaultFolderPhysicalPath = DCServer.MapPath(defaultFolder);
                 DirectoryInfo diSource = new DirectoryInfo(defaultFolderPhysicalPath);
                 DirectoryInfo diTarget = new DirectoryInfo(folderPhysicalPath);
                 DcDirectoryManager.CopyAll(diSource, diTarget);
             }
         }
     }
 }
Beispiel #4
0
        //------------------------------------------
        #endregion

        #region --------------GetUsersDataObject--------------
        public static UsersDataEntity GetUsersDataObject(Guid userID, Guid OwnerID)
        {
            UsersDataEntity usersDataObject = UsersDataSqlDataPrvider.Instance.GetUsersDataObject(userID, OwnerID);

            //return the object
            return(usersDataObject);
        }
Beispiel #5
0
        //----------------------------------------------------------------------------------------------------------
        public static void AddProfilePageDetails(UsersDataEntity usersDataObject)
        {
            ItemsEntity page = new ItemsEntity();

            page.ModuleTypeID = (int)ModuleTypes.UsersProfiles;
            page.OwnerID      = usersDataObject.UserId;
            //-----------------------------------------------------
            //AddDetails
            //----------------------------
            ItemsDetailsEntity itemDetailsObject;

            if (SiteSettings.Languages_HasArabicLanguages)
            {
                itemDetailsObject        = new ItemsDetailsEntity();
                itemDetailsObject.LangID = Languages.Ar;

                itemDetailsObject.Title = DynamicResource.GetText("Modules", "PageTitle_UserProfilePage");
                itemDetailsObject.ExtraData.Add("");
                page.Details[Languages.Ar] = itemDetailsObject;
            }
            if (SiteSettings.Languages_HasEnglishLanguages)
            {
                itemDetailsObject        = new ItemsDetailsEntity();
                itemDetailsObject.LangID = Languages.En;
                itemDetailsObject.Title  = DynamicResource.GetText("Modules", "PageTitle_UserProfilePage");
                itemDetailsObject.ExtraData.Add("");
                page.Details[Languages.En] = itemDetailsObject;
            }
            //-----------------------------------------------------
            ItemsModulesOptions UsersProfilesModule = ItemsModulesOptions.GetType((int)ModuleTypes.UsersProfiles);

            ItemsFactory.Create(page, UsersProfilesModule);
            //-----------------------------------------------------
            usersDataObject.ProfilePageID = page.ItemID;
        }
Beispiel #6
0
        //----------------------------------------------------------------------------------------------------------
        public static int AddSubSitePageDetails(int PageNo, UsersDataEntity usersDataObject)
        {
            ItemsEntity page = new ItemsEntity();

            page.ModuleTypeID = (int)ModuleTypes.SubSitePages;
            page.OwnerID      = usersDataObject.UserId;
            //-----------------------------------------------------
            //AddDetails
            //----------------------------
            ItemsDetailsEntity itemDetailsObject;

            if (SiteSettings.Languages_HasArabicLanguages)
            {
                itemDetailsObject        = new ItemsDetailsEntity();
                itemDetailsObject.LangID = Languages.Ar;
                itemDetailsObject.Title  = DynamicResource.GetText("SubSites", "Page_" + PageNo);
                itemDetailsObject.ExtraData.Add("");
                page.Details[Languages.Ar] = itemDetailsObject;
            }
            if (SiteSettings.Languages_HasEnglishLanguages)
            {
                itemDetailsObject        = new ItemsDetailsEntity();
                itemDetailsObject.LangID = Languages.En;
                itemDetailsObject.Title  = DynamicResource.GetText("SubSites", "Page_" + PageNo);
                itemDetailsObject.ExtraData.Add("");
                page.Details[Languages.En] = itemDetailsObject;
            }
            //-----------------------------------------------------
            ItemsModulesOptions subSitePagesModule = ItemsModulesOptions.GetType((int)ModuleTypes.SubSitePages);

            ItemsFactory.Create(page, subSitePagesModule);
            //-----------------------------------------------------
            return(page.ItemID);
        }
Beispiel #7
0
 public static void ConfigureSubSiteIfExist(UsersDataEntity userdata)
 {
     if (userdata != null)
     {
         MembershipUser user = Membership.GetUser(userdata.UserId);
         CreateUserFolder(user, userdata);
     }
 }
Beispiel #8
0
 //---------------------------------------------------------------------------
 #endregion
 public static void ConfigureSubSiteIfExist(MembershipUser user)
 {
     if (user != null)
     {
         UsersDataEntity userdata = UsersDataFactory.GetUsersDataObject((Guid)user.ProviderUserKey, Guid.Empty);
         CreateUserFolder(user, userdata);
     }
 }
Beispiel #9
0
 public static void DeleteUserFolder(MembershipUser user)
 {
     if (user != null)
     {
         UsersDataEntity userdata = UsersDataFactory.GetUsersDataObject((Guid)user.ProviderUserKey, Guid.Empty);
         DeleteUserFolder(user, userdata);
     }
 }
Beispiel #10
0
        //-------------------------------------------------------------
        public static string GetOwnerIdentifire()
        {
            //-------------------------------------
            UsersDataEntity SiteOwner = GetOwnerData();
            HttpContext     context   = HttpContext.Current;

            return((string)context.Items["OwnerIdentifire"]);
            //-------------------------------------
        }
Beispiel #11
0
        //-------------------------------------------------------------
        public static Guid GetOwnerIDAsGuid()
        {
            //-------------------------------------
            UsersDataEntity SiteOwner = GetOwnerData();
            HttpContext     context   = HttpContext.Current;

            return((Guid)context.Items["OwnerID"]);
            //-------------------------------------
        }
Beispiel #12
0
        /// <summary>
        /// Creates UsersData object by calling UsersData data provider create method.
        /// <example>[Example]bool status=UsersDataFactory.Create(usersDataObject);.</example>
        /// </summary>
        /// <param name="usersDataObject">The UsersData object.</param>
        /// <returns>Status of create operation.</returns>
        public static bool Create(MembershipUser user, UsersDataEntity usersDataObject)
        {
            bool status = UsersDataSqlDataPrvider.Instance.Create(usersDataObject);

            if (status)
            {
                UsersDataFactory.CreateUserFolder(user, usersDataObject);
                //------------------------------------------------------------------------
            }
            return(status);
        }
Beispiel #13
0
        }/*
          * //----------------------------------------------------------------------------------------------------------
          * public static string GetSubSitPagesIDsString(SubSiteTypes subeSiteType)
          * {
          * string PagesIDsString = "";
          * List<int> subSitePagesIDs = GetSubSitPagesIDs(subeSiteType);
          * foreach (int id in subSitePagesIDs)
          * {
          *     if(!string.IsNullOrEmpty(PagesIDsString))PagesIDsString+="," ;
          *     PagesIDsString += id;
          * }
          * return PagesIDsString;
          * }*/

        //----------------------------------------------------------------------------------------------------------
        public static void AddSubSitePages(UsersDataEntity usersDataObject)
        {
            string PagesIDsString  = "";
            int    id              = 0;
            int    subSitePagesIDs = GetSubSitPagesCount(usersDataObject.SubSiteType);

            for (int i = 1; i <= subSitePagesIDs; i++)
            {
                id = AddSubSitePageDetails(i, usersDataObject);
                if (!string.IsNullOrEmpty(PagesIDsString))
                {
                    PagesIDsString += ",";
                }
                PagesIDsString += id;
            }
            usersDataObject.SiteStaticPages = PagesIDsString;
        }
Beispiel #14
0
        //---------------------------------------------------------------------------
        public static void UpdateSmsMobileNo(string oldMobile, UsersDataEntity usersDataObject)
        {
            SMSNumbersEntity smsUser = SMSNumbersFactory.GetObject(usersDataObject.ModuleTypeID, oldMobile);

            if (smsUser != null)
            {
                if (!string.IsNullOrEmpty(usersDataObject.Mobile))
                {
                    smsUser.Numbers = usersDataObject.Mobile;
                    SMSNumbersFactory.Update(smsUser);
                }
                else
                {
                    SMSNumbersFactory.Delete(smsUser.NumID);
                }
            }
            else
            {
                UsersDataFactory.RegisterInSms(usersDataObject);
            }
        }
Beispiel #15
0
        //---------------------------------------------------------------------------
        public static void UpdateMailListEmail(string oldEmail, UsersDataEntity usersDataObject)
        {
            MailListUsersEntity mlUser = MailListUsersFactory.GetObject(usersDataObject.ModuleTypeID, oldEmail);

            if (mlUser != null)
            {
                if (!string.IsNullOrEmpty(usersDataObject.Email))
                {
                    mlUser.Email = usersDataObject.Email;
                    MailListUsersFactory.Update(mlUser);
                }
                else
                {
                    MailListUsersFactory.Delete(mlUser.UserID);
                }
            }
            else
            {
                UsersDataFactory.RegisterInMailList(usersDataObject);
            }
        }
Beispiel #16
0
        //----------------------------------------------------------------------------------------------------------
        //----------------------------------------------------------------------------------------------------------
        public static void AddUserRelatedPages(UsersDataEntity usersDataObject)
        {
            UsersDataGlobalOptions usersModuleOptions = UsersDataGlobalOptions.GetType(usersDataObject.ModuleTypeID);
            bool HasProfilePage = usersModuleOptions.HasProfilePage;
            bool doUpdate       = false;

            //*--------------------------------------------------------
            if (HasProfilePage && usersDataObject.ProfilePageID <= 0)
            {
                SubSiteHandler.AddProfilePageDetails(usersDataObject);
                doUpdate = true;
            }
            //*--------------------------------------------------------
            if (UsersDataFactory.IsSubSubSiteOwner(usersDataObject.UserType) && string.IsNullOrEmpty(usersDataObject.SiteStaticPages))
            {
                SubSiteHandler.AddSubSitePages(usersDataObject);
                doUpdate = true;
            }
            //*--------------------------------------------------------
            if (doUpdate)
            {
                UsersDataFactory.Update(usersDataObject);
            }
        }
Beispiel #17
0
 //---------------------------------------------------------------------------
 public static void UnRegisterInMailList(UsersDataEntity usersDataObject)
 {
     MailListUsersFactory.Delete(usersDataObject.ModuleTypeID, usersDataObject.Email);
 }
Beispiel #18
0
 //---------------------------------------------------------------------------
 public static void UnRegisterInSms(UsersDataEntity usersDataObject)
 {
     SMSNumbersFactory.Delete(usersDataObject.ModuleTypeID, usersDataObject.Mobile);
 }
Beispiel #19
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);
            //---------------------------------------------------------
        }
Beispiel #20
0
        //------------------------------------------
        #endregion

        #region --------------Update--------------
        /// <summary>
        /// Updates UsersData object by calling UsersData data provider update method.
        /// <example>[Example]bool status=UsersDataFactory.Update(usersDataObject);.</example>
        /// </summary>
        /// <param name="usersDataObject">The UsersData object.</param>
        /// <returns>Status of update operation.</returns>
        public static bool Update(UsersDataEntity usersDataObject)
        {
            bool status = UsersDataSqlDataPrvider.Instance.Update(usersDataObject);

            return(status);
        }