コード例 #1
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [cnurse]	03/02/2006  Created
        /// </history>
        /// -----------------------------------------------------------------------------
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            jQuery.RequestDnnPluginsRegistration();

            cmdCancel.Click += cmdCancel_Click;
            cmdUpdate.Click += cmdUpdate_Click;

            var config = new MembershipProviderConfig();

            if (MembershipProviderConfig.CanEditProviderProperties)
            {
                ProviderSettings.EditMode = PropertyEditorMode.Edit;
            }
            else
            {
                ProviderSettings.EditMode = PropertyEditorMode.View;
            }
            ProviderSettings.LocalResourceFile = LocalResourceFile;
            ProviderSettings.DataSource        = config;
            ProviderSettings.DataBind();

            if (UserInfo.IsSuperUser)
            {
                PasswordSettings.EditMode = PropertyEditorMode.Edit;
            }
            else
            {
                PasswordSettings.EditMode = PropertyEditorMode.View;
            }
            PasswordSettings.LocalResourceFile = LocalResourceFile;
            PasswordSettings.DataSource        = new PasswordConfig();
            PasswordSettings.DataBind();

            //Create a hashtable for the custom editors being used, using the same keys
            //as in the settings hashtable
            var editors = new Hashtable();

            editors["Redirect_AfterLogin"]        = EditorInfo.GetEditor("Page");
            editors["Redirect_AfterLogout"]       = EditorInfo.GetEditor("Page");
            editors["Redirect_AfterRegistration"] = EditorInfo.GetEditor("Page");

            //Create a Hashtable for the custom Visibility options
            var visibility = new Hashtable();

            if (IsHostMenu)
            {
                visibility["Profile_DefaultVisibility"]           = false;
                visibility["Profile_DisplayVisibility"]           = false;
                visibility["Profile_ManageServices"]              = false;
                visibility["Redirect_AfterLogin"]                 = false;
                visibility["Redirect_AfterRegistration"]          = false;
                visibility["Redirect_AfterLogout"]                = false;
                visibility["Security_CaptchaLogin"]               = false;
                visibility["Security_CaptchaRegister"]            = false;
                visibility["Security_EmailValidation"]            = false;
                visibility["Security_RequireValidProfile"]        = false;
                visibility["Security_RequireValidProfileAtLogin"] = false;
                visibility["Security_UsersControl"]               = false;
            }
            UserSettingsEditor.LocalResourceFile = LocalResourceFile;
            UserSettingsEditor.DataSource        = UserController.GetUserSettings(UserPortalID);
            UserSettingsEditor.CustomEditors     = editors;
            UserSettingsEditor.Visibility        = visibility;
            UserSettingsEditor.DataBind();
        }
コード例 #2
0
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [cnurse]	03/02/2006  Created
        /// </history>
        protected void Page_Load(Object sender, EventArgs e)
        {
            //Bind User Controller to PropertySettings
            MembershipProviderConfig config = new MembershipProviderConfig();

            if (MembershipProviderConfig.CanEditProviderProperties)
            {
                ProviderSettings.EditMode = PropertyEditorMode.Edit;
            }
            else
            {
                ProviderSettings.EditMode = PropertyEditorMode.View;
            }
            ProviderSettings.LocalResourceFile = this.LocalResourceFile;
            ProviderSettings.DataSource        = config;
            ProviderSettings.DataBind();

            if (UserInfo.IsSuperUser)
            {
                PasswordSettings.EditMode = PropertyEditorMode.Edit;
            }
            else
            {
                PasswordSettings.EditMode = PropertyEditorMode.View;
            }
            PasswordSettings.LocalResourceFile = this.LocalResourceFile;
            PasswordSettings.DataSource        = new PasswordConfig();
            PasswordSettings.DataBind();

            //Create a hashtable for the custom editors being used, using the same keys
            //as in the settings hashtable
            Hashtable editors = new Hashtable();

            editors["Redirect_AfterLogin"]        = EditorInfo.GetEditor("Page");
            editors["Redirect_AfterLogout"]       = EditorInfo.GetEditor("Page");
            editors["Redirect_AfterRegistration"] = EditorInfo.GetEditor("Page");

            //Create a Hashtable for the custom Visibility options
            Hashtable visibility = new Hashtable();

            if (PortalSettings.ActiveTab.ParentId == PortalSettings.SuperTabId)
            {
                visibility["Profile_DefaultVisibility"]           = false;
                visibility["Profile_DisplayVisibility"]           = false;
                visibility["Profile_ManageServices"]              = false;
                visibility["Redirect_AfterLogin"]                 = false;
                visibility["Redirect_AfterRegistration"]          = false;
                visibility["Redirect_AfterLogout"]                = false;
                visibility["Security_CaptchaLogin"]               = false;
                visibility["Security_CaptchaRegister"]            = false;
                visibility["Security_RequireValidProfile"]        = false;
                visibility["Security_RequireValidProfileAtLogin"] = false;
                visibility["Security_UsersControl"]               = false;
            }


            UserSettingsControl.LocalResourceFile = this.LocalResourceFile;
            Hashtable ht = this.Settings;

            UserSettingsControl.DataSource    = UserModuleBase.GetSettings(ht);
            UserSettingsControl.CustomEditors = editors;
            UserSettingsControl.Visibility    = visibility;
            UserSettingsControl.DataBind();
        }