public override void OnActionExecuting(ActionExecutingContext filterContext) { if (filterContext == null) { throw new ArgumentNullException("filterContext"); } if (SharePointLicenseProvider.Current == null) { SharePointLicenseProvider.NewProvider(filterContext.HttpContext); } }
public override void OnAuthorization(AuthorizationContext filterContext) { if (_refreshCache || SharePointLicenseProvider.Current == null) { SharePointLicenseProvider.NewProvider(filterContext.HttpContext); } if (_licenseTypes.Length == 0 || SharePointLicenses.Current.licenseType == LicenseType.None || !_licenseTypes.Contains(SharePointLicenses.Current.licenseType) || (SharePointLicenses.Current.licenseType == LicenseType.Trial && !SharePointLicenses.Current.allowTestMode)) { filterContext.Result = new ViewResult { ViewName = "NoLicense", ViewData = new ViewDataDictionary(new TestLicenseData()) }; } }
public static SharePointLicenseProvider NewProvider(HttpContextBase httpContext) { SharePointLicenseProvider.current = new SharePointLicenses(httpContext); return SharePointLicenseProvider.current; }
public static SharePointLicenseProvider NewProvider(HttpContextBase httpContext) { SharePointLicenseProvider.current = new SharePointLicenses(httpContext); return(SharePointLicenseProvider.current); }