Beispiel #1
0
        //*******************************************************
        //
        // The BindData helper method is used to update the tab's
        // layout panes with the current configuration information
        //
        //*******************************************************

        private void BindData()
        {
            // Obtain PortalSettings from Current Context
            PortalSettings portalSettings = (PortalSettings)Context.Items["PortalSettings"];
            TabSettings    tab            = portalSettings.ActiveTab;

            // Populate Tab Names, etc.
            tabName.Text       = tab.TabName;
            mobileTabName.Text = tab.MobileTabName;
            showMobile.Checked = tab.ShowMobile;

            // Populate checkbox list with all security roles for this portal
            // and "check" the ones already configured for this tab
            AdminDB     admin = new AdminDB();
            IDataReader roles = admin.GetPortalRoles(portalSettings.PortalId);

            // Clear existing items in checkboxlist
            authRoles.Items.Clear();

            ListItem allItem = new ListItem();

            allItem.Text = "All Users";

            if (tab.AuthorizedRoles.LastIndexOf("All Users") > -1)
            {
                allItem.Selected = true;
            }

            authRoles.Items.Add(allItem);

            while (roles.Read())
            {
                ListItem item = new ListItem();
                item.Text  = (String)roles["rolename"];
                item.Value = roles["roleid"].ToString();

                if ((tab.AuthorizedRoles.LastIndexOf(item.Text)) > -1)
                {
                    item.Selected = true;
                }

                authRoles.Items.Add(item);
            }

            // Populate the "Add Module" Data
            moduleType.DataSource = admin.GetModuleDefinitions(portalSettings.PortalId);
            moduleType.DataBind();

            // Populate Right Hand Module Data
            rightList = GetModules("RightPane");
            rightPane.DataBind();

            // Populate Content Pane Module Data
            contentList = GetModules("ContentPane");
            contentPane.DataBind();

            // Populate Left Hand Pane Module Data
            leftList = GetModules("LeftPane");
            leftPane.DataBind();
        }
        //*******************************************************
        //
        // The BindData helper method is used to bind the list of
        // security roles for this portal to an asp:datalist server control
        //
        //*******************************************************

        private void BindData()
        {
            // Bind the Email and Password
            UsersDB     users = new UsersDB();
            IDataReader dr    = users.GetSingleUser(userName);

            // Read first row from database
            dr.Read();

            Email.Text    = (String)dr["email"];
            Password.Text = "";

            dr.Close();

            // add the user name to the title
            if (userName != "")
            {
                title.InnerText = "Manage User: "******"PortalSettings"];

            // Get the portal's roles from the database
            AdminDB admin = new AdminDB();

            // bind all portal roles to dropdownlist
            allRoles.DataSource = admin.GetPortalRoles(portalSettings.PortalId);
            allRoles.DataBind();
        }
Beispiel #3
0
        //*******************************************************
        //
        // The BindData helper method is used to bind the list of
        // security roles for this portal to an asp:datalist server control
        //
        //*******************************************************

        private void BindData()
        {
            // Obtain PortalSettings from Current Context
            PortalSettings portalSettings = (PortalSettings)Context.Items["PortalSettings"];

            // Get the portal's roles from the database
            AdminDB admin = new AdminDB();

            rolesList.DataSource = admin.GetPortalRoles(portalSettings.PortalId);
            rolesList.DataBind();
        }
Beispiel #4
0
        //*******************************************************
        //
        // The BindData helper method is used to populate a asp:datalist
        // server control with the current "edit access" permissions
        // set within the portal configuration system
        //
        //*******************************************************

        private void BindData()
        {
            // Obtain PortalSettings from Current Context
            PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];

            object value = GetModule();

            if (value != null)
            {
                ModuleSettings m = (ModuleSettings)value;

                // Update Textbox Settings
                moduleTitle.Text   = m.ModuleTitle;
                cacheTime.Text     = m.CacheTime.ToString();
                showMobile.Checked = m.ShowMobile;

                // Populate checkbox list with all security roles for this portal
                // and "check" the ones already configured for this module
                AdminDB     admin = new AdminDB();
                IDataReader roles = admin.GetPortalRoles(portalSettings.PortalId);

                // Clear existing items in checkboxlist
                authEditRoles.Items.Clear();

                ListItem allItem = new ListItem();
                allItem.Text = "All Users";

                if (m.AuthorizedEditRoles.LastIndexOf("All Users") > -1)
                {
                    allItem.Selected = true;
                }

                authEditRoles.Items.Add(allItem);

                while (roles.Read())
                {
                    ListItem item = new ListItem();
                    item.Text  = (String)roles["rolename"];
                    item.Value = roles["roleid"].ToString();

                    if ((m.AuthorizedEditRoles.LastIndexOf(item.Text)) > -1)
                    {
                        item.Selected = true;
                    }

                    authEditRoles.Items.Add(item);
                }
            }
        }
Beispiel #5
0
        //*******************************************************
        //
        // The ApplyChanges_Click server event handler on this page is used
        // to save the module settings into the portal configuration system
        //
        //*******************************************************

        private void ApplyChanges_Click(Object Sender, EventArgs e)
        {
            // Obtain PortalSettings from Current Context
            PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];

            object value = GetModule();

            if (value != null)
            {
                ModuleSettings m = (ModuleSettings)value;

                // Construct Authorized User Roles String
                String editRoles = "";

                foreach (ListItem item in authEditRoles.Items)
                {
                    if (item.Selected == true)
                    {
                        editRoles = editRoles + item.Text + ";";
                    }
                }

                // update module
                AdminDB admin = new AdminDB();
                admin.UpdateModule(moduleId, m.ModuleOrder, m.PaneName, moduleTitle.Text, Int32.Parse(cacheTime.Text), editRoles, showMobile.Checked);

                // Update Textbox Settings
                moduleTitle.Text = m.ModuleTitle;
                cacheTime.Text   = m.CacheTime.ToString();

                // Populate checkbox list with all security roles for this portal
                // and "check" the ones already configured for this module
                IDataReader roles = admin.GetPortalRoles(portalSettings.PortalId);

                // Clear existing items in checkboxlist
                authEditRoles.Items.Clear();

                ListItem allItem = new ListItem();
                allItem.Text = "All Users";

                if (m.AuthorizedEditRoles.LastIndexOf("All Users") > -1)
                {
                    allItem.Selected = true;
                }

                authEditRoles.Items.Add(allItem);

                while (roles.Read())
                {
                    ListItem item = new ListItem();
                    item.Text  = (String)roles["rolename"];
                    item.Value = roles["roleid"].ToString();

                    if ((m.AuthorizedEditRoles.LastIndexOf(item.Text)) > -1)
                    {
                        item.Selected = true;
                    }

                    authEditRoles.Items.Add(item);
                }
            }

            // Navigate back to admin page
            Response.Redirect("TabLayout.aspx?tabid=" + tabId);
        }