Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the best place for license check?
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Titre:
What is the best place for license check?
Versions des environnements
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Application:
Web
Visual Studio:
Visual Studio 2017
Divers
Thread ID:
01659343
Message ID:
01659343
Vues:
49
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform