コード例 #1
0
        public virtual ActionResult AcsSettings(AccessControlServiceSettings acsSettings)
        {
            ViewBag.Themes           = ThemeProvider.GetThemes();
            ViewBag.FileRepositories = FileRepositoriesInfo().Keys;
            if (!ModelState.IsValid)
            {
                ModelState.AddModelError("", "Your settings could not be saved. Please fix the errors shown below.");
                return(View(acsSettings));
            }

            // Special validation that the AudienceUris are indeed Uris. Only save the ones that are.
            acsSettings.AudienceUris = string.Join(
                Constants.Strings.NewLine,
                acsSettings
                .AudienceUris
                .Split(Constants.Chars.NewLine, Constants.Chars.Space)
                .Where(a => { Uri uri; return(Uri.TryCreate(a, UriKind.Absolute, out uri)); })
                .Select(a => new Uri(a)));

            SettingsProvider.SaveSettings(acsSettings);

            FederatedAuthenticationConfigurator.InitiateFederatedAuthentication(acsSettings);

            return(RedirectToAction("AcsSettings").AndFlash("Your changes have been saved"));
        }
コード例 #2
0
        public virtual ActionResult AcsSettings()
        {
            var settings = SettingsProvider.GetSettings <AccessControlServiceSettings>();

            ViewBag.Themes           = ThemeProvider.GetThemes();
            ViewBag.FileRepositories = FileRepositoriesInfo().Keys;
            return(View(settings));
        }
コード例 #3
0
        public virtual ActionResult Settings()
        {
            var settings = SettingsProvider.GetSettings <FunnelWebSettings>();

            ViewBag.Themes           = ThemeProvider.GetThemes();
            ViewBag.FileRepositories = FileRepositoriesInfo().Keys;
            return(View(settings));
        }
コード例 #4
0
        public virtual ActionResult Settings(FunnelWebSettings settings)
        {
            ViewBag.Themes           = ThemeProvider.GetThemes();
            ViewBag.FileRepositories = FileRepositoriesInfo().Keys;
            if (!ModelState.IsValid)
            {
                ModelState.AddModelError("", "Your settings could not be saved. Please fix the errors shown below.");
                return(View(settings));
            }

            SettingsProvider.SaveSettings(settings);

            return(RedirectToAction("Settings", "Admin").AndFlash("Your changes have been saved"));
        }