Beispiel #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;
                }
            }
        }
Beispiel #2
0
        public void OnSearchBaseClicked(object o, EventArgs args)
        {
            TreeIter iter;

            if (!serverComboBox.GetActiveIter(out iter))
            {
                return;
            }

            string     profileName = (string)serverComboBox.Model.GetValue(iter, 0);
            Connection conn        = Global.Connections [profileName];

            try {
                SelectContainerDialog scd = new SelectContainerDialog(conn, mainWindow);
                scd.Message = String.Format(Mono.Unix.Catalog.GetString("Where in the directory would\nyou like to start the search?"));
                scd.Title   = Mono.Unix.Catalog.GetString("Select search base");
                scd.Run();

                if (!scd.DN.Equals("") && !scd.DN.Equals(conn.Settings.Host))
                {
                    searchBaseButton.Label = scd.DN;
                    searchButton.Sensitive = true;
                }
            } catch {}
        }
Beispiel #3
0
        public void OnSearchBaseClicked(object o, EventArgs args)
        {
            SelectContainerDialog scd = new SelectContainerDialog(conn, null);

            scd.Message = String.Format(Mono.Unix.Catalog.GetString("Select a search base"));
            scd.Title   = Mono.Unix.Catalog.GetString("Select container");
            scd.Run();

            if (!scd.DN.Equals("") && !scd.DN.Equals(conn.Settings.Host))
            {
                searchBaseButton.Label = scd.DN;
            }
        }
Beispiel #4
0
        void SelectContainer(string msg, string title, Gtk.Entry entry)
        {
            Connection conn = GetCurrentConnection();

            SelectContainerDialog scd = new SelectContainerDialog(conn, sambaPopulateDialog);

            scd.Message = msg;
            scd.Title   = title;
            scd.Run();

            if (!scd.DN.Equals("") && !scd.DN.Equals(conn.Settings.Host))
            {
                entry.Text = scd.DN;
            }
        }
Beispiel #5
0
        public void OnBrowseClicked(object o, EventArgs args)
        {
            SelectContainerDialog scd = new SelectContainerDialog(conn, createEntryDialog);

            scd.Message = String.Format(
                Mono.Unix.Catalog.GetString(
                    "Where in the directory would\nyou like to save the entry?"));

            scd.Title = Mono.Unix.Catalog.GetString("Select entry base");
            scd.Run();

            if (!scd.DN.Equals("") && !scd.DN.Equals(conn.Settings.Host))
            {
                browseButton.Label = scd.DN;
            }
        }
