Ejemplo n.º 1
0
 private void checkCookieExistence(string cookie)
 {
     if (cookie == "")
     {
         var cookiesList = PreventiveMaintenanceManager.AuthenticateMaximo();
         if (cookiesList != null)
         {
             var cookieObj = PreventiveMaintenanceManager.setCookie(cookiesList[0].Name, cookiesList[0].Value, 30);
             Response.Cookies.Add(cookieObj);
         }
     }
 }
Ejemplo n.º 2
0
 // GET: PrimeTPrime
 #region Prime_TPrime_Ticketing
 public ActionResult Index()
 {
     if (User.Identity.HasPermission("perm_prime_tprime_open") || User.Identity.HasPermission("perm_prime_tprime_view"))
     {
         ViewBag.PrimeTPrimePermissions = User.Identity.GetPermissionsList();
         var checkCookieExistance = PreventiveMaintenanceManager.getCookie("LtpaToken2", "LtpaToken2");
         if (checkCookieExistance == "")
         {
             var cookiesList = PreventiveMaintenanceManager.AuthenticateMaximo();
             if (cookiesList != null)
             {
                 var cookieObj = PreventiveMaintenanceManager.setCookie(cookiesList[0].Name, cookiesList[0].Value, 30);
                 Response.Cookies.Add(cookieObj);
             }
         }
         return(View());
     }
     else
     {
         return(RedirectToAction("Index", "Dashboard"));
     }
 }