Ejemplo n.º 1
0
        public void Logout()
        {
            string CachedLogoutPath = LogoutPath;

            CswSessionManager.clearSession();
            Redirect(CachedLogoutPath);
        }
Ejemplo n.º 2
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                //bz # 9278


                CswSessionResourcesNbt = new CswSessionResourcesNbt(Context.Application, Context.Request, Context.Response, Context, string.Empty, CswEnumSetupMode.NbtWeb);


                CswNbtResources = CswSessionResourcesNbt.CswNbtResources;


                _CswSessionManager      = CswSessionResourcesNbt.CswSessionManager;
                _CswNbtStatisticsEvents = CswSessionResourcesNbt.CswNbtStatisticsEvents;
                CswNbtResources.beginTransaction();

                // Setup statistics events
                OnEndOfPageLifeCycle += new EndOfPageLifeCycleHandler(_CswNbtStatisticsEvents.OnEndOfPageLifeCycle);

                //CswNbtResources.CswNbtNodeFactory.OnWriteNode += new CswNbtNode.OnRequestWriteNodeHandler( _CswNbtStatisticsEvents.OnWriteNode );
                //CswNbtResources.CswNbtNodeFactory.OnDeleteNode += new CswNbtNode.OnRequestDeleteNodeHandler( _CswNbtStatisticsEvents.OnDeleteNode );



                LogTimerResult("Base.OnInit() started", Timer.ElapsedDurationInSecondsAsString);

                //bz # 9278
                if (_CswSessionManager.IsAuthenticated() && _CswSessionManager.TimedOut)
                {
                    string LP = LogoutPath;
                    if (Page.Request.IsAuthenticated)
                    {
                        FormsAuthentication.SignOut();
                    }
                    //ReleaseAll();
                    //CswSessionResourcesNbt.DeAuthenticate(); //bz # 6163
                    Redirect(LP);
                }

                if (!CswSessionManager.IsAuthenticated())
                {
                    string ScriptName = HttpContext.Current.Request.ServerVariables["SCRIPT_NAME"];
                    if (ScriptName.Substring(ScriptName.LastIndexOf('/')) != "/Main.html")
                    {
                        //ReleaseAll();
                        Redirect(LogoutPath);
                    }
                }

                base.OnInit(e);

                LogTimerResult("Base.OnInit() finished", Timer.ElapsedDurationInSecondsAsString);
            }
            catch (Exception ex)
            {
                HandleError(ex);
            }
        }//OnInit()
Ejemplo n.º 3
0
        }//Authenticate()

        public bool IsAuthenticated()
        {
            bool ReturnVal = false;

            if (CswSessionManager.IsAuthenticated())
            {
                ReturnVal = true;
                CswSessionManager.updateLastAccess(false);
            }

            return(ReturnVal);
        }//IsAuthenticated()
Ejemplo n.º 4
0
 public CswEnumAuthenticationStatus Authenticate(CswWebSvcSessionAuthenticateData.Authentication.Request AuthenticationRequest)
 {
     AuthenticationRequest.IpAddress = CswWebSvcCommonMethods.getIpAddress();
     return(CswSessionManager.beginSession(AuthenticationRequest));
 }//Authenticate()