Server IP : 103.6.199.200 / Your IP : 3.133.129.8 Web Server : Microsoft-IIS/10.0 System : Windows NT EMPUSA 10.0 build 20348 (Windows Server 2016) i586 User : EMPUSA$ ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Domains/kmsjbcom/kmsjb.com/wwwroot/ |
Upload File : |
<%@ Application Language="C#" %> <%@ Import Namespace="System.Security.Principal" %> <%@ Import Namespace="System.IO" %> <%@ Import Namespace="System.IO.Compression" %> <%@ Import Namespace="YL.KIS" %> <script runat="server"> protected void Application_AuthenticateRequest(object sender, EventArgs e) { // Extract the forms authentication cookie string l_CookieName = FormsAuthentication.FormsCookieName; HttpCookie l_AuthCookie = Context.Request.Cookies[l_CookieName]; if (l_AuthCookie == null) { // There is no authentication cookie. return; } FormsAuthenticationTicket l_AuthTicket = null; try { l_AuthTicket = FormsAuthentication.Decrypt(l_AuthCookie.Value); } catch { // Log exception details (omitted for simplicity) return; } if (l_AuthTicket == null) { // Cookie failed to decrypt. return; } if (l_AuthTicket.Expired) { // Expired return; } // When the ticket was created, the UserData property was assigned // a pipe delimited string of role names. string[] l_Roles = new string[] { }; string l_UserData = l_AuthTicket.UserData; if (!string.IsNullOrEmpty(l_UserData)) { l_Roles = l_UserData.Split(','); } // Create an Identity object FormsIdentity l_Id = new FormsIdentity(l_AuthTicket); // This principal will flow throughout the request. GenericPrincipal principal = new GenericPrincipal(l_Id, l_Roles); // Attach the new principal object to the current HttpContext object Context.User = principal; } void Application_BeginRequest(object sender, EventArgs e) { System.Threading.Thread.CurrentThread.CurrentCulture = AppService.Culture; System.Threading.Thread.CurrentThread.CurrentUICulture = AppService.Culture; /* Fix for the Flash Player Cookie bug in Non-IE browsers. * Since Flash Player always sends the IE cookies even in FireFox * we have to bypass the cookies by sending the values as part of the POST or GET * and overwrite the cookies with the passed in values. * * The theory is that at this point (BeginRequest) the cookies have not been read by * the Session and Authentication logic and if we update the cookies here we'll get our * Session and Authentication restored correctly */ if (!Request.Url.Host.StartsWith ("www") && !Request.Url.IsLoopback) { UriBuilder builder = new UriBuilder (Request.Url); builder.Host = "www." + Request.Url.Host; Response.Redirect (builder.ToString (), true); } try { HttpContext.Current.Response.AddHeader( "p3p", "CP=\"CAO PSA OUR\"" );/* This Fix For IFrame*/ string session_param_name = "ASPSESSID"; string session_cookie_name = "ASP.NET_SESSIONID"; if (HttpContext.Current.Request.Form[session_param_name] != null) { UpdateCookie(session_cookie_name, HttpContext.Current.Request.Form[session_param_name]); } else if (HttpContext.Current.Request.QueryString[session_param_name] != null) { UpdateCookie(session_cookie_name, HttpContext.Current.Request.QueryString[session_param_name]); } } catch (Exception) { Response.StatusCode = 500; Response.Write("Error Initializing Session"); } try { string auth_param_name = "AUTHID"; string auth_cookie_name = FormsAuthentication.FormsCookieName; if (HttpContext.Current.Request.Form[auth_param_name] != null) { UpdateCookie(auth_cookie_name, HttpContext.Current.Request.Form[auth_param_name]); } else if (HttpContext.Current.Request.QueryString[auth_param_name] != null) { UpdateCookie(auth_cookie_name, HttpContext.Current.Request.QueryString[auth_param_name]); } } catch (Exception) { Response.StatusCode = 500; Response.Write("Error Initializing Forms Authentication"); } } void UpdateCookie(string cookie_name, string cookie_value) { HttpCookie cookie = HttpContext.Current.Request.Cookies.Get(cookie_name); if (cookie == null) { cookie = new HttpCookie(cookie_name); HttpContext.Current.Request.Cookies.Add(cookie); } cookie.Value = cookie_value; HttpContext.Current.Request.Cookies.Set(cookie); } void Application_Start(object sender, EventArgs e) { // Code that runs on application startup } void Application_End(object sender, EventArgs e) { // Code that runs on application shutdown } void Application_Error(object sender, EventArgs e) { // Code that runs when an unhandled error occurs } void Session_Start(object sender, EventArgs e) { System.Threading.Thread.CurrentThread.CurrentCulture = AppService.Culture; System.Threading.Thread.CurrentThread.CurrentUICulture = AppService.Culture; // Code that runs when a new session is started } void Session_End(object sender, EventArgs e) { // Code that runs when a session ends. // Note: The Session_End event is raised only when the sessionstate mode // is set to InProc in the Web.config file. If session mode is set to StateServer // or SQLServer, the event is not raised. } void Application_PreRequestHandlerExecute(object sender, EventArgs e) { HttpApplication app = sender as HttpApplication; string acceptEncoding = app.Request.Headers["Accept-Encoding"]; Stream prevUncompressedStream = app.Response.Filter; if (!(app.Context.CurrentHandler is Page || app.Context.CurrentHandler.GetType().Name == "SyncSessionlessHandler") || app.Request["HTTP_X_MICROSOFTAJAX"] != null) return; if (acceptEncoding == null || acceptEncoding.Length == 0) return; acceptEncoding = acceptEncoding.ToLower(); if (acceptEncoding.Contains("deflate") || acceptEncoding == "*") { // defalte app.Response.Filter = new DeflateStream(prevUncompressedStream, CompressionMode.Compress); app.Response.AppendHeader("Content-Encoding", "deflate"); } else if (acceptEncoding.Contains("gzip")) { // gzip app.Response.Filter = new GZipStream(prevUncompressedStream, CompressionMode.Compress); app.Response.AppendHeader("Content-Encoding", "gzip"); } } </script>