Beispiel #1
0
 private void loadSessionVariables()
 {
     this.lsvMembers         = this.Session["lsvMembers"] as ListView;
     this.lsvNonMembers      = this.Session["lsvNonMembers"] as ListView;
     this.MembersToAdd       = this.Session["MembersToAdd"] as GenericMemberCollection;
     this.MembersToRemove    = this.Session["MembersToRemove"] as GenericMemberCollection;
     this.NonMembersToAdd    = this.Session["NonMembersToAdd"] as GenericMemberCollection;
     this.NonMembersToRemove = this.Session["NonMembersToRemove"] as GenericMemberCollection;
     this.modified           = (bool)this.Session["modified"];
 }
 private bool FindMember(GenericMemberCollection members, string name)
 {
     foreach (GenericMember m in members)
     {
         if (m.Name == name)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #3
0
 private bool FindMember(GenericMemberCollection members, IAzManSid sid)
 {
     foreach (GenericMember m in members)
     {
         if (m.sid.StringValue == sid.StringValue)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.storage = this.Session["storage"] as IAzManStorage;
            if (this.Session["selectedObject"] as IAzManApplication != null)
            {
                this.application            = this.Session["selectedObject"] as IAzManApplication;
                this.Session["application"] = this.application;
            }
            if (this.Session["selectedObject"] as IAzManApplicationGroup != null)
            {
                this.applicationGroup            = this.Session["selectedObject"] as IAzManApplicationGroup;
                this.Session["applicationGroup"] = this.applicationGroup;
                this.Session["store"]            = this.applicationGroup.Application.Store;
                this.Session["application"]      = this.applicationGroup.Application;
            }
            this.Text        = "Application Group properties" + (this.applicationGroup != null ? ": " + this.applicationGroup.Name : String.Empty);
            this.Description = "Application Group properties";
            this.Title       = this.Text;
            if (!Page.IsPostBack)
            {
                this.MembersToAdd             = new GenericMemberCollection();
                this.MembersToRemove          = new GenericMemberCollection();
                this.NonMembersToAdd          = new GenericMemberCollection();
                this.NonMembersToRemove       = new GenericMemberCollection();
                this.lsvMembers               = new ListView();
                this.lsvNonMembers            = new ListView();
                this.mnuTab.Items[1].Selected = true; //0 is blank
                this.mnuTab_MenuItemClick(this, new System.Web.UI.WebControls.MenuEventArgs(this.mnuTab.Items[1]));
                this.txtName.Text        = this.applicationGroup.Name;
                this.txtDescription.Text = this.applicationGroup.Description;
                this.txtGroupType.Text   = (this.applicationGroup.GroupType == GroupType.Basic ? "Basic group" : "LDAP Query group");

                if (this.applicationGroup.GroupType == GroupType.Basic)
                {
                    this.btnMembersAddApplicationGroup.Enabled = this.btnNonMembersAddApplicationGroup.Enabled = this.applicationGroup.Application.HasApplicationGroups();
                    this.mnuTab.Items.RemoveAt(3);
                    this.mnuTab.Items.RemoveAt(2);
                    this.lsvMembers.Items.Clear();
                    this.lsvNonMembers.Items.Clear();
                    this.setImage("StoreApplicationGroup_32x32.gif");
                }
                else
                {
                    this.mnuTab.Items.RemoveAt(7);
                    this.mnuTab.Items.RemoveAt(6);
                    this.mnuTab.Items.RemoveAt(5);
                    this.mnuTab.Items.RemoveAt(4);
                    this.setImage("WindowsQueryLDAPGroup_32x32.gif");
                }
                this.RefreshApplicationGroupProperties();
                this.saveSessionVariables();
                this.modified = false;
                this.txtName.Focus();
            }
            else
            {
                this.loadSessionVariables();
                if (this.Session["selectedStoreGroups"] != null)
                {
                    if (this.mnuTab.SelectedValue == "Members")
                    {
                        this.btnMembersAddStoreGroups_Click(this, EventArgs.Empty);
                    }
                    else if (this.mnuTab.SelectedValue == "Non Members")
                    {
                        this.btnNonMembersAddStoreGroup_Click(this, EventArgs.Empty);
                    }
                }
                if (this.Session["selectedApplicationGroups"] != null)
                {
                    if (this.mnuTab.SelectedValue == "Members")
                    {
                        this.btnMembersAddApplicationGroups_Click(this, EventArgs.Empty);
                    }
                    else if (this.mnuTab.SelectedValue == "Non Members")
                    {
                        this.btnNonMembersAddApplicationGroup_Click(this, EventArgs.Empty);
                    }
                }
                if (this.Session["selectedDBUsers"] != null)
                {
                    if (this.mnuTab.SelectedValue == "Members")
                    {
                        this.btnMembersAddDBUsers_Click(this, EventArgs.Empty);
                    }
                    else if (this.mnuTab.SelectedValue == "Non Members")
                    {
                        this.btnNonMembersAddDBUsers_Click(this, EventArgs.Empty);
                    }
                }
                if (this.Session["selectedADObjects"] != null)
                {
                    if (this.mnuTab.SelectedValue == "Members")
                    {
                        this.btnMembersAddWindowsUsersAndGroups_Click(this, EventArgs.Empty);
                    }
                    else if (this.mnuTab.SelectedValue == "Non Members")
                    {
                        this.btnNonMembersAddWindowsUsersAndGroup_Click(this, EventArgs.Empty);
                    }
                }
            }
        }