private void btnSetPassword_Click(object sender, EventArgs e)
        {
            string username = lstUsers.SelectedItem.ToString();

            using (SC.GUI.Utility.RequestString req = new SC.GUI.Utility.RequestString())
            {
                req.QuestionString = "Please enter password for " + username;
                req.IsPassword     = true;
                if (req.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                try
                {
                    secMan.SetPassword(username, req.UserInput);
                }
                catch (SC.Interfaces.SCException sce)
                {
                    SC.GUI.Utility.ErrorForm.ShowErrorForm(sce);
                }
                catch (System.Security.SecurityException se)
                {
                    SC.GUI.Utility.ErrorForm.ShowErrorForm(se);
                }
            }
        }
        private void btnAddUser_Click(object sender, EventArgs e)
        {
            using (SC.GUI.Utility.RequestString req = new SC.GUI.Utility.RequestString())
            {
                req.QuestionString = "Please enter the username";
                if (req.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                string username = req.UserInput;
                req.UserInput = "";

                req.QuestionString = "Please enter " + username + "'s password.";
                req.IsPassword     = true;
                if (req.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                string password = req.UserInput;
                secMan.AddUser(username, password);
            }
            ReloadView();
        }
예제 #3
0
        private void btnAddServer_Click(object sender, EventArgs e)
        {
            using (SC.GUI.Utility.RequestString req = new SC.GUI.Utility.RequestString())
            {
                req.QuestionString = "Please enter the name of the server:";
                if (req.ShowDialog() != DialogResult.OK)
                    return;

                string servername = req.UserInput;
                root.AddServer(servername);
                RefreshView();
            }
        }
예제 #4
0
        private void btnAddServer_Click(object sender, EventArgs e)
        {
            using (SC.GUI.Utility.RequestString req = new SC.GUI.Utility.RequestString())
            {
                req.QuestionString = "Please enter the name of the server:";
                if (req.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                string servername = req.UserInput;
                root.AddServer(servername);
                RefreshView();
            }
        }
        private void btnAddUser_Click(object sender, EventArgs e)
        {
            using (SC.GUI.Utility.RequestString req = new SC.GUI.Utility.RequestString())
            {
                req.QuestionString = "Please enter the username";
                if (req.ShowDialog() != DialogResult.OK)
                    return;

                string username = req.UserInput;
                req.UserInput = "";

                req.QuestionString = "Please enter " + username + "'s password.";
                req.IsPassword = true;
                if (req.ShowDialog() != DialogResult.OK)
                    return;

                string password = req.UserInput;
                secMan.AddUser(username, password);
            }
            ReloadView();
        }
        private void btnSetPassword_Click(object sender, EventArgs e)
        {
            string username = lstUsers.SelectedItem.ToString();
            using (SC.GUI.Utility.RequestString req = new SC.GUI.Utility.RequestString())
            {
                req.QuestionString = "Please enter password for " + username;
                req.IsPassword = true;
                if (req.ShowDialog() != DialogResult.OK)
                    return;

                try
                {
                    secMan.SetPassword(username, req.UserInput);
                }
                catch (SC.Interfaces.SCException sce)
                {
                    SC.GUI.Utility.ErrorForm.ShowErrorForm(sce);
                }
                catch (System.Security.SecurityException se)
                {
                    SC.GUI.Utility.ErrorForm.ShowErrorForm(se);
                }
            }
        }