Beispiel #6
0
        public void OnOkClicked(object o, EventArgs args)
        {
            LdapEntry entry  = null;
            string    userDN = null;

            if (!IsUserNameAvailable() || !IsUIDAvailable() || (IsPasswordEmpty() && dontRequirePasswords == false))
            {
                errorOccured = true;
                return;
            }

            if (this.defaultNewContainer == null)
            {
                SelectContainerDialog scd = new SelectContainerDialog(conn, newUserDialog);
                scd.Title   = "Save Group";
                scd.Message = String.Format("Where in the directory would\nyou like save the user\n{0}", displayNameEntry.Text);
                scd.Run();

                if (scd.DN == "")
                {
                    return;
                }

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

            entry = CreateEntry(userDN);

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

            updateGroupMembership();

            if (!Util.AddEntry(conn, entry))
            {
                errorOccured = true;
            }
        }
Beispiel #7
0
        public void OnManChangeClicked(object o, EventArgs args)
        {
            SelectContainerDialog scd = new SelectContainerDialog(conn, editAdComputerDialog);

            scd.Title   = "Save Computer";
            scd.Message = Mono.Unix.Catalog.GetString(
                "Select a user who will manage ") +
                          computerNameLabel.Text;

            scd.Run();

            if (scd.DN == "")
            {
                return;
            }
            else
            {
                manNameEntry.Text = scd.DN;
                updateManagedBy(scd.DN);
            }
        }
Beispiel #8
0
        public void OnOkClicked(object o, EventArgs args)
        {
            LdapEntry entry = null;

            string userDN = null;

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

                if (scd.DN == "")
                {
                    return;
                }

                userDN = String.Format("cn={0},{1}", gnDisplayName.Text, scd.DN);
            }
            else
            {
                userDN = String.Format("cn={0},{1}", gnDisplayName.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;
            }
        }
Beispiel #9
0
        public void OnExportActivate(object o, EventArgs args)
        {
            Connection conn = GetActiveConnection();

            if (conn == null)
            {
                return;
            }

            SelectContainerDialog scd = new SelectContainerDialog(conn, mainWindow);

            scd.Title   = Mono.Unix.Catalog.GetString("Export entry");
            scd.Message = Mono.Unix.Catalog.GetString("Select the container you wish to export.");
            scd.Run();

            if (scd.DN.Equals(""))
            {
                return;
            }

            Util.ExportData(conn, mainWindow, scd.DN);
        }
Beispiel #10
0
        public void OnSearchBaseClicked(object o, EventArgs args)
        {
            SelectContainerDialog scd = new SelectContainerDialog (conn, null);
            scd.Message = String.Format (Mono.Unix.Catalog.GetString ("Select a search base"));
            scd.Title = Mono.Unix.Catalog.GetString ("Select container");
            scd.Run ();

            if (!scd.DN.Equals ("") && !scd.DN.Equals (conn.Settings.Host))
                searchBaseButton.Label = scd.DN;
        }
Beispiel #11
0
        public void OnManChangeClicked(object o, EventArgs args)
        {
            SelectContainerDialog scd = new SelectContainerDialog (conn, editAdComputerDialog);
            scd.Title = "Save Computer";
            scd.Message = Mono.Unix.Catalog.GetString (
                    "Select a user who will manage ") +
                    computerNameLabel.Text;

            scd.Run ();

            if (scd.DN == "") {
                return;
            } else {
                manNameEntry.Text = scd.DN;
                updateManagedBy (scd.DN);
            }
        }
Beispiel #12
0
        public void OnBrowseClicked(object o, EventArgs args)
        {
            SelectContainerDialog scd = new SelectContainerDialog (conn, createEntryDialog);

            scd.Message = String.Format (
                Mono.Unix.Catalog.GetString (
                "Where in the directory would\nyou like to save the entry?"));

            scd.Title = Mono.Unix.Catalog.GetString ("Select entry base");
            scd.Run ();

            if (!scd.DN.Equals ("") && !scd.DN.Equals (conn.Settings.Host))
                browseButton.Label = scd.DN;
        }
Beispiel #13
0
        void SelectContainer(string msg, string title, Gtk.Entry entry)
        {
            Connection conn = GetCurrentConnection ();

            SelectContainerDialog scd = new SelectContainerDialog (conn, sambaPopulateDialog);

            scd.Message = msg;
            scd.Title = title;
            scd.Run ();

            if (!scd.DN.Equals ("") && !scd.DN.Equals (conn.Settings.Host))
                entry.Text = scd.DN;
        }
Beispiel #14
0
        public void OnOkClicked(object o, EventArgs args)
        {
            LdapEntry entry = null;

            string userDN = null;

            if (this.defaultNewContainer == null) {

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

                if (scd.DN == "")
                    return;

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

            } else {

                userDN = String.Format ("cn={0},{1}", gnDisplayName.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;
        }
Beispiel #15
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;
            }
        }
Beispiel #16
0
        public void OnOkClicked(object o, EventArgs args)
        {
            LdapEntry entry = null;
            string userDN = null;

            if (!IsUserNameAvailable() || !IsUIDAvailable() || (IsPasswordEmpty() && dontRequirePasswords == false)) {
                errorOccured = true;
                return;
            }

            if (this.defaultNewContainer == null) {

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

                if (scd.DN == "")
                    return;

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

            } else {

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

            entry = CreateEntry (userDN);

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

            updateGroupMembership ();

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