Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the best place for license check?
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
MVC
Title:
What is the best place for license check?
Environment versions
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Application:
Web
Visual Studio:
Visual Studio 2017
Miscellaneous
Thread ID:
01659343
Message ID:
01659343
Views:
48
Hi everybody,

I'm trying to figure out the best way to incorporate check for expired license into our Web Application. All our controllers (except for the Login controller) are based on the BaseController class.

Originally we had the following in our BaseController
/// <summary>
        /// Puts the BaseUrl and Culture into the ViewBag for all controllers
        /// </summary>
        /// <param name="filterContext"></param>
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            base.OnActionExecuting(filterContext);

            ViewBag.OperatorSession = OperatorSession;
            ViewBag.BaseUrl = BaseUrl;
            ViewBag.Culture = System.Threading.Thread.CurrentThread.CurrentUICulture.Name;
            ModalMessageHelper.GetInstance().ResetAcknowledgments();
            //  CheckExpiration(); // no need to do it on every call
            //ViewBag.ModalMessageHelper = null;
            CheckAssignoThresholdViews();
        }
Note the commented call to CheckExpiration. Our License.ActiveLicense.IsValid is a static property which I may check instead. My question is - what is the best method to check for that property - should I use OnAuthorization method instead? Also, I want to re-direct to the ~/DataMaintenance/ImportLicenses page in this case where controller is also based on the BaseController - I am afraid I may go into the infinitive loop?

How should I handle the check for the license correctly to not allow by-passing it?

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform