Ejemplo n.º 1
0
        public static Control GetCurrentProfileControl()
        {
            //default
            string RegisterPage = "Register.ascx";

            // 19/08/2004 Jonathan Fong
            // www.gt.com.au
            RainbowPrincipal user = HttpContext.Current.User as RainbowPrincipal;

            if (user != null && user.Identity.AuthenticationType == "LDAP")
            {
                RegisterPage = "LDAPUserProfile.ascx";
                PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];
                Page           x         = new Page();
                Control        myControl = x.LoadControl(Rainbow.Settings.Path.WebPathCombine(Rainbow.Settings.Path.ApplicationRoot, "DesktopModules/LDAPUserProfile", RegisterPage));

                Rainbow.UI.WebControls.PortalModuleControl p = ((Rainbow.UI.WebControls.PortalModuleControl)myControl);
                p.ModuleID = int.Parse(portalSettings.CustomSettings["SITESETTINGS_REGISTER_MODULEID"].ToString());

                return((Control)p);
            }
            // Obtain PortalSettings from Current Context
            else if (HttpContext.Current != null)
            {
                PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];

                //Select the actual register page
                if (portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"] != null &&
                    portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"].ToString() != "Register.ascx")
                {
                    RegisterPage = portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"].ToString();
                }
                Page x = new Page();

                // Modified by gman3001 10/06/2004, to support proper loading of a register module specified by 'Register Module ID' setting in the Portal Settings admin page
                int    moduleID         = int.Parse(portalSettings.CustomSettings["SITESETTINGS_REGISTER_MODULEID"].ToString());
                string moduleDesktopSrc = string.Empty;
                if (moduleID > 0)
                {
                    moduleDesktopSrc = ModuleSettings.GetModuleDesktopSrc(moduleID);
                }
                if (moduleDesktopSrc.Length == 0)
                {
                    moduleDesktopSrc = Rainbow.Settings.Path.WebPathCombine(Rainbow.Settings.Path.ApplicationRoot, "DesktopModules/Register", RegisterPage);
                }
                Control myControl = x.LoadControl(moduleDesktopSrc);
                // End Modification by gman3001

                Rainbow.UI.WebControls.PortalModuleControl p = ((Rainbow.UI.WebControls.PortalModuleControl)myControl);
                //p.ModuleID = int.Parse(portalSettings.CustomSettings["SITESETTINGS_REGISTER_MODULEID"].ToString());
                p.ModuleID = moduleID;
                if (p.ModuleID == 0)
                {
                    ((SettingItem)p.Settings["MODULESETTINGS_SHOW_TITLE"]).Value = "false";
                }
                return((Control)p);
            }

            return(null);
        }
        // Method Added by gman3001 10/06/2004, to support proper loading of a register module specified by 'Register Module ID' setting in the Portal Settings admin page
        /// <summary>
        /// Gets the current profile control.
        /// </summary>
        /// <returns></returns>
        private Control GetCurrentProfileControl()
        {
            //default
            string RegisterPage = "register.aspx";

            if (HttpContext.Current != null)
            {
                PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];

                //Select the actual register page
                if (portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"] != null &&
                    portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"].ToString() != "register.aspx")
                {
                    RegisterPage = portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"].ToString();
                }

                int    moduleID         = int.Parse(portalSettings.CustomSettings["SITESETTINGS_REGISTER_MODULEID"].ToString());
                string moduleDesktopSrc = string.Empty;
                if (moduleID > 0)
                {
                    moduleDesktopSrc = ModuleSettings.GetModuleDesktopSrc(moduleID);
                }
                if (moduleDesktopSrc.Length == 0)
                {
                    moduleDesktopSrc =
                        // by [email protected] Path.WebPathCombine(Path.ApplicationRoot, "DesktopModules/CoreModules/Register", RegisterPage);
                        Path.WebPathCombine(Path.ApplicationRoot, "DesktopModules/CoreModules/Register", "registerfull.ascx");
                }
                Control myControl = LoadControl(moduleDesktopSrc);

                PortalModuleControl p = ((PortalModuleControl)myControl);

                // changed by Mario Endara <*****@*****.**> (2004/11/05)
                // if there's no custom register module, take actual ModuleID, else take the custom ModuleID
                if (moduleID == 0)
                {
                    p.ModuleID = ModuleID;
                    ((SettingItem)p.Settings["MODULESETTINGS_SHOW_TITLE"]).Value = "false";
                }
                else
                {
                    p.ModuleID = moduleID;
                }

                return((Control)p);
            }

            return(null);
        }
        /// <summary>
        /// Gets the current profile control.
        /// </summary>
        /// <returns></returns>
        public static Control GetCurrentProfileControl()
        {
            //default
            string RegisterPage = "Register.ascx";

            // 19/08/2004 Jonathan Fong
            // www.gt.com.au
            RainbowPrincipal user = HttpContext.Current.User as RainbowPrincipal;

            PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];

            //Select the actual register page
            if (portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"] != null &&
                portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"].ToString() != "Register.ascx")
            {
                RegisterPage = portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"].ToString();
            }
            System.Web.UI.Page x = new System.Web.UI.Page();

            // Modified by gman3001 10/06/2004, to support proper loading of a register module specified by 'Register Module ID' setting in the Portal Settings admin page
            int    moduleID         = int.Parse(portalSettings.CustomSettings["SITESETTINGS_REGISTER_MODULEID"].ToString());
            string moduleDesktopSrc = string.Empty;

            if (moduleID > 0)
            {
                moduleDesktopSrc = ModuleSettings.GetModuleDesktopSrc(moduleID);
            }
            if (moduleDesktopSrc.Length == 0)
            {
                moduleDesktopSrc = RegisterPage;
            }
            Control myControl = x.LoadControl(moduleDesktopSrc);
            // End Modification by gman3001

            PortalModuleControl p = ((PortalModuleControl)myControl);

            //p.ModuleID = int.Parse(portalSettings.CustomSettings["SITESETTINGS_REGISTER_MODULEID"].ToString());
            p.ModuleID = moduleID;
            if (p.ModuleID == 0)
            {
                ((SettingItem)p.Settings["MODULESETTINGS_SHOW_TITLE"]).Value = "false";
            }
            return((Control)p);

            return(null);
        }
