コード例 #1
0
        public virtual ActionResult Methods(DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageExternalAuthenticationMethods))
            {
                return(AccessDeniedKendoGridJson());
            }

            var methodsModel = new List <AuthenticationMethodModel>();
            var methods      = _openAuthenticationService.LoadAllExternalAuthenticationMethods();

            foreach (var method in methods)
            {
                var tmp1 = method.ToModel();
                tmp1.IsActive = method.IsMethodActive(_externalAuthenticationSettings);
                methodsModel.Add(tmp1);
            }
            methodsModel = methodsModel.ToList();
            var gridModel = new DataSourceResult
            {
                Data  = methodsModel,
                Total = methodsModel.Count
            };

            return(Json(gridModel));
        }
コード例 #2
0
        public ActionResult Methods(GridCommand command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageExternalAuthenticationMethods))
            {
                return(AccessDeniedView());
            }

            var methodsModel = new List <AuthenticationMethodModel>();
            var methods      = _openAuthenticationService.LoadAllExternalAuthenticationMethods();

            foreach (var method in methods)
            {
                var tmp1 = method.ToModel();
                tmp1.IsActive = method.IsMethodActive(_externalAuthenticationSettings);
                methodsModel.Add(tmp1);
            }
            methodsModel = methodsModel.ForCommand(command).ToList();
            var gridModel = new GridModel <AuthenticationMethodModel>
            {
                Data  = methodsModel,
                Total = methodsModel.Count()
            };

            return(new JsonResult
            {
                Data = gridModel
            });
        }
コード例 #3
0
        public ActionResult Providers()
        {
            var methodsModel = new List <AuthenticationMethodModel>();
            var methods      = _openAuthenticationService.LoadAllExternalAuthenticationMethods();

            foreach (var method in methods)
            {
                var model = _pluginMediator.ToProviderModel <IExternalAuthenticationMethod, AuthenticationMethodModel>(method);
                model.IsActive = method.IsMethodActive(_externalAuthenticationSettings);
                methodsModel.Add(model);
            }

            return(View(methodsModel));
        }
コード例 #4
0
        public ActionResult Providers()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageExternalAuthenticationMethods))
            {
                return(AccessDeniedView());
            }

            var methodsModel = new List <AuthenticationMethodModel>();
            var methods      = _openAuthenticationService.LoadAllExternalAuthenticationMethods();

            foreach (var method in methods)
            {
                var model = _pluginMediator.ToProviderModel <IExternalAuthenticationMethod, AuthenticationMethodModel>(method);
                model.IsActive = method.IsMethodActive(_externalAuthenticationSettings);
                methodsModel.Add(model);
            }

            return(View(methodsModel));
        }
コード例 #5
0
 /// <summary>
 /// Load all external authentication methods
 /// </summary>
 /// <param name="customer">Load records allowed only to a specified customer; pass null to ignore ACL permissions</param>
 /// <param name="storeId">Load records allowed only in a specified store; pass 0 to load all records</param>
 /// <returns>External authentication methods</returns>
 public IList <IExternalAuthenticationMethod> LoadAllExternalAuthenticationMethods(Customer customer = null, int storeId = 0)
 {
     return(_openAuthenticationService.LoadAllExternalAuthenticationMethods(customer, storeId));
 }