Beispiel #1
0
        protected override void Adapt()
        {
            string session = sessionStorage.GetAmplaSession();

            if (!string.IsNullOrEmpty(session))
            {
                if (userService.RenewSession(session) == null)
                {
                    formsAuthenticationService.SessionExpired();
                }
            }
        }
Beispiel #2
0
        public ActionResult CurrentUser()
        {
            string session = amplaSessionStorage.GetAmplaSession();

            AmplaUser user = amplaUserService.RenewSession(session);

            if (user == null)
            {
                return(RedirectToAction("Login"));
            }

            UserModel model = new UserModel
            {
                UserName     = user.UserName,
                Session      = user.Session,
                Started      = user.LoginTime,
                LastActivity = user.LastActivity,
                LoginType    = user.LoginType
            };

            return(View("CurrentUser", model));
        }