public ActionResult IndexPost(IndexViewModel viewModel) { if (!_orchardServices.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to manage open authentication settings"))) return new HttpUnauthorizedResult(); var settings = _orchardServices.WorkContext.CurrentSite.As<OpenAuthenticationSettingsPart>(); settings.AutoRegistrationEnabled = viewModel.AutoRegistrationEnabled; return RedirectToAction("Index"); }
public ActionResult Index() { if (!_orchardServices.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to manage open authentication settings"))) return new HttpUnauthorizedResult(); var settings = _orchardServices.WorkContext.CurrentSite.As<OpenAuthenticationSettingsPart>(); var currentProviders = _providerConfigurationService.GetAll(); var viewModel = new IndexViewModel { AutoRegistrationEnabled = settings.AutoRegistrationEnabled, CurrentProviders = currentProviders }; return View(viewModel); }