Ejemplo n.º 4
0
        // Method Added by gman3001 10/06/2004, to support proper loading of a register module specified by 'Register Module ID' setting in the Portal Settings admin page
        private Control GetCurrentProfileControl()
        {
            //default
            string           RegisterPage = "register.aspx";
            RainbowPrincipal user         = HttpContext.Current.User as RainbowPrincipal;

            // Use proper User Management screen for LDAP Authentication
            // Not sure about this LDAP User Management form restriction, but for now I'll keep it in: gman3001 10/06/2004
            if (user != null && user.Identity.AuthenticationType == "LDAP")
            {
                RegisterPage = "LDAPUserProfile.ascx";
                PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];
                Control        myControl      = this.LoadControl(Rainbow.Settings.Path.WebPathCombine(Rainbow.Settings.Path.ApplicationRoot, "DesktopModules/LDAPUserProfile", RegisterPage));

                Rainbow.UI.WebControls.PortalModuleControl p = ((Rainbow.UI.WebControls.PortalModuleControl)myControl);
                p.ModuleID = int.Parse(portalSettings.CustomSettings["SITESETTINGS_REGISTER_MODULEID"].ToString());

                return((Control)p);
            }
            // Obtain PortalSettings from Current Context
            else if (HttpContext.Current != null)
            {
                PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];

                //Select the actual register page
                if (portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"] != null &&
                    portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"].ToString() != "register.aspx")
                {
                    RegisterPage = portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"].ToString();
                }

                int    moduleID         = int.Parse(portalSettings.CustomSettings["SITESETTINGS_REGISTER_MODULEID"].ToString());
                string moduleDesktopSrc = string.Empty;
                if (moduleID > 0)
                {
                    moduleDesktopSrc = ModuleSettings.GetModuleDesktopSrc(moduleID);
                }
                if (moduleDesktopSrc.Length == 0)
                {
                    moduleDesktopSrc = Rainbow.Settings.Path.WebPathCombine(Rainbow.Settings.Path.ApplicationRoot, "DesktopModules/Register", RegisterPage);
                }
                Control myControl = this.LoadControl(moduleDesktopSrc);

                Rainbow.UI.WebControls.PortalModuleControl p = ((Rainbow.UI.WebControls.PortalModuleControl)myControl);

                // changed by Mario Endara <*****@*****.**> (2004/11/05)
                // if there's no custom register module, take actual ModuleID, else take the custom ModuleID
                if (moduleID == 0)
                {
                    p.ModuleID = ModuleID;
                    ((SettingItem)p.Settings["MODULESETTINGS_SHOW_TITLE"]).Value = "false";
                }
                else
                {
                    p.ModuleID = moduleID;
                }

                return((Control)p);
            }

            return(null);
        }