Esempio n. 1
0
        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));
        }
        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,
                AutoMergeNewUsersEnabled = settings.AutoMergeNewUsersEnabled,
                CurrentProviders         = currentProviders,
                ShowAppDirectSetting     = _utilServices.FeatureIsEnabled("Laser.Orchard.OpenAuthentication.AppDirect"),
                AppDirectBaseUrl         = settings.AppDirectBaseUrl
            };

            return(View(viewModel));
        }