Exemplo n.º 1
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            try
            {
                if (!IsActionLogDisabled)
                {
                    if (Settings.Repository == null)
                    {
                        throw new ApplicationException("No repository specified to log actions.");
                    }

                    var log = BuildActionLog(filterContext);
                    Settings.Repository.AddToActionLogs(log, true);
                }
            }
            catch (Exception ex)
            {
                // Dont let the action logging affect user experience.
                TREventLog.Log(ex.ToString(), LogType.Error);
            }
            finally
            {
                base.OnActionExecuting(filterContext);
            }
        }
Exemplo n.º 2
0
        public static DateTime?CoreAdmin_GetLastTimeStamp(HttpContextBase context)
        {
            DateTime?ret = null;

            try
            {
                if (context.Session[ADMIN_LAST_TIMESTAMP] != null)
                {
                    ret = (DateTime)context.Session[ADMIN_LAST_TIMESTAMP];
                }
            }
            catch (Exception ex)
            {
                TREventLog.Log(ex.Message, LogType.Error);
            }
            return(ret);
        }
Exemplo n.º 3
0
        public static bool CoreAdmin_IsLoggedIn(HttpContextBase context)
        {
            var ret = false;

            if (context.Session[ADMIN_LOGIN_KEY] != null)
            {
                try
                {
                    ret = (bool)context.Session[ADMIN_LOGIN_KEY];
                }
                catch (Exception ex)
                {
                    TREventLog.Log(ex.Message, LogType.Error);
                }
            }
            return(ret);
        }