Пример #1
0
        public void OnAddGroupClicked(object o, EventArgs args)
        {
            List <string> tmp = new List <string> ();

            foreach (KeyValuePair <string, LdapEntry> kvp in _allGroups)
            {
                if (kvp.Key == primaryGroupLabel.Text || _memberOfGroups.ContainsKey(kvp.Key))
                {
                    continue;
                }

                tmp.Add(kvp.Key);
            }

            SelectGroupsDialog sgd = new SelectGroupsDialog(tmp.ToArray());

            foreach (string name in sgd.SelectedGroupNames)
            {
                _memberOfStore.AppendValues(name);

                if (!_memberOfGroups.ContainsKey(name))
                {
                    _memberOfGroups.Add(name, "memberUid");
                }

                LdapAttribute    attr = new LdapAttribute("memberUid", conn.Data.GetAttributeValueFromEntry(currentEntry, "uid"));
                LdapModification lm   = new LdapModification(LdapModification.ADD, attr);

                _modsGroup.Add(name, lm);

                updateGroupMembership();

                _modsGroup.Clear();
            }
        }
Пример #2
0
        public void OnSetPrimaryGroupClicked(object o, EventArgs args)
        {
            List <string> tmp = new List <string> ();

            foreach (KeyValuePair <string, LdapEntry> kvp in _allGroups)
            {
                if (kvp.Key == primaryGroupLabel.Text)
                {
                    continue;
                }

                tmp.Add(kvp.Key);
            }

            SelectGroupsDialog sgd = new SelectGroupsDialog(tmp.ToArray());

            if (sgd.SelectedGroupNames.Length > 0)
            {
                primaryGroupLabel.Text = sgd.SelectedGroupNames[0];
            }
        }
Пример #3
0
        public void OnSetPrimaryGroupClicked(object o, EventArgs args)
        {
            List<string> tmp = new List<string> ();

            foreach (KeyValuePair<string, LdapEntry> kvp in _allGroups) {

                if (kvp.Key == primaryGroupLabel.Text)
                    continue;

                tmp.Add (kvp.Key);
            }

            SelectGroupsDialog sgd = new SelectGroupsDialog (tmp.ToArray());

            if (sgd.SelectedGroupNames.Length > 0)
                primaryGroupLabel.Text = sgd.SelectedGroupNames[0];
        }
Пример #4
0
        public void OnAddGroupClicked(object o, EventArgs args)
        {
            List<string> tmp = new List<string> ();

            foreach (KeyValuePair<string, LdapEntry> kvp in _allGroups) {
                if (kvp.Key == primaryGroupLabel.Text || _memberOfGroups.ContainsKey (kvp.Key))
                    continue;

                tmp.Add (kvp.Key);
            }

            SelectGroupsDialog sgd = new SelectGroupsDialog (tmp.ToArray ());

            foreach (string name in sgd.SelectedGroupNames) {

                _memberOfStore.AppendValues (name);

                if (!_memberOfGroups.ContainsKey (name))
                    _memberOfGroups.Add (name, "memberUid");

                LdapAttribute attr = new LdapAttribute ("memberUid", conn.Data.GetAttributeValueFromEntry (currentEntry, "uid"));
                LdapModification lm = new LdapModification (LdapModification.ADD, attr);

                _modsGroup.Add (name, lm);

                updateGroupMembership ();

                _modsGroup.Clear ();
            }
        }