Example #1
0
        private void permissionsButton_Click(object sender, EventArgs e)
        {
            // Impersonates the specific user and reports back with permissions
            // If left blank then it uses the current user
            var test = new AdminShareTest();

            try
            {
                if (textBox1.Text != String.Empty && textBox2.Text != String.Empty)
                {
                    Impersonator user = new Impersonator(textBox1.Text, textBox2.Text);
                    user.Impersonate();
                    test.DiscoverPermissions(comboBox1.Text);
                    user.EndImpersonating();
                }
                else
                {
                    test.DiscoverPermissions(comboBox1.Text);
                }
                permissions.Text = test.report;
            }
            catch { permissions.Text = "Incorrect username or password"; }
        }
Example #2
0
        private void permissionsButton_Click(object sender, EventArgs e)
        {
            // Impersonates the specific user and reports back with permissions
            // If left blank then it uses the current user
            var test = new AdminShareTest();

            try
            {
                if (textBox1.Text != String.Empty && textBox2.Text != String.Empty)
                {
                    Impersonator user = new Impersonator(textBox1.Text, textBox2.Text);
                    user.Impersonate();
                    test.DiscoverPermissions(comboBox1.Text);
                    user.EndImpersonating();
                }
                else
                {
                    test.DiscoverPermissions(comboBox1.Text);
                }
                permissions.Text = test.report;
            }
            catch { permissions.Text = "Incorrect username or password"; }
        }