예제 #1
0
        public void OnOkClicked(object o, EventArgs args)
        {
            LdapEntry entry = null;

            if (isEdit)
            {
                entry = CreateEntry(currentEntry.DN);

                LdapEntryAnalyzer lea = new LdapEntryAnalyzer();
                lea.Run(currentEntry, entry);

                if (lea.Differences.Length == 0)
                {
                    return;
                }

                if (!Util.ModifyEntry(conn, entry.DN, lea.Differences))
                {
                    errorOccured = true;
                }
            }
            else
            {
                string userDN = null;

                if (string.IsNullOrEmpty(this.defaultNewContainer))
                {
                    SelectContainerDialog scd = new SelectContainerDialog(conn, groupDialog);
                    scd.Title   = "Save Group";
                    scd.Message = String.Format("Where in the directory would\nyou like save the group\n{0}?", groupNameEntry.Text);
                    scd.Run();

                    if (string.IsNullOrEmpty(scd.DN))
                    {
                        return;
                    }

                    userDN = String.Format("cn={0},{1}", groupNameEntry.Text, scd.DN);
                }
                else
                {
                    userDN = String.Format("cn={0},{1}", groupNameEntry.Text, this.defaultNewContainer);
                }

                entry = CreateEntry(userDN);

                string[] missing = LdapEntryAnalyzer.CheckRequiredAttributes(conn, entry);
                if (missing.Length != 0)
                {
                    missingAlert(missing);
                    missingValues = true;
                    return;
                }

                if (!Util.AddEntry(conn, entry))
                {
                    errorOccured = true;
                }
            }
        }
예제 #2
0
        public void OnOkClicked(object o, EventArgs args)
        {
            LdapEntry entry = null;

            entry = CreateEntry(currentEntry.DN);

            LdapEntryAnalyzer lea = new LdapEntryAnalyzer();

            lea.Run(currentEntry, entry);

            if (lea.Differences.Length == 0)
            {
                return;
            }

            if (!Util.ModifyEntry(conn, entry.DN, lea.Differences))
            {
                errorOccured = true;
            }
        }
예제 #3
0
        public void OnOkClicked(object o, EventArgs args)
        {
            LdapEntry entry = null;

             entry = CreateEntry (currentEntry.DN);

             LdapEntryAnalyzer lea = new LdapEntryAnalyzer ();
             lea.Run (currentEntry, entry);

             if (lea.Differences.Length == 0)
             	return;

             if (!Util.ModifyEntry (conn, entry.DN, lea.Differences))
             	errorOccured = true;
        }
예제 #4
0
        public void OnOkClicked(object o, EventArgs args)
        {
            LdapEntry entry = null;

            if (isEdit) {
                 entry = CreateEntry (currentEntry.DN);

                 LdapEntryAnalyzer lea = new LdapEntryAnalyzer ();
                 lea.Run (currentEntry, entry);

                 if (lea.Differences.Length == 0)
                 	return;

                 if (!Util.ModifyEntry (conn, entry.DN, lea.Differences))
                 	errorOccured = true;

            } else {

                string userDN = null;

                if (string.IsNullOrEmpty(this.defaultNewContainer)) {

                    SelectContainerDialog scd =	new SelectContainerDialog (conn, groupDialog);
                    scd.Title = "Save Group";
                    scd.Message = String.Format ("Where in the directory would\nyou like save the group\n{0}?", groupNameEntry.Text);
                    scd.Run ();

                    if (string.IsNullOrEmpty(scd.DN))
                        return;

                    userDN = String.Format ("cn={0},{1}", groupNameEntry.Text, scd.DN);

                } else {

                    userDN = String.Format ("cn={0},{1}", groupNameEntry.Text, this.defaultNewContainer);
                }

                entry = CreateEntry (userDN);

                string[] missing = LdapEntryAnalyzer.CheckRequiredAttributes (conn, entry);
                if (missing.Length != 0) {
                    missingAlert (missing);
                    missingValues = true;
                    return;
                }

                if (!Util.AddEntry (conn, entry))
                    errorOccured = true;
            }
        }