Ejemplo n.º 1
0
        private void AddMapping_Click(object sender, System.EventArgs e)
        {
            string[] apps = SsoConfigurator.GetApplications();

            if (Applications.Count == 0 && apps.Length == 0)
            {
                MessageBox.Show("You must create at least one affiliate application", "No affiliate applications",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                return;
            }

            AddMapping dlg = new AddMapping();

            if (DialogResult.OK == dlg.ShowDialog(this))
            {
                SsoMapping mapping = new SsoMapping();
                mapping.Application = dlg.Applications.Text;
                mapping.User        = dlg.User.Text;
                mapping.XU          = dlg.XU.Text;
                mapping.XP          = dlg.XP.Text;

                Mappings.Add(mapping);
            }
        }
Ejemplo n.º 2
0
        private void AddMapping_Load(object sender, System.EventArgs e)
        {
            string[] apps = SsoConfigurator.GetApplications();
            foreach (string app in apps)
            {
                Applications.Items.Add(app);
            }

            SsoPage ssoPage = (SsoPage)((SsoSampleWizard)Owner).GetPage(typeof(SsoPage));

            if (ssoPage.Applications.Count != 0)
            {
                foreach (SsoApplication application in ssoPage.Applications)
                {
                    Applications.Items.Add(application.Name);
                }
            }

            Applications.SelectedIndex = 0;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Called when the PageBase is activated
        /// </summary>
        /// <returns>True if activation successfull, otherwise false</returns>
        public override bool OnSetActive()
        {
            if (!base.OnSetActive())
            {
                return(false);
            }

            // Fill the applications drop down box
            string selected = null;

            if (Applications.Items.Count != 0)
            {
                selected = Applications.Text;
            }

            Applications.Items.Clear();

            string[] apps = SsoConfigurator.GetApplications();
            foreach (string app in apps)
            {
                Applications.Items.Add(app);
            }

            SsoPage ssoPage = (SsoPage)Wizard.GetPage(typeof(SsoPage));

            if (ssoPage.Applications.Count != 0)
            {
                foreach (SsoApplication application in ssoPage.Applications)
                {
                    Applications.Items.Add(application.Name);
                }
            }

            if (selected != null)
            {
                Applications.SelectedIndex = Applications.Items.IndexOf(selected);
            }
            else
            {
                if (Applications.Items.Count != 0)
                {
                    Applications.SelectedIndex = 0;
                }
            }

            // Fill the URI field
            IisPage iisPage    = (IisPage)Wizard.GetPage(typeof(IisPage));
            int     firstSlash = SendPortUri.Text.LastIndexOf("/");

            if (firstSlash != -1)
            {
                int secondSlash = SendPortUri.Text.LastIndexOf("/", firstSlash - 1);
                if (secondSlash != -1)
                {
                    SendPortUri.Text = SendPortUri.Text.Replace(
                        SendPortUri.Text.Substring(secondSlash + 1, firstSlash - secondSlash - 1),
                        iisPage.SendName.Text);
                }
            }

            OnTextChanged(null, null);

            return(true);
        }