コード例 #1
0
        public questStatus Logout(LogoutRequestViewModel logoutRequestViewModel)
        {
            // Initialize
            questStatus status = null;


            // Perform logout
            UserSessionId userSessionId = new UserSessionId(logoutRequestViewModel.ctx);
            AccountMgr    accountMgr    = new AccountMgr(this.UserSession);

            status = accountMgr.Logout(userSessionId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
コード例 #2
0
        public ActionResult Logout(LogoutRequestViewModel logoutRequestViewModel)
        {
            // Initialize
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                return(RedirectToAction("Index", "Home", new { _ctx = logoutRequestViewModel.ctx }));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize();
            if (!questStatusDef.IsSuccess(status))
            {
                return(RedirectToAction("Index", "Home", new { _ctx = logoutRequestViewModel.ctx }));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Logout
            *---------------------------------------------------------------------------------------------------------------------------------*/
            AccountModeler accountModeler = new AccountModeler(this.Request, this.UserSession);

            status = accountModeler.Logout(logoutRequestViewModel);
            if (!questStatusDef.IsSuccess(status))
            {
                return(RedirectToAction("Index", "Home", new { _ctx = logoutRequestViewModel.ctx }));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Direct user to login page.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            return(RedirectToAction("Index"));
        }